@@ -164,10 +164,10 @@ function Update-ChangeLog
164
164
[Parameter (Mandatory = $true )]
165
165
[string []]$Content ,
166
166
[Parameter (Mandatory = $true )]
167
- [string ]$RootPath
167
+ [string ]$FilePath
168
168
)
169
169
170
- $ChangeLogFile = Get-Item - Path " $RootPath \ChangeLog.md "
170
+ $ChangeLogFile = Get-Item - Path $FilePath
171
171
$ChangeLogContent = Get-Content - Path $ChangeLogFile.FullName
172
172
($Content + $ChangeLogContent ) | Set-Content - Path $ChangeLogFile.FullName - Encoding UTF8
173
173
}
@@ -295,7 +295,7 @@ function Bump-AzVersion
295
295
}
296
296
297
297
Update-ModuleManifest - Path " $PSScriptRoot \Az\Az.psd1" - ModuleVersion $newVersion - ReleaseNotes $releaseNotes
298
- Update-ChangeLog - Content $changeLog - RootPath $rootPath
298
+ Update-ChangeLog - Content $changeLog - FilePath " $rootPath \ChangeLog.md "
299
299
300
300
New-CommandMappingFile
301
301
@@ -392,8 +392,26 @@ function Update-AzPreviewChangelog
392
392
$changeLog += " #### $updatedModule $ ( $moduleMetadata.ModuleVersion ) "
393
393
$changeLog += $moduleReleaseNotes + " `n "
394
394
}
395
- Update-ChangeLog - Content $changeLog - RootPath $rootPath / tools/ AzPreview
395
+ Update-ChangeLog - Content $changeLog - FilePath " $rootPath /tools/AzPreview/ChangeLog.md"
396
+ }
396
397
398
+ function Update-AzSyntaxChangelog
399
+ {
400
+ Write-Host " starting revise SyntaxChangelog"
401
+ $rootPath = " $PSScriptRoot \.."
402
+ $NewVersion = (Import-PowerShellDataFile " $PSScriptRoot \Az\Az.psd1" ).ModuleVersion
403
+ Update-ChangeLog - Content " ## $NewVersion - $Release " - FilePath " $rootPath \documentation\SyntaxChangelog.md"
404
+ $changeLog = Get-Content " $rootPath \documentation\SyntaxChangelog.md" - Raw
405
+ $regex = ' ####\s+(Az\.\w+)\s+(?![\d\.])'
406
+ $matches = Select-String - Pattern $regex - InputObject $changelog - AllMatches
407
+ foreach ($match in $matches.Matches ) {
408
+ $moduleName = $match.Groups [1 ].Value
409
+ $moduleMetadata = Get-ModuleMetadata - Module $moduleName - RootPath $rootPath
410
+ $newVersion = $moduleMetadata.ModuleVersion
411
+ $replacement = " #### $moduleName $newVersion `r`n "
412
+ $changelog = $changelog -replace [regex ]::Escape($match.Value ), $replacement
413
+ }
414
+ Set-Content - Path " $rootPath \documentation\SyntaxChangelog.md" - Value $changelog
397
415
}
398
416
399
417
function New-CommandMappingFile
@@ -502,6 +520,7 @@ switch ($PSCmdlet.ParameterSetName)
502
520
# Refresh AzPreview.psd1
503
521
Update-AzPreview
504
522
Update-AzPreviewChangelog
523
+ Update-AzSyntaxChangelog
505
524
# We need to generate the upcoming-breaking-changes.md after the process of bump version in minor release
506
525
if ([PSVersion ]::MINOR -Eq $versionBump )
507
526
{
0 commit comments