Skip to content

Commit 128c56f

Browse files
authored
Merge pull request #111929 from paulbouwer/49374-windows-env-vars
Improve Windows env var guidance
2 parents e1bdd9c + cd40f02 commit 128c56f

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

articles/aks/includes/servicemesh/istio/install-client-binary-windows.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ New-Item -ItemType Directory -Force -Path "C:\Istio"
2929
Copy-Item -Path .\bin\istioctl.exe -Destination "C:\Istio\"
3030
3131
# Add C:\Istio to PATH.
32-
# Make the new PATH permanently available for the current User, and also immediately available in the current shell.
33-
$PATH = [environment]::GetEnvironmentVariable("PATH", "User") + "; C:\Istio\"
34-
[environment]::SetEnvironmentVariable("PATH", $PATH, "User")
35-
[environment]::SetEnvironmentVariable("PATH", $PATH)
32+
# Make the new PATH permanently available for the current User
33+
$USER_PATH = [environment]::GetEnvironmentVariable("PATH", "User") + ";C:\Istio\"
34+
[environment]::SetEnvironmentVariable("PATH", $USER_PATH, "User")
35+
# Make the new PATH immediately available in the current shell
36+
$env:PATH += ";C:\Istio\"
3637
```

articles/aks/includes/servicemesh/linkerd/install-client-binary-windows.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ New-Item -ItemType Directory -Force -Path "C:\Linkerd"
2727
Copy-Item -Path ".\linkerd2-cli-$LINKERD_VERSION-windows.exe" -Destination "C:\Linkerd\linkerd.exe"
2828
2929
# Add C:\Linkerd to PATH.
30-
# Make the new PATH permanently available for the current User, and also immediately available in the current shell.
31-
$PATH = [environment]::GetEnvironmentVariable("PATH", "User") + "; C:\Linkerd\"
32-
[environment]::SetEnvironmentVariable("PATH", $PATH, "User")
33-
[environment]::SetEnvironmentVariable("PATH", $PATH)
30+
# Make the new PATH permanently available for the current User
31+
$USER_PATH = [environment]::GetEnvironmentVariable("PATH", "User") + ";C:\Linkerd\"
32+
[environment]::SetEnvironmentVariable("PATH", $USER_PATH, "User")
33+
# Make the new PATH immediately available in the current shell
34+
$env:PATH += ";C:\Linkerd\"
3435
```

0 commit comments

Comments
 (0)