Skip to content

Commit b6d236b

Browse files
committed
Retire PowerShellGet v1 content
1 parent a2f4a4a commit b6d236b

48 files changed

Lines changed: 152 additions & 15441 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.openpublishing.redirection.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
{
22
"redirections": [
33
{
4-
"redirect_document_id": true,
5-
"redirect_url": "/powershell/gallery/powershellget/update-powershell-51",
4+
"redirect_document_id": false,
5+
"redirect_url": "/powershell/gallery/powershellget/install-powershellget",
66
"source_path": "powershell-gallery/docs-conceptual/powershellget/install-on-older-systems.md"
7+
},
8+
{
9+
"redirect_document_id": false,
10+
"redirect_url": "/powershell/gallery/powershellget/install-powershellget",
11+
"source_path": "powershell-gallery/docs-conceptual/powershellget/update-powershell-51.md"
712
}
813
]
914
}
Lines changed: 57 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
2-
description: This article explains how to install the required NuGet components for Windows PowerShell 5.1.
3-
ms.date: 01/27/2025
2+
description: >-
3+
This article explains how to manually install the required NuGet components for Windows PowerShell 5.1.
4+
ms.date: 01/26/2026
45
title: Bootstrapping NuGet
56
---
67
# Bootstrap the NuGet components for Windows PowerShell 5.1
@@ -10,28 +11,18 @@ components to interact with the PowerShell Gallery. PowerShellGet includes logic
1011
components as long as you can connect to the PowerShell Gallery. If the machine isn't connected to
1112
the internet, you must copy required files from a trusted source to the disconnected machine.
1213

13-
The required NuGet components are included in PowerShellGet v2+ and PackageManagement v1.1+. Newer
14-
versions of these modules are available from the PowerShell Gallery and included in PowerShell 6 and
15-
higher. These instructions are for Windows PowerShell 5.1.
14+
The updated NuGet provider is required by the commands work with the PowerShell Gallery. The
15+
`Publish-*` commands use `nuget.exe` to publish resources.
1616

17-
> [!IMPORTANT]
18-
> After bootstrapping the NuGet components, you must install latest versions of the PowerShellGet
19-
> and PackageManagement modules to be supported.
17+
## Install the latest version of PowerShellGet on an internet-connected machine
2018

21-
## Bootstrap on an internet-connected machine
22-
23-
The following processes assume the machine is connected to the internet and can download files from
24-
a public location.
25-
26-
### ERROR: NuGet provider is required to continue
27-
28-
You receive this error when the NuGet provider isn't available on the machine.
19+
To install the latest version of PowerShellGet, run the following command:
2920

3021
```powershell
31-
Find-Module -Repository PSGallery -Verbose -Name Contoso
22+
Install-Module -Name PowerShellGet -Repository PSGallery
3223
```
3324

34-
Answer the prompt with `Y` to install the NuGet provider.
25+
Answer the prompt with <kbd>Y</kbd> to install the NuGet provider.
3526

3627
```Output
3728
NuGet provider is required to continue
@@ -43,72 +34,68 @@ ame NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to instal
4334
ort the NuGet provider now?
4435
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
4536
VERBOSE: Installing NuGet provider.
46-
47-
Version Name Type Repository Description
48-
------- ---- ---- ---------- -----------
49-
2.5 Contoso Module PSGallery Contoso module
5037
```
5138

52-
### ERROR: NuGet.exe is required to continue
39+
When you answer <kbd>Y</kbd>, PowerShellGet installs the NuGet provider and the `nuget.exe`
40+
command-line tool (if necessary).
5341

54-
You receive this error when the NuGet provider is available, but the `nuget.exe` binary isn't.
42+
> [!NOTE]
43+
> When you install PowerShellGet, it automatically installs the latest version of
44+
> PackageManagement.
5545
56-
```powershell
57-
Publish-Module -Name Contoso -Repository PSGallery -Verbose
58-
```
59-
60-
Answer the prompt with `Y` to install `nuget.exe`.
46+
## Copy the required files to the isolated computer
6147

62-
```Output
63-
NuGet.exe is required to continue
64-
PowerShellGet requires NuGet.exe to publish an item to the NuGet-based repositories. NuGe
65-
t.exe must be available under one of the paths specified in PATH environment variable val
66-
ue. Do you want PowerShellGet to install NuGet.exe now?
67-
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
68-
VERBOSE: Installing NuGet.exe.
69-
VERBOSE: Successfully published module 'Contoso' to the module publish location 'https://
70-
www.powershellgallery.com/api/v2/'.
71-
Please allow few minutes for 'Contoso' to show up in the search results.
72-
```
48+
After installing the updates on the internet-connected machine, manually copy the components to the
49+
isolated node through a trusted offline process.
7350

74-
### ERROR: NuGet.exe and NuGet provider are required to continue
51+
1. Copy the PowerShellGet and PackageManagement modules to the offline machine. Use the following
52+
command to location the modules on the source machine:
7553

76-
You receive this error when both the NuGet provider and `nuget.exe` aren't installed.
54+
```powershell
55+
Get-Module PowerShellGet, PackageManagement -ListAvailable |
56+
Sort-Object Version -Descending |
57+
Select-Object Path -First 2
58+
```
7759

78-
```powershell
79-
Publish-Module -Name Contoso -Repository PSGallery -Verbose
80-
```
60+
The result should look similar to the following output:
8161

82-
Answer the prompt with `Y` to install both the NuGet provider and `nuget.exe`.
62+
```Output
63+
Path
64+
----
65+
C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.5\PowerShellGet.psd1
66+
C:\Program Files\WindowsPowerShell\Modules\PackageManagement\1.4.8.1\PackageManagement.psd1
67+
```
8368

84-
```Output
85-
NuGet.exe and NuGet provider are required to continue
86-
PowerShellGet requires NuGet.exe and NuGet provider version '2.8.5.201' or newer to inter
87-
act with the NuGet-based repositories. Do you want PowerShellGet to install both NuGet.ex
88-
e and NuGet provider now?
89-
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
90-
VERBOSE: Installing NuGet provider.
91-
VERBOSE: Installing NuGet.exe.
92-
VERBOSE: Successfully published module 'Contoso' to the module publish location 'https://
93-
www.powershellgallery.com/api/v2/'.
94-
Please allow few minutes for 'Contoso' to show up in the search results.
95-
```
69+
Copy the entire module folders to the same location on the isolated machine. For example, if the
70+
modules are located in `PowerShellGet\2.2.5` and `PackageManagement\1.4.8.1` folders to the
71+
`$env:PROGRAMFILES\WindowsPowerShell\Modules` folder on the target machine.
9672

97-
## Bootstrap on a machine not connected to the internet
73+
1. Copy `nuget.exe` to the isolated machine. PowerShellGet installs `nuget.exe` in the following
74+
location: `$env:LOCALAPPDATA\Microsoft\Windows\PowerShell\PowerShellGet\nuget.exe`
9875

99-
The following processes assume the machine isn't connected to the internet. To install the necessary
100-
components, follow the bootstrap process on an internet-connected machine then manually copy the
101-
provider to the isolated node through an offline trusted process.
76+
If that file isn't present at that location it's either installed somewhere else or PowerShellGet
77+
found the .NET CLI (`dotnet.exe`). You can download the latest version of `nuget.exe` from
78+
[https://aka.ms/psget-nugetexe][01].
10279

103-
1. Copy the NuGet provider files to the offline machine.
80+
Copy `nuget.exe` to `$env:LOCALAPPDATA\Microsoft\Windows\PowerShell\PowerShellGet\nuget.exe` on
81+
the target computer.
10482

105-
Copy the `C:\Program Files\PackageManagement\ProviderAssemblies\NuGet` folder from the connected
106-
machine to the same location on the offline machine.
83+
## Unblock the copied files
10784

108-
1. Copy the PowerShellGet and PackageManagement modules to the offline machine.
85+
When you copy files from another computer, Windows may block the files. To unblock the copied files,
86+
run the following commands on the target machine:
10987

110-
Copy the following module folders from the connected machine to same location on the offline
111-
machine.
88+
```powershell
89+
$getChildItemSplat = @{
90+
Path = @(
91+
"$env:PROGRAMFILES\WindowsPowerShell\Modules\PowerShellGet"
92+
"$env:PROGRAMFILES\WindowsPowerShell\Modules\PackageManagement"
93+
"$env:LOCALAPPDATA\Microsoft\Windows\PowerShell\PowerShellGet\nuget.exe"
94+
)
95+
Recurse = $true
96+
}
97+
Get-ChildItem @getChildItemSplat | Unblock-File
98+
```
11299

113-
- `C:\Program Files\WindowsPowerShell\Modules\PowerShellGet`
114-
- `C:\Program Files\WindowsPowerShell\Modules\PackageManagement`
100+
<!-- link references -->
101+
[01]: https://aka.ms/psget-nugetexe
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: The PowerShellGet module provides commands to interact with the PowerShell Gallery, the central repository for PowerShell modules, scripts, and DSC resources.
3-
ms.date: 11/16/2022
3+
ms.date: 01/26/2026
44
ms.topic: overview
55
title: PowerShellGet and the PowerShell Gallery
66
---
@@ -11,20 +11,19 @@ PowerShell scripts, modules containing PowerShell cmdlets and Desired State Conf
1111
resources. Some of these packages are authored by Microsoft, and others are authored by the
1212
PowerShell community.
1313

14-
The [PowerShellGet][07] module contains cmdlets for discovering, installing, updating, and
14+
The [PowerShellGet][02] module contains cmdlets for discovering, installing, updating, and
1515
publishing PowerShell packages from the PowerShell Gallery. These packages can contain artifacts
1616
such as Modules, DSC Resources, Role Capabilities, and Scripts. Make sure you have the latest
1717
version of **PowerShellGet** and **PackageManagement** installed.
1818

19-
The [Microsoft.PowerShell.PSResourceGet][08] module replaces the **PowerShellGet** and
19+
The [Microsoft.PowerShell.PSResourceGet][01] module replaces the **PowerShellGet** and
2020
**PackageManagement** modules. **Microsoft.PowerShell.PSResourceGet** version 1.0.1 ships in
2121
PowerShell 7.4.0. The latest version is available in the PowerShell Gallery and can be installed on
2222
any supported version of PowerShell.
2323

2424
For more information see:
2525

26-
- [Install PowerShellGet][01]
27-
- [Update PowerShellGet for Windows PowerShell][02]
26+
- [Install a package manager for PowerShell][07]
2827

2928
## Getting Started with the PowerShell Gallery
3029

@@ -38,12 +37,10 @@ Provide feedback and report issues in the [GitHub repository][04]. To see the cu
3837
PowerShell Gallery services, see the [PowerShell Gallery Status][05] page on GitHub.
3938

4039
<!-- link references -->
41-
[01]: powershellget/install-powershellget.md
42-
[02]: powershellget/update-powershell-51.md
40+
[01]: /powershell/module/microsoft.powershell.psresourceget
41+
[02]: /powershell/module/powershellget
4342
[03]: getting-started.md
4443
[04]: https://aka.ms/psgallery-issues
4544
[05]: https://aka.ms/psgallery-status
4645
[06]: https://www.powershellgallery.com
47-
[07]: /powershell/module/powershellget
48-
[08]: /powershell/module/microsoft.powershell.psresourceget
49-
46+
[07]: powershellget/install-powershellget.md
Lines changed: 74 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
---
22
description: This article explains how install PowerShellGet.
3-
ms.date: 01/31/2024
3+
ms.date: 01/26/2026
44
ms.topic: install-set-up-deploy
5-
title: How to Install PowerShellGet
5+
title: Install a package manager for PowerShell
66
---
7-
# How to Install PowerShellGet and PSResourceGet
7+
# Install a package manager for PowerShell
88

9-
## Prerequisites
9+
If you are running PowerShell 6.0 or later, you already have a newer version of **PowerShellGet**
10+
and **PackageManagement** installed. You should ensure you are running the latest versions of those
11+
modules.
1012

11-
Ensure that you have a version of **PowerShellGet** and **PackageManagement** newer than 1.0.0.1
12-
installed. The latest stable versions are 2.2.5 for **PowerShellGet** and 1.4.8.1 for
13-
**PackageManagement**.
13+
If you are running PowerShell 7.4 or later, you also have **Microsoft.PowerShell.PSResourceGet**
14+
installed. **Microsoft.PowerShell.PSResourceGet** is the new package management solution for
15+
PowerShell. With this module, you no longer need to use **PowerShellGet** and **PackageManagement**.
16+
It's installed side-by-side with the existing **PowerShellGet** and **PackageManagement** modules.
1417

15-
If you're running Windows PowerShell 5.1 with **PowerShellGet** 1.0.0.1, see
16-
[Update PowerShellGet for Windows PowerShell 5.1](update-powershell-51.md).
18+
Windows PowerShell ships with version 1.0.0.1 of **PowerShellGet** and **PackageManagement**. If
19+
you're running Windows PowerShell 5.1, you must upgrade to the latest version of PowerShellGet and
20+
PackageManagement. All versions of PowerShellGet v1.x are no longer supported.
21+
22+
Use the following instructions to install or update to the latest versions of these modules.
23+
24+
## Step 1: Enable TLS 1.2
1725

1826
To access the PowerShell Gallery, you must use Transport Layer Security (TLS) 1.2 or higher. Use the
1927
following command to enable TLS 1.2 in your PowerShell session.
@@ -27,17 +35,16 @@ following command to enable TLS 1.2 in your PowerShell session.
2735
Add this command to your PowerShell profile script to ensure TLS 1.2 is configured for every
2836
PowerShell session. For more information about profiles, see [about_Profiles][01].
2937

30-
If you're running PowerShell 6.0 or later, you already have a newer version of **PowerShellGet** and
31-
**PackageManagement** installed. You can upgrade to a newer version if necessary or install the
32-
preview release. You should always install the latest stable release.
38+
## Step 2: Check the installed versions
3339

34-
Use the following command to see what version is installed.
40+
To check the currently installed versions of the modules, run the following command:
3541

3642
```powershell
37-
Get-Module PowerShellGet, PackageManagement -ListAvailable
43+
$Names = @('PowerShellGet', 'PackageManagement', 'Microsoft.PowerShell.PSResourceGet')
44+
Get-Module -Name $Names -ListAvailable
3845
```
3946

40-
The following output shows that the latest stable version needs to be installed.
47+
In Windows PowerShell 5.1 on a newly installed Windows system, you should get the following output:
4148

4249
```Output
4350
Directory: C:\Program Files\WindowsPowerShell\Modules
@@ -49,27 +56,69 @@ Binary 1.0.0.1 PackageManagement {Find-Package, Get-Package, ...
4956
Script 1.0.0.1 PowerShellGet {Install-Module, Find-Module, ...
5057
```
5158

52-
## Install the latest stable release
59+
If you the version of **PowerShellGet** is newer than `1.0.0.1` then you can
60+
[check for updates][02] and [install the latest release][03].
5361

54-
To install the latest versions of these modules run the following:
62+
If you are still running version `1.0.0.1`, you must follow the steps let **PowerShellGet** install
63+
an updated NuGet provider and the `nuget.exe` command-line tool. Continue to the next step.
64+
65+
## Step 3: Check for updates
66+
67+
To check for the latest versions of the modules available from the PowerShell Gallery, run the
68+
following command:
5569

5670
```powershell
57-
Install-Module PowerShellGet -Force -AllowClobber
71+
$Names = @('PowerShellGet', 'PackageManagement', 'Microsoft.PowerShell.PSResourceGet')
72+
Find-Module -Name $Names -Repository PSGallery
73+
```
74+
75+
You should get a result similar to the following output:
76+
77+
```Output
78+
Version Name Repository Description
79+
------- ---- ---------- -----------
80+
1.4.8.1 PackageManagement PSGallery PackageManagement (a.k.a. OneGet) is a n…
81+
2.2.5 PowerShellGet PSGallery PowerShell module with commands for disc…
82+
1.1.1 Microsoft.PowerShell.PSResourceGet PSGallery PowerShell module with commands for disc…
83+
```
84+
85+
## Step 4: Update NuGet components (if required)
86+
87+
An updated NuGet provider is required by **PowerShellGet** commands to work with the PowerShell
88+
Gallery. The `Publish-*` commands use `nuget.exe` or `dotnet.exe` to publish resources. If neither
89+
tool is available, PowerShellGet installs `nuget.exe`. If you are still running version `1.0.0.1` of
90+
**PowerShellGet**, `Find-Module` prompts you to install the NuGet provider. Enter <kbd>Y</kbd> to
91+
install the provider.
92+
93+
```Output
94+
NuGet provider is required to continue
95+
PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet
96+
-based repositories. The NuGet provider must be available in 'C:\Program Files\PackageMan
97+
agement\ProviderAssemblies' or 'C:\Users\user1\AppData\Local\PackageManagement\ProviderAs
98+
semblies'. You can also install the NuGet provider by running 'Install-PackageProvider -N
99+
ame NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install and imp
100+
ort the NuGet provider now?
101+
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
102+
VERBOSE: Installing NuGet provider.
58103
```
59104

60-
## Install Microsoft.PowerShell.PSResourceGet
105+
When you answer <kbd>Y</kbd>, PowerShellGet installs the NuGet provider and the `nuget.exe`
106+
command-line tool (if necessary).
61107

62-
**Microsoft.PowerShell.PSResourceGet** is the new package management solution for PowerShell. With
63-
this module, you no longer need to use **PowerShellGet** and **PackageManagement**. However, it can
64-
be installed side-by-side with the existing **PowerShellGet** module. To install
65-
**Microsoft.PowerShell.PSResourceGet** side-by-side with your existing **PowerShellGet** version,
66-
open any PowerShell console and run:
108+
## Step 5: Install the latest release
109+
110+
To install the latest versions of these modules run the following:
67111

68112
```powershell
113+
Install-Module PowerShellGet -Repository PSGallery -Force -AllowClobber
69114
Install-Module Microsoft.PowerShell.PSResourceGet -Repository PSGallery
70115
```
71116

72-
**Microsoft.PowerShell.PSResourceGet** is preinstalled with PowerShell 7.4 and later.
117+
> [!NOTE]
118+
> When you install **PowerShellGet**, it automatically installs the latest version of
119+
> **PackageManagement**.
73120
74121
<!-- link references -->
75122
[01]: /powershell/module/microsoft.powershell.core/about/about_profiles
123+
[02]: #step-3-check-for-updates
124+
[03]: #step-5-install-the-latest-release

0 commit comments

Comments
 (0)