From: Edward Delaporte Date: Wed, 13 Jan 2021 21:26:55 +0000 (-0600) Subject: Script to extract markdown from a teams project Excel export. X-Git-Url: https://us-delaporte.pagekite.me/gitweb/dotfiles.git/commitdiff_plain/34b6143db4367591d895c2ec40e99bd54aa07223 Script to extract markdown from a teams project Excel export. --- diff --git a/Toybox/Teams2Markdown.ps1 b/Toybox/Teams2Markdown.ps1 new file mode 100644 index 0000000..3d3ebc7 --- /dev/null +++ b/Toybox/Teams2Markdown.ps1 @@ -0,0 +1,48 @@ +<# +.SYNOPSIS + Converts a Microsoft Teams Project Board Excel export into Markdown. + +.PARAMETER Path + The path to an Excel file exported from a Microsoft Teams project. + +.PARAMETER StartRow + The first row of data in the Teams project Excel export. + Defaults to 5. + +.EXAMPLE + +> ./Teams2Markdown.ps1 -Path C:\tmp\TeamsExport.xlsx | Out-File -Path c:\TeamsMarkdown.md + +.NOTES + +This script requires the Import-Excel module, available in PowerShell gallery. + +> Install-Module Import-Excel + +#> +param( + [string]$Path, + [int]$StartRow = 5 +) + +$xlData = Import-Excel -Path $Path -StartRow $StartRow + + # $xlData | Select-Object -First 2 | Format-List + +$xlData | Sort-Object { $_."Bucket" } | ForEach-Object { + if(!$_."Task Name" -eq "") { + "" + "## $($_."Task Name") - $($_."Bucket Name")" + "" + + if(!$_."Description" -eq "") { + "$($_."Description")" + } + + if(!$_."Checklist Items" -eq "") { + $_."Checklist Items".split(';') | ForEach-Object { + "+ $($_)" + } + } + } +} \ No newline at end of file