Compare commits
3 Commits
main
...
djurek/tes
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7ae76c610 | ||
|
|
925236f365 | ||
|
|
4c96b1138b |
@ -8,7 +8,7 @@ function Update-PSModulePathForCI() {
|
|||||||
# https://github.com/microsoft/azure-pipelines-tasks/blob/c9771bc064cd60f47587c68e5c871b7cd13f0f28/Tasks/AzurePowerShellV5/Utility.ps1
|
# https://github.com/microsoft/azure-pipelines-tasks/blob/c9771bc064cd60f47587c68e5c871b7cd13f0f28/Tasks/AzurePowerShellV5/Utility.ps1
|
||||||
|
|
||||||
if ($IsWindows) {
|
if ($IsWindows) {
|
||||||
$hostedAgentModulePath = $env:SystemDrive + "\Modules"
|
$hostedAgentModulePath = $env:SystemDrive + "\\Modules"
|
||||||
$moduleSeperator = ";"
|
$moduleSeperator = ";"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@ -3,27 +3,10 @@ param(
|
|||||||
[string] $StorageContainerName = 'public-vcpkg-container'
|
[string] $StorageContainerName = 'public-vcpkg-container'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Write-Host "Import PSModules-Helpers.ps1"
|
||||||
."$PSScriptRoot/../common/scripts/Helpers/PSModule-Helpers.ps1"
|
."$PSScriptRoot/../common/scripts/Helpers/PSModule-Helpers.ps1"
|
||||||
|
|
||||||
Write-Host "`$env:PSModulePath = $($env:PSModulePath)"
|
Write-Host "Install/import Az.Storage@4.3.0"
|
||||||
|
|
||||||
# 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
|
Install-ModuleIfNotInstalled "Az.Storage" "4.3.0" | Import-Module
|
||||||
|
|
||||||
$ctx = New-AzStorageContext `
|
$ctx = New-AzStorageContext `
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user