@@ -227,7 +227,7 @@ Updating module manifest file $ModuleManifestPath with the following content:
227227 }
228228}
229229
230- Task Test - Depends Build {
230+ Task Test - Depends Build - PreCondition { -not $SkipTests } {
231231
232232 exec {Invoke-Pester - Path $TestsDir - OutputFile (Join-Path $OutDir TestResults.xml) - OutputFormat NUnitXml `
233233 - PesterOption (New-PesterOption - IncludeVSCodeMarker ) - Strict}
@@ -283,7 +283,12 @@ Task PackageModule -Depends Build {
283283Task PackageNuget - Depends Build, GenerateNuspec {
284284
285285 Copy-Item $ModuleDir $NugetToolsDir \TfsCmdlets - Recurse - Exclude * .ps1 - Force
286- & $NugetExePath @ (' Pack' , $NugetSpecPath , ' -OutputDirectory' , $NugetDir , ' -Verbosity' , ' Detailed' , ' -NonInteractive' ) * > & 1 | Write-Verbose
286+
287+ $cmdLine = " $NugetExePath Pack $NugetSpecPath -OutputDirectory $NugetDir -Verbosity Detailed -NonInteractive -Version $NugetVersion "
288+
289+ Write-Verbose " Command line: [$cmdLine ]"
290+
291+ Invoke-Expression $cmdLine * > & 1 | Write-Verbose
287292}
288293
289294Task PackageChocolatey - Depends Build {
@@ -296,7 +301,11 @@ Task PackageChocolatey -Depends Build {
296301 Copy-Item $ModuleDir $ChocolateyToolsDir \TfsCmdlets - Recurse - Force
297302 Copy-Item $NugetSpecPath - Destination $ChocolateyDir - Force
298303
299- & $ChocolateyPath Pack $ChocolateySpecPath - OutputDirectory $ChocolateyDir | Write-Verbose
304+ $cmdLine = " $ChocolateyPath Pack $ChocolateySpecPath -OutputDirectory $ChocolateyDir --Version $Version "
305+
306+ Write-Verbose " Command line: [$cmdLine ]"
307+
308+ Invoke-Expression $cmdLine * > & 1 | Write-Verbose
300309}
301310
302311Task PackageMsi - Depends Build {
@@ -468,7 +477,7 @@ Task GenerateNuspec {
468477 <metadata>
469478 <id>$ ( $SourceManifest.Name ) </id>
470479 <title>$ ( $SourceManifest.Name ) </title>
471- <version>$NugetVersion </version>
480+ <version>0.0.0 </version>
472481 <authors>$ ( $SourceManifest.Author ) </authors>
473482 <owners>$ ( $SourceManifest.Author ) </owners>
474483 <licenseUrl>$ ( $SourceManifest.LicenseUri ) </licenseUrl>
0 commit comments