Get-InstalledModule

取得 PowerShellGet 所安裝電腦上的模組清單。

Syntax

Get-InstalledModule
   [[-Name] <String[]>]
   [-MinimumVersion <String>]
   [-RequiredVersion <String>]
   [-MaximumVersion <String>]
   [-AllVersions]
   [-AllowPrerelease]
   [<CommonParameters>]

Description

Cmdlet Get-InstalledModule 會取得使用 PowerShellGet 安裝在電腦上的 PowerShell 模組。 若要查看系統上已安裝的所有模組,請使用 Get-Module -ListAvailable 命令。

這是Microsoft.PowerShell.PSResourceGet中 Cmdlet 的 Proxy Cmdlet Get-InstalledPSResource 。 如需詳細資訊,請參閱 Get-InstalledPSResource

範例

範例 1:取得所有已安裝的模組

Get-InstalledModule

Version    Name                                Type       Repository     Description
-------    ----                                ----       ----------     -----------
2.0.0      PSGTEST-UploadMultipleVersionOfP... Module     GalleryINT     Module for DAC functionality
1.3.5      AzureAutomationDebug                Module     PSGallery      Module for debugging Azure Automation runbooks, emulating AA native cmdlets
1.0.1      AzureRM.Automation                  Module     PSGallery      Microsoft Azure PowerShell - Automation service cmdlets for Azure Resource Manager

此命令會取得所有已安裝的模組。

範例 2:取得模組的特定版本

Get-InstalledModule -Name "AzureRM.Automation" -MinimumVersion 1.0 -MaximumVersion 2.0

Version    Name                                Type       Repository     Description
-------    ----                                ----       ----------     -----------
1.0.1      AzureRM.Automation                  Module     PSGallery      Microsoft Azure PowerShell - Automation service cmdlets for Azure Resource Manager

此命令會從 1.0 版到 2.0 版取得 AzureRM.Automation 模組的版本。

參數

-AllowPrerelease

包含在標示為發行前版本的結果模組中。

Proxy Cmdlet 會將此參數對應至 的 Get-InstalledPSResource發行前版本參數。

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

-AllVersions

Proxy Cmdlet 會先將此參數 -Version * 轉換成 ,然後再呼叫 Get-InstalledPSResource

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

-MaximumVersion

Proxy Cmdlet 會使用此參數的值來建立 NuGet 版本搜尋字串,以搭配 的 Get-InstalledPSResourceVersion參數使用。

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

-MinimumVersion

Proxy Cmdlet 會使用此參數的值來建立 NuGet 版本搜尋字串,以搭配 的 Get-InstalledPSResourceVersion參數使用。

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

-Name

指定要取得之模組名稱的陣列。

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

-RequiredVersion

Proxy Cmdlet 會使用此參數的值來建立 NuGet 版本搜尋字串,以搭配 的 Get-InstalledPSResourceVersion參數使用。

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

輸入

String[]

String

輸出

PSCustomObject