Windows 管理中心构建为可扩展平台,每种连接类型和工具均为可单独安装、卸载和更新的扩展。 可以搜索由 Microsoft 和其他开发者发布的新扩展,单独安装和更新它们,不需更新整个 Windows Admin Center 安装。 也可配置单独的 NuGet 源或文件共享,然后分发在组织内部使用的扩展。
安装扩展
Windows 管理中心显示指定 NuGet 源中可用的扩展。 默认情况下,Windows Admin Center 指向 Microsoft 官方 NuGet 源,其中托管由 Microsoft 和其他开发者发布的扩展。
- Select the Settings button in the top-right > In the left pane, select Extensions.
- The Available Extensions tab lists the extensions on the feed that are available for installation.
- Select on an extension to view the extension description, version, publisher and other information in the Details pane.
- Select Install to install an extension. 如果网关必须以提升权限运行以进行此更改,则会显示用户帐户控制 (UAC) 提升提示。 安装完成后,浏览器会自动刷新,Windows 管理中心会重新加载并安装新扩展。 如果你尝试安装的扩展是之前已安装扩展的更新,可以选择“更新到最新”按钮安装更新。 You can also go to the Installed Extensions tab to view installed extensions and see if an update is available in the Status column.
从另一源安装扩展
Windows Admin Center 支持多个源,你可以一次从多个源查看和管理包。 可以将任何支持 NuGet V2 API 或文件共享的 NuGet 源添加到 Windows Admin Center,方便从其安装扩展。
- Select the Settings button in the top-right > In the left pane, select Extensions.
- On the right pane, select the Feeds tab.
- Select the Add button to add another feed. 对于 NuGet 源,请输入 NuGet V2 源 URL。 NuGet 源提供者或管理员应该能够提供 URL 信息。 对于文件共享,请输入在其中存储扩展包文件 (.nupkg) 的文件共享的完整路径。 添加文件共享作为源时,必须满足以下条件:
- 文件访问权限授予 NTAuthority\Network Service。
- 文件路径不能包含 C:\Users 文件夹。
- 文件共享上的包必须已签名,除非操作模式设置为“开发”。
- Select Add. 如果网关必须以提升权限运行以进行此更改,则会显示 UAC 提升提示。 仅当在桌面模式下运行 Windows Admin Center 时才会显示此提示。
The Available Extensions list shows extensions from all registered feeds. You can check which feed each extension is from using the Package Feed column.
卸载扩展
你可以卸载之前安装的任何扩展,甚至卸载 Windows 管理中心安装时预装的任何工具。
- Select the Settings button in the top-right > In the left pane, select Extensions.
- Select the Installed Extensions tab to view all installed extensions.
- Choose an extension to uninstall, then select Uninstall.
卸载完成后,浏览器会自动刷新,Windows 管理中心会重新加载并移除扩展。 If you uninstalled a tool that was preinstalled as part of Windows Admin Center, the tool is available for reinstallation in the Available Extensions tab.
在未连接 Internet 的情况下在计算机上安装扩展
如果 Windows Admin Center 安装在未连接到 Internet 的计算机上或位于代理后面的计算机上,则可能无法访问和安装 Windows Admin Center 源中的扩展。 可以通过手动方式或 PowerShell 脚本方式下载扩展包,并将 Windows Admin Center 配置为从文件共享或本地驱动器检索包。
手动下载扩展包
On another computer that has internet connectivity, open a web browser and navigate to the following URL: https://dev.azure.com/WindowsAdminCenter/Windows%20Admin%20Center%20Feed/_packaging?_a=feed&feed=WAC
- 你可能需要创建 Microsoft 帐户并登录以查看扩展包。
选择要安装的包名称以查看包详细信息页。
Select on the Download link in the top navigation bar of the package details page and download the .nupkg file for the extension.
对所有需要下载的包重复步骤 2 和 3。
将包文件复制到可以从安装了 Windows Admin Center 的计算机访问的某个文件共享,或者复制到安装了 Windows Admin Center 的计算机上的本地磁盘。
通过 PowerShell 脚本下载包
可以使用 Internet 上提供的许多脚本从 NuGet 源下载 NuGet 包。 我们将使用 Microsoft 高级项目经理 Jon Galloway 提供的脚本。
- As described in the blog post, install the script as a NuGet package, or copy and paste the script into the PowerShell ISE.
- 将脚本的第一行编辑成你的 NuGet 源的 v2 URL。 如果从 Windows 管理中心官方源下载包,请使用以下 URL:
$feedUrlBase = "https://aka.ms/sme-extension-feed"
- 运行脚本,它会将所有 NuGet 包从源下载到以下本地文件夹:%USERPROFILE%\Documents\NuGetLocal
- 按照说明从不同的源安装扩展。
使用 PowerShell 管理扩展
Windows Admin Center 预览版包含一个用于管理网关扩展的 PowerShell 模块。
# Add the module to the current session
Import-Module "$env:ProgramFiles\windows admin center\PowerShell\Modules\ExtensionTools"
# Available cmdlets: Get-Feed, Add-Feed, Remove-Feed, Get-Extension, Install-Extension, Uninstall-Extension, Update-Extension
# List feeds
Get-Feed "https://wac.contoso.com"
# Add a new extension feed
Add-Feed -GatewayEndpoint "https://wac.contoso.com" -Feed "\\WAC\our-private-extensions"
# Remove an extension feed
Remove-Feed -GatewayEndpoint "https://wac.contoso.com" -Feed "\\WAC\our-private-extensions"
# List all extensions
Get-Extension "https://wac.contoso.com"
# Install an extension (locate the latest version from all feeds and install it)
Install-Extension -GatewayEndpoint "https://wac.contoso.com" "msft.sme.containers"
# Install an extension (latest version from a specific feed, if the feed is not present, it will be added)
Install-Extension -GatewayEndpoint "https://wac.contoso.com" "msft.sme.containers" -Feed "https://aka.ms/sme-extension-feed"
# Install an extension (install a specific version)
Install-Extension "https://wac.contoso.com" "msft.sme.certificate-manager" "0.133.0"
# Uninstall-Extension
Uninstall-Extension "https://wac.contoso.com" "msft.sme.containers"
# Update-Extension
Update-Extension "https://wac.contoso.com" "msft.sme.containers"
Note
必须是网关管理员才能使用 PowerShell 修改 Windows Admin Center 扩展。