]> us-delaporte.pagekite.me Git - dotfiles.git/blob - Toybox/Teams2Markdown.ps1
Fixed typos.
[dotfiles.git] / Toybox / Teams2Markdown.ps1
1 <#
2 .SYNOPSIS
3 Converts a Microsoft Teams Project Board Excel export into Markdown.
4
5 .PARAMETER Path
6 The path to an Excel file exported from a Microsoft Teams project.
7
8 .PARAMETER StartRow
9 The first row of data in the Teams project Excel export.
10 Defaults to 5.
11
12 .EXAMPLE
13
14 > ./Teams2Markdown.ps1 -Path C:\tmp\TeamsExport.xlsx | Out-File c:\tmp\TeamsMarkdown.md
15
16 .NOTES
17
18 This script requires the Import-Excel module, available in PowerShell gallery.
19
20 > Install-Module Import-Excel
21
22 #>
23 param(
24 [string]$Path,
25 [int]$StartRow = 5
26 )
27
28 $xlData = Import-Excel -Path $Path -StartRow $StartRow
29
30 # $xlData | Select-Object -First 2 | Format-List
31
32 $xlData | Sort-Object { $_."Bucket" } | ForEach-Object {
33 if(!$_."Task Name" -eq "") {
34 ""
35 "## $($_."Task Name") - $($_."Bucket Name")"
36 ""
37
38 if(!$_."Description" -eq "") {
39 "$($_."Description")"
40 }
41
42 if(!$_."Checklist Items" -eq "") {
43 $_."Checklist Items".split(';') | ForEach-Object {
44 "+ $($_)"
45 }
46 }
47 }
48 }