]> apps.delaporte.us Git - dotfiles.git/blob - Toybox/Teams2Markdown.ps1
Some settings to make TV use more tolerable.
[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 Name" } | ForEach-Object {
33
34 if(!$_."Task Name" -eq "") {
35 ""
36 "## $($_."Task Name") - $($_."Bucket Name")"
37 ""
38
39 if(!$_."Description" -eq "") {
40 "$($_."Description")"
41 }
42
43 if(!$_."Checklist Items" -eq "") {
44 $_."Checklist Items".split(';') | ForEach-Object {
45 "+ $($_)"
46 }
47 }
48 }
49 }
50
51 "Generated by [Teams2Markdown Script][1]."
52 "[1]: https://github.com/edthedev/dotfiles/blob/master/Toybox/Teams2Markdown.ps1"