Bagikan melalui


Get-InstalledPSResource

Returns modules and scripts installed on the machine via PowerShellGet.

Sintaks

Default (Default)

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

Deskripsi

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.

Contoh

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.

Parameter

-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.

Properti parameter

Jenis:

String[]

Nilai default:None
Mendukung wildcard:True
DontShow:False

Set parameter

(All)
Position:0
Wajib:False
Nilai dari alur:True
Nilai dari alur berdasarkan nama properti:False
Nilai dari argumen yang tersisa:False

-Path

Specifies the path to search in.

Properti parameter

Jenis:String
Nilai default:None
Mendukung wildcard:False
DontShow:False

Set parameter

(All)
Position:Named
Wajib:False
Nilai dari alur:False
Nilai dari alur berdasarkan nama properti:False
Nilai dari argumen yang tersisa:False

-Scope

Specifies the scope of the resource.

Properti parameter

Jenis:Microsoft.PowerShell.PSResourceGet.UtilClasses.ScopeType
Nilai default:None
Nilai yang diterima:CurrentUser, AllUsers
Mendukung wildcard:False
DontShow:False

Set parameter

(All)
Position:Named
Wajib:False
Nilai dari alur:False
Nilai dari alur berdasarkan nama properti:False
Nilai dari argumen yang tersisa: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.

Properti parameter

Jenis:String
Nilai default:None
Mendukung wildcard:True
DontShow:False

Set parameter

(All)
Position:Named
Wajib:False
Nilai dari alur:False
Nilai dari alur berdasarkan nama properti:False
Nilai dari argumen yang tersisa:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Input

String

Output

Microsoft.PowerShell.PSResourceGet.UtilClasses.PSResourceInfo

Catatan

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