1
1
2
2
<#
3
3
. SYNOPSIS
4
- Update the module features table in the given markdown file
4
+ Update the module features table in the given markdown file path
5
5
6
6
. DESCRIPTION
7
- Update the module features table in the given markdown file
7
+ Update the module features table in the given markdown file path
8
8
9
9
. PARAMETER markdownFilePath
10
10
Mandatory. The path to the markdown file to update.
@@ -16,9 +16,9 @@ Mandatory. The path to the modules folder.
16
16
Mandatory. The path to the root of the repository containing the modules.
17
17
18
18
. EXAMPLE
19
- Set-BicepModuleStatusBadgesTable -markdownFilePath 'bicep-features-table .md' -ModulesFolderPath 'bicep-registry-modules/avm/res' -ModulesRepoRootPath 'bicep-registry-modules'
19
+ Set-BicepModuleStatusBadgesTable -markdownFilePath 'bicepBadges .md' -ModulesFolderPath 'bicep-registry-modules/avm/res' -ModulesRepoRootPath 'bicep-registry-modules'
20
20
21
- Update the file 'bicep-features-table .md' based on the modules in path 'bicep-registry-modules/avm/res'
21
+ Update the file 'bicepBadges .md' based on the modules in path 'bicep-registry-modules/avm/res'
22
22
#>
23
23
function Set-BicepModuleStatusBadgesTable {
24
24
@@ -35,11 +35,7 @@ function Set-BicepModuleStatusBadgesTable {
35
35
)
36
36
37
37
# Load external functions
38
- . (Join-Path $PSScriptRoot ' helper' ' Merge-FileWithNewContent.ps1' )
39
38
. (Join-Path $PSScriptRoot ' helper' ' Get-ModulesFeatureOutline.ps1' )
40
-
41
- # Logic
42
- $originalContentArray = Get-Content - Path $markdownFilePath
43
39
44
40
$functionInput = @ {
45
41
ModulesFolderPath = $ModulesFolderPath
@@ -48,16 +44,14 @@ function Set-BicepModuleStatusBadgesTable {
48
44
OnlyTopLevel = $true
49
45
ColumnsToInclude = @ ( ' Status' )
50
46
}
51
- $featureTableString = Get-ModulesFeatureOutline @functionInput - Verbose
52
-
53
- $newContent = Merge-FileWithNewContent - oldContent $originalContentArray - newContent $featureTableString.TrimEnd () - sectionStartIdentifier ' # Feature table' - contentType ' table'
47
+ $badgesMarkdown = Get-ModulesFeatureOutline @functionInput - Verbose
54
48
55
49
Write-Verbose ' New content:'
56
50
Write-Verbose ' ============'
57
- Write-Verbose ($newContent | Out-String )
51
+ Write-Verbose ($badgesMarkdown | Out-String )
58
52
59
53
if ($PSCmdlet.ShouldProcess (" File in path [$markdownFilePath ]" , ' Overwrite' )) {
60
- Set-Content - Path $markdownFilePath - Value $newContent - Force
54
+ Set-Content - Path $markdownFilePath - Value $badgesMarkdown - Force
61
55
Write-Verbose " File [$markdownFilePath ] updated" - Verbose
62
56
}
63
57
}
0 commit comments