[Ubuntu, Windows] Add Azure modules to PS scope; deprecate zip (#13482)

This commit is contained in:
Erik Bershel
2026-01-09 11:03:49 +01:00
committed by GitHub
parent d9f2f12ea8
commit dce2b21f0a
9 changed files with 7 additions and 60 deletions

View File

@@ -11,6 +11,7 @@ Import-Module "$env:HELPER_SCRIPTS/../tests/Helpers.psm1"
# Get modules content from toolset
$modules = (Get-ToolsetContent).azureModules
$installPSModulePath = "/usr/share"
$psModuleMachinePath = $env:PSModulePath + ":"
foreach ($module in $modules) {
$moduleName = $module.name
@@ -19,9 +20,12 @@ foreach ($module in $modules) {
foreach ($version in $module.versions) {
$modulePath = Join-Path -Path $installPSModulePath -ChildPath "${moduleName}_${version}"
Write-Host " - $version [$modulePath]"
$psModuleMachinePath += ($modulePath + ":")
Save-Module -Path $modulePath -Name $moduleName -RequiredVersion $version -Force
}
}
$finalLine = "PSModulePath=$($psModuleMachinePath.TrimEnd(':').Replace("\root", '$HOME'))"
Add-Content -Path "/etc/environment" -Value $finalLine
Invoke-PesterTests -TestFile "PowerShellModules" -TestName "AzureModules"