Get-InstalledModule

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

语法

Default (默认值)

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
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-AllVersions

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

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-MaximumVersion

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

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-MinimumVersion

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

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-Name

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

参数属性

类型:

String[]

默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:0
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-RequiredVersion

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

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters

输入

String

String

输出

PSCustomObject