]> us-delaporte.pagekite.me Git - dotfiles.git/blob - win_psmodules/Teams2Markdown.psm1
Add recipe for a borg env
[dotfiles.git] / win_psmodules / Teams2Markdown.psm1
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 > Export-Teams2Markdown -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 function Export-Teams2Markdown {
24
25 param(
26 [string]$Path,
27 [int]$StartRow = 5
28 )
29
30 $xlData = Import-Excel -Path $Path -StartRow $StartRow
31
32 # $xlData | Select-Object -First 2 | Format-List
33
34 $xlData | Sort-Object { $_."Bucket Name" } | ForEach-Object {
35
36 if(!$_."Task Name" -eq "") {
37 ""
38 "## $($_."Task Name") - $($_."Bucket Name")"
39 ""
40
41 if(!$_."Description" -eq "") {
42 "$($_."Description")"
43 }
44
45 if(!$_."Checklist Items" -eq "") {
46 $_."Checklist Items".split(';') | ForEach-Object {
47 "+ $($_)"
48 }
49 }
50 }
51 }
52
53 "Generated by [Teams2Markdown Script][1]."
54 "[1]: https://github.com/edthedev/dotfiles/blob/master/psmodules/Teams2Markdown.psm1"
55 }
56 Export-ModuleMember -Function Export-Teams2Markdown