From de1a85cecd63777da453350df3a86e5de7eba6e6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 10 Jun 2020 19:30:50 -0400 Subject: [PATCH] Add ReleaseNotes.md File Creation --- ZertoApiWrapper.build.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 593e376..08efbac 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -185,6 +185,12 @@ task CreatePsm1ForRelease CreatePsd1ForRelease, { # Full Build Process - No Publishing task CreateArtifacts CleanPublish, AnalyzeBuiltFiles, BuiltFileTests, BuildMamlHelp, { Compress-Archive -Path $moduleOutPath -DestinationPath .\publish\ZertoApiWrapper.zip + $MyMatches = Select-String -Path "$BuildRoot\CHANGELOG.md" "^##\s\[" + $data = Get-Content "$BuildRoot\CHANGELOG.md" + $range = ($MyMatches[0].LineNumber - 1)..($MyMatches[1].LineNumber - 3) + foreach ($i in $range) { + Add-Content -Path "$BuildRoot\publish\ReleaseNotes.md" -Value ($data[$i]).replace("## ", "# ") -Encoding utf8 + } } #EndRegion