diff --git a/CHANGELOG.md b/CHANGELOG.md index 847dd75..bbda441 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Fix build problems preventing help from being compiled and added + to the module. + ### Changed - Update sample labs for Windows Server 2019 to use latest diff --git a/build.yaml b/build.yaml index 27efa52..4ecc126 100644 --- a/build.yaml +++ b/build.yaml @@ -26,13 +26,20 @@ BuildWorkflow: to load YamlDotNet.dll which conflicts with one loaded by Module-Builder. #> - if ([System.String]::IsNullOrEmpty($ModuleVersion)) + if ([System.String]::IsNullOrEmpty($ENV:ModuleVersion)) { - $ModuleVersion = '0.0.1' + Write-Host -Object 'ModuleVersion environment variable is not defined.' + $moduleVersion = ($BuildModuleOutput | Join-Path -ChildPath $ProjectName | Get-ChildItem -Attributes D | Sort-Object -Property Name)[0].Name } + else + { + $moduleVersion = (($ENV:ModuleVersion -Split '-') -Split '\+')[0] + } + + Write-Host -Object "Compiling help for version $moduleVersion." - $outputPath = "$BuildModuleOutput\$ProjectName\$(($ModuleVersion -Split '-')[0])" - $execute = "New-ExternalHelp -Path '$ProjectPath\docs' -OutputPath '$OutputPath' -Force" + $outputPath = "$BuildModuleOutput\$ProjectName\$moduleVersion" + $execute = "New-ExternalHelp -Path '$ProjectPath\docs' -OutputPath '$outputPath' -Force" if ($IsCoreCLR) {