Update the PowerShell example to set the PATH (#9771)

`set PATH=%PATH%;C:\terraform` is the old fashioned CMD ways to do which doesn't work in a PowerShell command line.
Moreover, the change made in the CMD console would not be permanent.

The solution proposed here uses .NET Framework’s System.Environment class in PowerShell to properly edit the path.
Source : https://technet.microsoft.com/en-us/library/ff730964.aspx
This commit is contained in:
alexis-turpin 2016-11-01 22:56:18 +08:00 committed by Paul Stack
parent 4c88a98819
commit f16309630e
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ Example for Linux/Mac - Type the following into your terminal:
>`PATH=/usr/local/terraform/bin:/home/your-user-name/terraform:$PATH`
Example for Windows - Type the following into Powershell:
>`set PATH=%PATH%;C:\terraform`
>`[Environment]::SetEnvironmentVariable("PATH", $env:PATH + ({;C:\terraform},{C:\terraform})[$env:PATH[-1] -eq ';'], "User")`
## Verifying the Installation