|
1 | 1 | ---
|
2 |
| -ms.date: 06/12/2017 |
| 2 | +ms.date: 09/19/2019 |
3 | 3 | contributor: manikb
|
4 | 4 | keywords: gallery,powershell,cmdlet,psget
|
5 | 5 | title: Installing PowerShellGet
|
@@ -41,13 +41,21 @@ Update-Module -Name PowerShellGet
|
41 | 41 | Exit
|
42 | 42 | ```
|
43 | 43 |
|
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 |
45 | 45 |
|
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. |
47 | 56 |
|
48 | 57 | ```powershell
|
49 |
| - Save-Module -Name PowerShellGet -Path C:\LocalFolder |
50 |
| - Exit |
| 58 | + Save-Module -Name PowerShellGet -Path C:\LocalFolder -Repository PSGallery |
51 | 59 | ```
|
52 | 60 |
|
53 | 61 | 1. Ensure that the **PowerShellGet** and **PackageManagement** modules aren't loaded in any other
|
|
60 | 68 | Copy-Item "C:\LocalFolder\PowerShellGet\*" "$env:ProgramFiles\WindowsPowerShell\Modules\PowerShellGet\" -Recurse -Force
|
61 | 69 | Copy-Item "C:\LocalFolder\PackageManagement\*" "$env:ProgramFiles\WindowsPowerShell\Modules\PackageManagement\" -Recurse -Force
|
62 | 70 | ```
|
| 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