Test removing psmodule stuff

This commit is contained in:
Daniel Jurek 2025-10-01 14:53:01 -07:00 committed by GitHub
parent 6fcc5d570f
commit 4c96b1138b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,25 +5,6 @@ param(
."$PSScriptRoot/../common/scripts/Helpers/PSModule-Helpers.ps1"
Write-Host "`$env:PSModulePath = $($env:PSModulePath)"
# Work around double backslash
if ($IsWindows) {
$hostedAgentModulePath = $env:SystemDrive + "\\Modules"
$moduleSeperator = ";"
} else {
$hostedAgentModulePath = "/usr/share"
$moduleSeperator = ":"
}
$modulePaths = $env:PSModulePath -split $moduleSeperator
$modulePaths = $modulePaths.Where({ !$_.StartsWith($hostedAgentModulePath) })
$AzModuleCachePath = (Get-ChildItem "$hostedAgentModulePath/az_*" -Attributes Directory) -join $moduleSeperator
if ($AzModuleCachePath -and $env.PSModulePath -notcontains $AzModuleCachePath) {
$modulePaths += $AzModuleCachePath
}
$env:PSModulePath = $modulePaths -join $moduleSeperator
Install-ModuleIfNotInstalled "Az.Storage" "4.3.0" | Import-Module
$ctx = New-AzStorageContext `