Get-InstalledModule

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

语法

Get-InstalledModule
   [[-Name] <String[]>]
   [-MinimumVersion <Version>]
   [-RequiredVersion <Version>]
   [-MaximumVersion <Version>]
   [<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 模块的版本。

参数

-MaximumVersion

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

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

-MinimumVersion

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

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

-Name

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

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

-RequiredVersion

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

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

输出

Microsoft.PowerShell.Commands.PSRepositoryItemInfo