Skip to content

Commit 13c6471

Browse files
authored
Added ArtifactsOutputPath as one of PSModulePath (#19425)
* Added ArtifactsOutputPath as PSModulePath * Refactor scripts * Update RunVersionController.ps1
1 parent b6c96bb commit 13c6471

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

tools/RunVersionController.ps1

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ Param(
1818
[string]$ModuleName,
1919

2020
[Parameter()]
21-
[string]$GalleryName = "PSGallery"
21+
[string]$GalleryName = "PSGallery",
22+
23+
[Parameter()]
24+
[string]$ArtifactsOutputPath = "$PSScriptRoot/../artifacts/Release/"
2225
)
2326

2427
enum PSVersion
@@ -275,7 +278,20 @@ function Bump-AzVersion
275278
$changeLog += "#### $updatedModule"
276279
$changeLog += $(Get-ReleaseNotes -Module $updatedModule -RootPath $rootPath) + "`n"
277280
}
278-
281+
282+
$resolvedArtifactsOutputPath = (Resolve-Path $ArtifactsOutputPath).Path
283+
if(!(Test-Path $resolvedArtifactsOutputPath))
284+
{
285+
throw "Please check artifacts output path: $resolvedArtifactsOutputPath whether exists."
286+
}
287+
288+
# Update-ModuleManifest requires all required modules in Az.psd1 installed in local
289+
# Add artifacts as PSModulePath to skip installation
290+
if(!($env:PSModulePath.Split(";").Contains($resolvedArtifactsOutputPath)))
291+
{
292+
$env:PSModulePath += ";$resolvedArtifactsOutputPath"
293+
}
294+
279295
Update-ModuleManifest -Path "$PSScriptRoot\Az\Az.psd1" -ModuleVersion $newVersion -ReleaseNotes $releaseNotes
280296
Update-ChangeLog -Content $changeLog -RootPath $rootPath
281297
return $versionBump

0 commit comments

Comments
 (0)