Skip to content

Commit

Permalink
Added ArtifactsOutputPath as one of PSModulePath (Azure#19425)
Browse files Browse the repository at this point in the history
* Added ArtifactsOutputPath as PSModulePath

* Refactor scripts

* Update RunVersionController.ps1
  • Loading branch information
BethanyZhou authored Sep 7, 2022
1 parent b6c96bb commit 13c6471
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions tools/RunVersionController.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ Param(
[string]$ModuleName,

[Parameter()]
[string]$GalleryName = "PSGallery"
[string]$GalleryName = "PSGallery",

[Parameter()]
[string]$ArtifactsOutputPath = "$PSScriptRoot/../artifacts/Release/"
)

enum PSVersion
Expand Down Expand Up @@ -275,7 +278,20 @@ function Bump-AzVersion
$changeLog += "#### $updatedModule"
$changeLog += $(Get-ReleaseNotes -Module $updatedModule -RootPath $rootPath) + "`n"
}


$resolvedArtifactsOutputPath = (Resolve-Path $ArtifactsOutputPath).Path
if(!(Test-Path $resolvedArtifactsOutputPath))
{
throw "Please check artifacts output path: $resolvedArtifactsOutputPath whether exists."
}

# Update-ModuleManifest requires all required modules in Az.psd1 installed in local
# Add artifacts as PSModulePath to skip installation
if(!($env:PSModulePath.Split(";").Contains($resolvedArtifactsOutputPath)))
{
$env:PSModulePath += ";$resolvedArtifactsOutputPath"
}

Update-ModuleManifest -Path "$PSScriptRoot\Az\Az.psd1" -ModuleVersion $newVersion -ReleaseNotes $releaseNotes
Update-ChangeLog -Content $changeLog -RootPath $rootPath
return $versionBump
Expand Down

0 comments on commit 13c6471

Please sign in to comment.