在 Windows PowerShell 中使用 VAMT
批量激活管理工具 (VAMT) PowerShell cmdlet 可用于执行与 Vamt.exe 命令行工具相同的功能。
安装 PowerShell 3.0
- VAMT PowerShell cmdlet 需要包含在 Windows(R) 8 和 Windows Server® 2012 中的 Windows PowerShell。你可以下载 Windows 7 的 PowerShell,或从 Microsoft 下载中心下载其他操作系统。
安装 Windows 评估和部署工具包
- 除 PowerShell 外,你必须导入 VAMT PowerShell 模块。安装 VAMT 后,模块包含在 Windows 评估和部署工具包 (Windows ADK) 3.0 文件夹中。如要安装 Windows ADK,请参阅“安装 Windows ADK”。
准备 VAMT PowerShell 环境
如要使用管理凭据打开 Windows 8 中的 PowerShell,则单击**“开始”,并键入“PowerShell”,以找到程序。右键单击“Windows PowerShell”,然后单击“以管理员身份运行”。如要打开 Windows 7 中的 PowerShell,依次单击“开始”、“所有程序”、“附件”和“Windows PowerShell”,再右键单击“Windows PowerShell”,然后单击“以管理员身份运行”**。
重要
如果你正在使用配有 64 位处理器的计算机,则选择“Windows PowerShell (x86)”。VAMT PowerShell cmdlet 仅可用于 x86 体系结构。你必须使用 x86 版本的 Windows PowerShell 才能导入 VAMT 模块,可以在以下目录中找到该版本:
- 可以在 C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe 中找到 x86 版本的 PowerShell
- 可以在 C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell_ise.exe 中找到 x86 版本的 PowerShell
- 可以在 C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe 中找到 x86 版本的 PowerShell
对于所有受支持的操作系统,你可以使用 Windows ADK 中包含的 VAMT PowerShell 模块。在默认情况下,模块与 Windows ADK 文件夹中的 VAMT 一同安装。将目录改为 VAMT 所在的目录。例如,Windows ADK 安装在默认位置,即是 C:\Program Files(x86)\Windows Kits\8.0, type
cd “C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\VAMT 3.0”
导入 VAMT PowerShell 模块。如要导入模块,请在命令提示符下键入以下命令:
Import-Module .\VAMT.psd1
Import-Module 仅将模块导入到当前会话中。如要将模块导入到所有会话中,则将 Import-Module 命令添加到 Windows PowerShell 配置文件中。有关配置文件的详细信息,请键入
get-help about_profiles
。
获得 VAMT PowerShell cmdlet 的帮助
你可以查看 VAMT PowerShell cmdlet 的所有帮助部分,或只查看你感兴趣的部分。如要查看 VAMT cmdlet 的帮助内容,请键入:
get-help <cmdlet name> -all
例如,键入:
get-help get-VamtProduct -all
警告
VAMT PowerShell cmdlet 不支持 update-help cmdlet。如要查看 VAMT cmdlet 的联机帮助,你可以将 -online 选项与 get-help cmdlet 配合使用。有关详细信息,请参阅“Windows PowerShell 中的批量激活管理工具 (VAMT) Cmdlet”。
查看 VAMT PowerShell 帮助部分的步骤
如要获得 cmdlet 的语法,请在命令提示符下键入以下命令:
get-help <cmdlet name>
例如,键入:
get-help get-VamtProduct
如要查看有关使用 cmdlet 的示例,请键入:
get-help <cmdlet name> -examples
例如,键入:
get-help get-VamtProduct -examples