param( [Parameter(Mandatory=$true)] [string]$YamlFilePath,
[Parameter(Mandatory=$true)]
[string]$OutputMarkdownPath
)
Import-Module powershell-yaml
$yamlContent = Get-Content -Path $YamlFilePath -Raw $yamlData = ConvertFrom-Yaml $yamlContent
$markdownContent = ""
$groupedData = $yamlData | Group-Object -Property applicationName
foreach ($group in $groupedData) {
$applicationName = $group.Name
$markdownContent += "# $applicationNamen" $markdownContent += "| permissionid | permission name |
n"
$markdownContent += "|--------------|-----------------|`n"
foreach ($item in $group.Group) {
foreach ($permission in $item.permissions) {
$markdownContent += "| $($permission.id) | $($permission.name) |`n"
}
}
$markdownContent += "`n"
}