Skip to content

Commit 26ad83f

Browse files
davidsmatlakDCtheGeek
authored andcommitted
Fixes #4811 - Added instructions to install PowerShellGet without existing version installed (#4816)
* issue 4811 * fixes from PR review
1 parent b0bf859 commit 26ad83f

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

gallery/installing-psget.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
ms.date: 06/12/2017
2+
ms.date: 09/19/2019
33
contributor: manikb
44
keywords: gallery,powershell,cmdlet,psget
55
title: Installing PowerShellGet
@@ -41,13 +41,21 @@ Update-Module -Name PowerShellGet
4141
Exit
4242
```
4343

44-
### For systems running PowerShell 3 or PowerShell 4, that have installed the PackageManagement Preview
44+
### For computers running PowerShell 3.0 or PowerShell 4.0
4545

46-
1. From an elevated PowerShell session, use `Save-Module` to save the modules to a local directory.
46+
These instructions apply to computers that have the **PackageManagement Preview** installed or don't
47+
have any version of **PowerShellGet** installed.
48+
49+
The `Save-Module` cmdlet is used in both sets of instructions. `Save-Module` downloads and saves a
50+
module and any dependencies from a registered repository. The module's most current version is saved
51+
to a specified path on the local computer, but isn't installed. For more information, see [Save-Module](/powershell/module/PowershellGet/Save-Module).
52+
53+
#### Computers with the PackageManagement Preview installed
54+
55+
1. From a PowerShell session, use `Save-Module` to save the modules to a local directory.
4756

4857
```powershell
49-
Save-Module -Name PowerShellGet -Path C:\LocalFolder
50-
Exit
58+
Save-Module -Name PowerShellGet -Path C:\LocalFolder -Repository PSGallery
5159
```
5260

5361
1. Ensure that the **PowerShellGet** and **PackageManagement** modules aren't loaded in any other
@@ -60,3 +68,21 @@ Exit
6068
Copy-Item "C:\LocalFolder\PowerShellGet\*" "$env:ProgramFiles\WindowsPowerShell\Modules\PowerShellGet\" -Recurse -Force
6169
Copy-Item "C:\LocalFolder\PackageManagement\*" "$env:ProgramFiles\WindowsPowerShell\Modules\PackageManagement\" -Recurse -Force
6270
```
71+
72+
#### Computers without PowerShellGet
73+
74+
For computer's without any version of **PowerShellGet** installed, a computer with **PowerShellGet**
75+
installed is needed to download the modules.
76+
77+
1. From the computer that has **PowerShellGet** installed, use `Save-Module` to download the current
78+
version of **PowerShellGet**. Two folders are downloaded: **PowerShellGet** and
79+
**PackageManagement**. Each folder contains a subfolder with a version number.
80+
81+
```powershell
82+
Save-Module -Name PowerShellGet -Path C:\LocalFolder -Repository PSGallery
83+
```
84+
85+
1. Copy the **PowerShellGet** and **PackageManagement** folders to the computer that doesn't have
86+
**PowerShellGet** installed.
87+
88+
The destination directory is: `$env:ProgramFiles\WindowsPowerShell\Modules`

0 commit comments

Comments
 (0)