Skip to content

Commit

Permalink
Fix machine path #411 (MicrosoftDocs#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickLang authored Dec 21, 2016
1 parent c0a7089 commit 553a969
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ Expand-Archive -Path "$env:TEMP\docker.zip" -DestinationPath $env:ProgramFiles
Add the Docker directory to the system path. When complete, restart the PowerShell session so that the modified path is recognized.

```powershell
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\Docker", [EnvironmentVariableTarget]::Machine)
# Add path to this PowerShell session immediately
$env:path += ";$env:ProgramFiles\Docker"
# For persistent use after a reboot
$existingMachinePath = [Environment]::GetEnvironmentVariable("Path",[System.EnvironmentVariableTarget]::Machine)
[Environment]::SetEnvironmentVariable("Path", $existingMachinePath + ";$env:ProgramFiles\Docker", [EnvironmentVariableTarget]::Machine)
```

To install Docker as a Windows service, run the following.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ Expand-Archive -Path "$env:TEMP\docker-1.13.0-rc4.zip" -DestinationPath $env:Pro
Add the Docker directory to the system path.

```none
# For quick use, does not require shell to be restarted.
$env:path += ";c:\program files\docker"
# Add path to this PowerShell session immediately
$env:path += ";$env:ProgramFiles\Docker"
# For persistent use, will apply even after a reboot.
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\Docker", [EnvironmentVariableTarget]::Machine)
# For persistent use after a reboot
$existingMachinePath = [Environment]::GetEnvironmentVariable("Path",[System.EnvironmentVariableTarget]::Machine)
[Environment]::SetEnvironmentVariable("Path", $existingMachinePath + ";$env:ProgramFiles\Docker", [EnvironmentVariableTarget]::Machine)
```

To install Docker as a Windows service, run the following.
Expand Down

0 comments on commit 553a969

Please sign in to comment.