Get-InstalledModule
获取 PowerShellGet 安装的计算机上的模块列表。
语法
Get-InstalledModule
[[-Name] <String[]>]
[-MinimumVersion <String>]
[-RequiredVersion <String>]
[-MaximumVersion <String>]
[-AllVersions]
[-AllowPrerelease]
[<CommonParameters>]
说明
该 Get-InstalledModule
cmdlet 获取使用 PowerShellGet 在计算机上安装的 PowerShell 模块。 若要查看系统上安装的所有模块,请使用 Get-Module -ListAvailable
命令。
这是 Microsoft.PowerShell.PSResourceGet 中 cmdlet 的代理 cmdletGet-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
包括在标记为预发行版的结果模块中。
代理 cmdlet 将此参数映射到 预发行版 参数 Get-InstalledPSResource
。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-AllVersions
代理 cmdlet 在调用Get-InstalledPSResource
之前将此参数-Version *
转换为此参数。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-MaximumVersion
代理 cmdlet 使用此参数的值来创建 NuGet 版本搜索字符串,以便与 Version 参数 Get-InstalledPSResource
一起使用。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-MinimumVersion
代理 cmdlet 使用此参数的值来创建 NuGet 版本搜索字符串,以便与 Version 参数 Get-InstalledPSResource
一起使用。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-Name
指定要获取的模块名称数组。
类型: | String[] |
Position: | 0 |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-RequiredVersion
代理 cmdlet 使用此参数的值来创建 NuGet 版本搜索字符串,以便与 Version 参数 Get-InstalledPSResource
一起使用。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
输入
String[]