Fixed bug in posh-docker setup instructions

There were two problems that this fixes.

1. Before this change, posh-docker was being installed twice. Once for the system (via NuGet) and secondly in the user's PowerShell context. This was confusing. I understand the reason was probably to create the user's $PROFILE file if it didn't already exist. I've replaced that functionality with clearer code.

2. The instructions had incorrectly said to add "Install-Module posh-docker" to the $PROFILE. Instead, this needed to be "Import-Module posh-docker".
This commit is contained in:
Joel Rowley 2017-02-06 11:59:15 -05:00
parent 4952fb1929
commit 0eec822339
1 changed files with 6 additions and 3 deletions

View File

@ -400,15 +400,18 @@ PowerShell Module as follows.
command to a `$PROFILE` by typing these commands at the PowerShell prompt.
```none
Install-Module -Scope CurrentUser posh-docker -Force
Add-Content $PROFILE "`nInstall-Module posh-docker"
if (-Not (Test-Path $PROFILE)) {
New-Item $PROFILE Type File Force
}
Add-Content $PROFILE "`nImport-Module posh-docker"
```
This creates a `$PROFILE` if one does not already exist, and adds this line
into the file:
```none
Install-Module posh-docker
Import-Module posh-docker
```
To check that the file was properly created, or simply edit it manually,