diff --git a/src/Az.BootStrapper/Module/Az.Bootstrapper.psm1 b/src/Az.BootStrapper/Module/Az.Bootstrapper.psm1 index ed711454..a99d8f29 100644 --- a/src/Az.BootStrapper/Module/Az.Bootstrapper.psm1 +++ b/src/Az.BootStrapper/Module/Az.Bootstrapper.psm1 @@ -169,9 +169,11 @@ function Get-AzProfileMap [CmdletBinding()] param([Switch]$Update) - $azBootStrapperLocalProfile = [System.Environment]::GetEnvironmentVariable("AzBootStrapperLocalProfile","Machine") + # Must use Get-Item and not [Environment]::GetEnvironmentVariable since the latter doesn't work on Unix systems. + $azBootStrapperLocalProfile = Get-Item -Path Env:AzBootStrapperLocalProfile -ErrorAction SilentlyContinue if ($azBootStrapperLocalProfile) { + $azBootStrapperLocalProfile = $azBootStrapperLocalProfile.Value $scriptBlock = { Get-Content -Path $azBootStrapperLocalProfile -ErrorAction stop | ConvertFrom-Json } diff --git a/src/Az.BootStrapper/readme.md b/src/Az.BootStrapper/readme.md index 15e2cf41..ddd81790 100644 --- a/src/Az.BootStrapper/readme.md +++ b/src/Az.BootStrapper/readme.md @@ -20,7 +20,7 @@ Install-AzProfile -Profile - To install local profile, set the environment variable AzBootStrapperLocalProfile with the full path to the local profile on your system. ``` -[Environment]::SetEnvironmentVariable("AzBootStrapperLocalProfile", , [System.EnvironmentVariableTarget]::Machine) +Set-Item -Path Env:AzBootStrapperLocalProfile -Value Set-BootStrapRepo -Repo Install-AzProfile -Profile ```