Working with PowerShell Gallery
The PowerShell Gallery is a serivce that enables you to upload PowerShell modules and scripts to a centralized repository! Interaction with the Gallery can be done via the web interface and the PowerShellGet module for PowerShell. You can install modules from the Gallery, publish your own modules, and even install/publish your own one-off PowerShell scripts! Using this new PowerShellGet module, you can even set up your own internal, private repository to hold PowerShell scripts and modules.
During this course, we'll talk about the PowerShell Gallery, which is new starting with PowerShell version 5.0. If you're running Windows 10, then you've already got PowerShell 5.0 installed, however you can install PowerShell 5.0 on down-level operating systems such as Windows 7, Windows 8.1, and Windows Server 2012, by deploying the Windows Management Framework (WMF) 5.0 package from Microsoft. If you're not sure which version of PowerShell you're running, use the $PSVersionTable automatic variable, and inspect the PSVersion key.
The Install-Module command is used to install modules from the PowerShell Gallery. You can query the local system for modules that were installed from the PowerShell Gallery, using the Get-InstalledModule command. The Uninstall-Module command is used to remove PowerShell modules that were installed from the PowerShell Gallery. If you already wrote your own PowerShell module, and upload it to the PowerShell Gallery, you can use the Publish-Module command!
What You'll Learn
- Brief introduction to the PowerShell Gallery
- Installing and uninstalling PowerShell modules from the PowerShell Gallery
- Publishing your own PowerShell modules to the PowerShell Gallery
- Managing PowerShell script files in the PowerShell Gallery