Get-InstalledModule

获取 PowerShellGet 安装的计算机上的模块列表。

语法

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

说明

Get-InstalledModule cmdlet 获取使用 PowerShellGet 在计算机上安装的 PowerShell 模块。 若要查看系统上安装的所有模块,请使用 Get-Module -ListAvailable 命令。

示例

示例 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

包括在标记为预发行版的结果模块中。

类型:SwitchParameter
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-AllVersions

指示要获取模块的所有可用版本。 不能将 AllVersions 参数与 MinimumVersionMaximumVersionRequiredVersion 参数一起使用。

类型:SwitchParameter
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-MaximumVersion

指定要获取的模块的最大版本或最新版本。 MaximumVersionRequiredVersion 参数互斥;不能在同一命令中使用这两个参数。

类型:String
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-MinimumVersion

指定要获取的单个模块的最低版本。 MinimumVersionRequiredVersion 参数互斥;不能在同一命令中使用这两个参数。

类型:String
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-Name

指定要获取的模块名称数组。

类型:String[]
Position:0
默认值:None
必需:False
接受管道输入:True
接受通配符:False

-RequiredVersion

指定要获取的模块的确切版本。

类型:String
Position:Named
默认值:None
必需:False
接受管道输入:True
接受通配符:False

输入

String[]

String

输出

PSCustomObject