PowerShellGet and PackageManagement in PowerShell Gallery and GitHub
As of today, PowerShellGet is an open source project, and both the PowerShellGet and PackageManagement modules are available in the PowerShell Gallery.
Moving PowerShellGet to Open Source
PowerShellGet is now a repo under github.com/PowerShell. Of course, the PackageManagement module is already open-sourced as it is part of the OneGet project. Check out the new PowerShellGet repo at github.com/PowerShell/PowerShellGet.
You will find information about how to contribute to PowerShellGet in the readme.md file that is in the root of the repo. This project currently follows the model used by OneGet for handling issues and pull requests, although we expect to align more closely with the processes in PowerShell Core over time. Future development of this module will be happening in the repo, and we will be working off issues filed by you and by our team for the majority of changes. For larger changes, we will use the RFC process in PowerShell Core. As with all things new, we are learning the RFC process together so it is a bit time consuming, and we hope everyone will be as patient with it as they have been elsewhere.
PowerShellGet and PackageManagement in the PowerShell Gallery
In the future, PowerShellGet and PackageManagement will be released via the PowerShell Gallery as changes become available. There will continue to be a version of these in Windows Client and Windows Server, however those versions will be updated on the Windows release cycle, which is expected to happen less frequently than updates for the PowerShell Gallery.
The way to install the PackageManagement and PowerShellGet modules from the PowerShell Gallery is — use PowerShellGet. These modules are available for installation on any system with PowerShellGet installed.
Some things that you will see below are worth explaining. PowerShellGet has a dependency on PackageManagement, so you only need one command (install-module PowerShellGet…) to install both modules. Also, after some steps you need to exit and restart PowerShell, because it used Nuget, PackageManagement, and PowerShellGet during the install so restarting is required to switch to the latest version.
Before updating PowerShellGet or PackageManagement, you should always install the latest Nuget provider . To do that, run the following in an elevated PowerShell prompt:
- Install-PackageProvider Nuget –force –verbose
For systems with PowerShell 5.0 (or greater) you can install both PowerShellGet and PackageManagement together. To do this on Windows 10, Windows Server 2016, or any system with WMF 5.0 or 5.1 installed, run the following commands from an elevated PowerShell prompt:
- Install-Module –Name PowerShellGet –Force –Verbose
For Nano Server, and systems running PowerShell 3 or PowerShell 4, that have installed the PackageManagement MSI, open a new PS Console and use the below PowerShellGet cmdlet to save the modules to a local directory:
- Save-Module PowerShellGet -Path C:\LocalFolder
- Re-Open the PS Console then run the following commands:
- Copy-Item “C:\LocalFolder\PowerShellGet\*” “$env:ProgramFiles\WindowsPowerShell\Modules\PowerShellGet\” -Recurse -Force
- Copy-Item “C:\LocalFolder\PackageManagement\*” “$env:ProgramFiles\WindowsPowerShell\Modules\PackageManagement\” -Recurse -Force
This version of PowerShellGet includes new security enhancements that validate a module author using catalog signing. Once you install this version, the first time you install either PSReadline or Pester from the Gallery you may receive an error that starts with: “The version ‘(some version)’ of the module ‘(ModuleName)’ being installed is not catalog signed. …” This is a one-time impact for these two modules. You can bypass this error for these modules by specifying –SkipPublisherCheck. That is not a general best practice, we will be providing additional details in the coming days.