PowerShellGet
本文档介绍 PowerShellGet 模块版本 3.0.22-beta22。 提供此模块是为了与 PowerShellGet v2.2.x 兼容。 此版本的模块中的 cmdlet 是调用 Microsoft.PowerShell.PSResourceGet 模块中等效 cmdlet 的代理 cmdlet。
代理 cmdlet 为使用版本 2.x cmdlet 的脚本提供兼容性层。 在大多数情况下,脚本将继续工作,而无需修改。 但是,模块之间的行为存在一些差异。 Microsoft.PowerShell.PSResourceGet cmdlet 不支持 PowerShellGet cmdlet 的某些参数。 代理 cmdlet 以无提示方式放弃不受支持的参数,转换某些参数,并将其他参数传递到 Microsoft.PowerShell.PSResourceGet 模块中的等效 cmdlet。
有关 Microsoft.PowerShell.PSResourceGet 模块的详细信息,请参阅 about_PSResourceGet。
重要
Windows PowerShell 5.1 预安装了 PowerShell Get 版本 1.0.0.1。 此版本的 PowerShellGet 具有有限的功能,不支持 PowerShell 库的更新功能。 若要受支持,必须更新到最新版本。
PowerShellGet
Find-Command |
在模块中查找 PowerShell 命令。 |
Find-DscResource |
查找 Desired State Configuration (DSC) 资源。 |
Find-Module |
查找与指定条件匹配的存储库中的模块。 |
Find-RoleCapability |
在模块中查找角色功能。 |
Find-Script |
查找脚本。 |
Get-InstalledModule |
获取 PowerShellGet 安装的计算机上的模块列表。 |
Get-InstalledScript |
获取已安装的脚本。 |
Get-PSRepository |
获取 PowerShell 存储库。 |
Install-Module |
从存储库下载一个或多个模块,并将其安装在本地计算机上。 |
Install-Script |
安装脚本。 |
New-ScriptFileInfo |
创建包含元数据的脚本文件。 |
Publish-Module |
将指定模块从本地计算机发布到联机库。 |
Publish-Script |
发布脚本。 |
Register-PSRepository |
注册 PowerShell 存储库。 |
Save-Module |
将模块及其依赖项保存在本地计算机上,但不安装该模块。 |
Save-Script |
保存脚本。 |
Set-PSRepository |
设置已注册存储库的值。 |
Test-ScriptFileInfo |
验证脚本的注释块。 |
Uninstall-Module |
卸载模块。 |
Uninstall-Script |
卸载脚本。 |
Unregister-PSRepository |
取消注册存储库。 |
Update-Module |
将最新版本的指定模块从联机库下载并安装到本地计算机。 |
Update-ModuleManifest |
更新模块清单文件。 |
Update-Script |
更新脚本。 |
Update-ScriptFileInfo |
更新脚本的信息。 |