Get-InstalledPSResource

Returns modules and scripts installed on the machine via PowerShellGet.

Syntax

Get-InstalledPSResource
   [[-Name] <String[]>]
   [-Version <String>]
   [-Path <String>]
   [-Scope <ScopeType>]
   [<CommonParameters>]

Description

This cmdlet searches the module and script installation paths and returns PSResourceInfo objects that describes each resource item found. This is equivalent to the combined output of the Get-InstalledModule and Get-InstalledScript cmdlets from PowerShellGet v2.

Examples

Example 1

This example return all versions of modules and scripts installed on the machine.

Get-InstalledPSResource

Example 2

This example returns all versions of the Az module installed using PowerShellGet.

Get-InstalledPSResource Az

Example 3

This example return all versions of the Az module installed in the current directory.

Get-InstalledPSResource Az -Path .

Example 4

This example returns a specific version of the Az module if it's installed on the system.

Get-InstalledPSResource Az -Version 9.4.0

Example 5

This example return all installed versions of the Az module within the specified version range.

Get-InstalledPSResource Az -Version "(1.0.0, 3.0.0)"

Example 6

This example returns a specific preview version of the PowerShellGet module if it's installed on the system.

Get-InstalledPSResource PowerShellGet -Version 3.0.19-beta19

Name          Version Prerelease Repository Description
----          ------- ---------- ---------- -----------
PowerShellGet 3.0.19  beta19     PSGallery  PowerShell module with commands for discovering, installing, updating and p…

Example 6

The previous example showed that PowerShellGet version 3.0.14-beta14 was installed on the system. This example shows that you must provide the full version, including the Prerelease label to identify the installed module by Version.

Get-InstalledPSResource PowerShellGet -Version 3.0.19

There is no output from this command.

Example 7

In this example you see that there are four version of PSReadLine installed on the system. The second command searches for a range of version between 2.2.0 and 2.3.0.

Get-InstalledPSResource PSReadLine

Name       Version Prerelease Repository Description
----       ------- ---------- ---------- -----------
PSReadLine 2.3.0   beta0      PSGallery  Great command line editing in the PowerShell console host
PSReadLine 2.2.6              PSGallery  Great command line editing in the PowerShell console host
PSReadLine 2.2.5              PSGallery  Great command line editing in the PowerShell console host
PSReadLine 2.2.2              PSGallery  Great command line editing in the PowerShell console host
PSReadLine 2.2.0   beta4      PSGallery  Great command line editing in the PowerShell console host

Get-InstalledPSResource PSReadLine -Version '[2.2.0, 2.3.0]'

Name       Version Prerelease Repository Description
----       ------- ---------- ---------- -----------
PSReadLine 2.3.0   beta0      PSGallery  Great command line editing in the PowerShell console host
PSReadLine 2.2.6              PSGallery  Great command line editing in the PowerShell console host
PSReadLine 2.2.5              PSGallery  Great command line editing in the PowerShell console host
PSReadLine 2.2.2              PSGallery  Great command line editing in the PowerShell console host

According to NuGet version rules a prerelease version is less than a stable version, so 2.2.0-beta4 is less than the 2.2.0 version in the specified version range.

Parameters

-Name

Name of a resource to find. Wildcards are supported but NuGet only accepts the * character. NuGet doesn't support wildcard searches of local (file-based) repositories.

Type:String[]
Position:0
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:True

-Path

Specifies the path to search in.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Scope

Specifies the scope of the resource.

Type:Microsoft.PowerShell.PSResourceGet.UtilClasses.ScopeType
Accepted values:CurrentUser, AllUsers
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Version

Specifies the version of the resource to be returned. The value can be an exact version or a version range using the NuGet versioning syntax.

For more information about NuGet version ranges, see Package versioning.

PowerShellGet supports all but the minimum inclusive version listed in the NuGet version range documentation. Using 1.0.0.0 as the version doesn't yield versions 1.0.0.0 and higher (minimum inclusive range). Instead, the value is considered to be the required version. To search for a minimum inclusive range, use [1.0.0.0, ] as the version range.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:True

Inputs

String[]

Outputs

Microsoft.PowerShell.PSResourceGet.UtilClasses.PSResourceInfo

Notes

The module defines Get-PSResource as an alias for Get-InstalledPSResource.