diff --git a/images/win/scripts/Installers/Install-DotnetSDK.ps1 b/images/win/scripts/Installers/Install-DotnetSDK.ps1 index 996887885..d5a414114 100644 --- a/images/win/scripts/Installers/Install-DotnetSDK.ps1 +++ b/images/win/scripts/Installers/Install-DotnetSDK.ps1 @@ -100,10 +100,10 @@ function RunPostInstallationSteps() { Add-MachinePathItem "C:\Program Files\dotnet" # Run script at startup for all users - $cmdDotNetPath = @" + $cmdDotNetPath = @' @echo off -SETX PATH "%USERPROFILE%\.dotnet\tools;%PATH%" -"@ +powershell -executionpolicy bypass -noprofile -command "[System.Environment]::SetEnvironmentVariable('PATH',"""$env:USERPROFILE\.dotnet\tools;$env:PATH""", 'USER')" +'@ $cmdPath = "C:\Program Files\dotnet\userpath.bat" $cmdDotNetPath | Out-File -Encoding ascii -FilePath $cmdPath