PowerShell Genie

Microsoft.PowerShell.PSResourceGet module: setup and commands

Module 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn

Discover and install modules with Find-PSResource and Install-PSResource, checking repository trust, version constraints and command-name changes.

Getting it

Ships with PowerShell 7.4 and later. On earlier versions, Install-Module -Name Microsoft.PowerShell.PSResourceGet puts it alongside the older PowerShellGet.

Examples

1PS> Find-PSResource -Name Pester
Show reference output
1 Name Version Repository Description
2 ---- ------- ---------- -----------
3 Pester 5.7.1 PSGallery PowerShell testing framework
1PS> Get-PSResourceRepository
Show reference output
1 Name Version Repository Description
2 ---- ------- ---------- -----------
3 Pester 5.7.1 PSGallery PowerShell testing framework

What it is for

Use it to find, install, update, and remove modules and scripts, and to register an internal repository. Publish-PSResource is the path for pushing a module to a private feed from a release pipeline.

Typical tasks

  • Search the gallery by name or tag
  • Install a specific version into a chosen scope
  • Update installed modules to the current release
  • Register a private NuGet feed as a repository
  • Publish a module from a build pipeline
  • Save a module to disk without installing it

Check the installed version

1PS> Get-Module -ListAvailable Microsoft.PowerShell.PSResourceGet | Select-Object Name, Version, Path
2PS> Get-Command -Module Microsoft.PowerShell.PSResourceGet

Compare the module path and version with the session used by your scheduled task or automation account. Use it to find, install, update, and remove modules and scripts, and to register an internal repository. Publish-PSResource is the path for pushing a module to a private feed from a release pipeline.

Primary documentation

Microsoft.PowerShell.PSResourceGet documentation

Continue
Genie guideMicrosoft.PowerShell.PSResourceGet module: setup and commands

Discover and install modules with Find-PSResource and Install-PSResource, checking repository trust, version constraints and command-name changes.