diff --git a/tools/RunVersionController.ps1 b/tools/RunVersionController.ps1 index f1b627e41ee3..8abb578c3deb 100644 --- a/tools/RunVersionController.ps1 +++ b/tools/RunVersionController.ps1 @@ -397,11 +397,11 @@ function Update-AzPreviewChangelog function Update-AzSyntaxChangelog { - Write-Host "starting revise SyntaxChangelog" + Write-Host "starting revise SyntaxChangeLog" $rootPath = "$PSScriptRoot\.." $NewVersion = (Import-PowerShellDataFile "$PSScriptRoot\Az\Az.psd1").ModuleVersion - Update-ChangeLog -Content "## $NewVersion - $Release" -FilePath "$rootPath\documentation\SyntaxChangelog.md" - $changeLog = Get-Content "$rootPath\documentation\SyntaxChangelog.md" -Raw + Update-ChangeLog -Content "## $NewVersion - $Release" -FilePath "$rootPath\documentation\SyntaxChangeLog.md" + $changeLog = Get-Content "$rootPath\documentation\SyntaxChangeLog.md" -Raw $regex = '####\s+(Az\.\w+)\s+(?![\d\.])' $matches = Select-String -Pattern $regex -InputObject $changelog -AllMatches foreach ($match in $matches.Matches) { @@ -411,7 +411,7 @@ function Update-AzSyntaxChangelog $replacement = "#### $moduleName $newVersion `r`n" $changelog = $changelog -replace [regex]::Escape($match.Value), $replacement } - Set-Content -Path "$rootPath\documentation\SyntaxChangelog.md" -Value $changelog + Set-Content -Path "$rootPath\documentation\SyntaxChangeLog.md" -Value $changelog } function New-CommandMappingFile diff --git a/tools/VersionController/Models/SyntaxChangelogGenerator.cs b/tools/VersionController/Models/SyntaxChangelogGenerator.cs index 94e9c4df2393..8bff4d88519a 100644 --- a/tools/VersionController/Models/SyntaxChangelogGenerator.cs +++ b/tools/VersionController/Models/SyntaxChangelogGenerator.cs @@ -24,9 +24,9 @@ public class SyntaxChangelogGenerator "ProxyCredential", "ProxyUseDefaultCredentials", "Verbose", "WarningAction", "WarningVariable" }; private List diffInfo = new List(); - public void Analyze(String srcDirs) + public void Analyze(String rootDirectory) { - var savedDirectory = Directory.GetCurrentDirectory(); + var srcDirs = Path.Combine(rootDirectory, @"src\"); var manifestFiles = Directory.EnumerateFiles(srcDirs, "*.psd1", SearchOption.AllDirectories) .Where(file => !Path.GetDirectoryName(file) @@ -48,8 +48,7 @@ public void Analyze(String srcDirs) CmdletLoader.ModuleMetadata = newModuleMetadata; CompareModuleMetedata(oldModuleMetadata, newModuleMetadata, moduleName); } - Directory.SetCurrentDirectory(savedDirectory); - var markDownPath = Path.Combine(savedDirectory, "documentation/SyntaxChangelog.md"); + var markDownPath = Path.Combine(rootDirectory, "documentation/SyntaxChangeLog.md"); GenerateMarkdown(markDownPath); Console.WriteLine("Cmdlets Differences written to {0}", markDownPath); } @@ -407,7 +406,7 @@ public void GenerateMarkdown(string filePath) } if (GetDescription(diffInfo[i]) != "") { - sb.Append("\n * " + GetDescription(diffInfo[i])); + sb.Append("\n - " + GetDescription(diffInfo[i])); if (i < diffInfo.Count - 1 && diffInfo[i + 1].CmdletName != diffInfo[i].CmdletName) { sb.Append("\n"); diff --git a/tools/VersionController/Program.cs b/tools/VersionController/Program.cs index 511dcac9fe0b..c65d82907af8 100644 --- a/tools/VersionController/Program.cs +++ b/tools/VersionController/Program.cs @@ -76,7 +76,7 @@ public static void Main(string[] args) ConsolidateExceptionFiles(exceptionsDirectory); ValidateManifest(); - GenerateSyntaxChangelog(Path.Combine(_rootDirectory, @"src\")); + GenerateSyntaxChangelog(_rootDirectory); BumpVersions(); } private static void GenerateSyntaxChangelog(string _projectDirectories)