PowerShellGet

PowerShellGet 是一个模块,其中包含用于发现、安装、更新和发布 PowerShell 项目(如模块、DSC 资源、角色功能和脚本)的命令。

此站点上的 cmdlet 参考文档记录了模块的最新版本。

重要

截至 2020 年 4 月,PowerShell 库不再支持传输层安全性(TLS)版本 1.0 和 1.1。 如果未使用 TLS 1.2 或更高版本,则尝试访问 PowerShell 库时会收到错误。 使用以下命令确保使用的是 TLS 1.2:

[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12

有关详细信息,请参阅 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

更新脚本的信息。