安装和配置 WMF 5.1Install and Configure WMF 5.1

下载和安装 WMF 5.1 包Download and install the WMF 5.1 package

下载适用于要在其中进行安装的操作系统和体系结构的 WMF 5.1 包:Download the WMF 5.1 package for the operating system and architecture you wish to install it on:

操作系统Operating System 必备条件Prerequisites 包链接Package Links
Windows Server 2012 R2Windows Server 2012 R2 Win8.1AndW2K12R2-KB3191564-x64.msuWin8.1AndW2K12R2-KB3191564-x64.msu
Windows Server 2012Windows Server 2012 W2K12-KB3191565-x64.msuW2K12-KB3191565-x64.msu
Windows Server 2008 R2Windows Server 2008 R2 .NET Framework 4.5.2.NET Framework 4.5.2 Win7AndW2K8R2-KB3191566-x64.ZIPWin7AndW2K8R2-KB3191566-x64.ZIP
Windows 8.1Windows 8.1 x64:Win8.1AndW2K12R2-KB3191564-x64.msux64: Win8.1AndW2K12R2-KB3191564-x64.msu
x86:Win8.1-KB3191564-x86.msux86: Win8.1-KB3191564-x86.msu
Windows 7 SP1Windows 7 SP1 .NET Framework 4.5.2.NET Framework 4.5.2 x64:Win7AndW2K8R2-KB3191566-x64.ZIPx64: Win7AndW2K8R2-KB3191566-x64.ZIP
x86:Win7-KB3191566-x86.ZIPx86: Win7-KB3191566-x86.ZIP

安装适用于 Windows Server 2008 R2 和 Windows 7 的 WMF 5.1Install WMF 5.1 for Windows Server 2008 R2 and Windows 7

注意: 针对 Windows Server 2008 R2 和 Windows 7 的安装说明发生变化,不同于其他包的安装说明。Note: Installation instructions for Windows Server 2008 R2 and Windows 7 have changed, and differ from the instructions for the other packages. 下文中介绍了针对 Windows Server 2012 R2、Windows Server 2012 和 Windows 8.1 的安装说明。Installation instructions for Windows Server 2012 R2, Windows Server 2012, and Windows 8.1 are below.

在 Windows Server 2008 R2 和 Windows 7 上安装 WMF 5.1Installing WMF 5.1 on Windows Server 2008 R2 and Windows 7

  1. 转到在其中下载了 ZIP 文件的文件夹。Navigate to the folder into which you downloaded the ZIP file.

  2. 右键单击 ZIP 文件,然后选择“全部提取...”。Right-click on the ZIP file, and select "Extract All...". ZIP 文件中包含 2 个文件:MSU 和 Install-WMF5.1.PS1 脚本文件。The Zip contains 2 files: an MSU and the Install-WMF5.1.PS1 script file. 解压缩 ZIP 文件后,便可以将内容复制到运行 Windows 7 或 Windows Server 2008 R2 的任何一台计算机上。Once you have unpacked the ZIP file, you can copy the contents to any machine running Windows 7 or Windows Server 2008 R2.

  3. 提取 ZIP 文件内容后,以管理员身份打开 PowerShell,然后导航到包含 ZIP 文件内容的文件夹。After extracting the ZIP file contents, open PowerShell as administrator, then navigate to the folder containing the contents of the ZIP file.

  4. 在此文件夹中运行 Install-Wmf5.1.ps1 脚本,然后按说明操作。Run the Install-Wmf5.1.ps1 script in that folder, and follow the instructions. 此脚本会在本地计算机上检查系统必备,如果系统必备已满足,则会安装 WMF 5.1。This script will check the prerequisites on the local machine, and install WMF 5.1 if the prerequisites have been met. 下文中列出了系统必备。The prerequisites are listed below.

Install-WMF5.1.ps1 采用以下参数,以简化在 Windows Server 2008 R2 和 Windows 7 上自动执行安装:Install-WMF5.1.ps1 takes the following parameters to ease automating the installation on Windows Server 2008 R2 and Windows 7:

  • AcceptEula:如果包含此参数,将会自动接受但不显示 EULA。AcceptEula: When this parameter is included, the EULA is automatically accepted and will not be displayed.
  • AllowRestart:只有在指定 AcceptEula 后,才能使用此参数。AllowRestart: This parameter can only be used if AcceptEula is specified. 如果包含此参数,并且在安装 WMF 5.1 后需要重启,将在安装完成后不发出提示就立即重启计算机。If this parameter is included, and a restart is required after installing WMF 5.1, the restart will happen without prompting immediately after the installation is completed.

Windows Server 2008 R2 SP1 和 Windows 7 SP1 的 WMF 5.1 系统必备WMF 5.1 Prerequisites for Windows Server 2008 R2 SP1 and Windows 7 SP1

若要在 Windows Server 2008 R2 SP1 或 Windows 7 SP1 上安装 WMF 5.1,必须先安装以下各项:Installation of WMF 5.1 on either Windows Server 2008 R2 SP1 or Windows 7 SP1, requires the following:

  • 必须安装最新 Service Pack。Latest service pack must be installed.
  • 不得安装 WMF 3.0。WMF 3.0 must not be installed. 安装 WMF 5.1 来替代 WMF 3.0 会导致 PSModulePath 丢失,进而可能会导致其他应用程序无法正常运行。Installing WMF 5.1 over WMF 3.0 will result in the loss of the PSModulePath, which can cause other applications to fail. 安装 WMF 5.1 前,要么必须先卸载 WMF 3.0,要么必须先保存 PSModulePath,然后在 WMF 5.1 安装完成后进行手动还原。Before installing WMF 5.1, you must either un-install WMF 3.0, or save the PSModulePath and then restore it manually after WMF 5.1 installation is complete.
  • WMF 5.1 中至少需要.NET Framework 4.5.2WMF 5.1 requires at least .NET Framework 4.5.2. 可按照下载位置的说明安装 Microsoft .NET Framework 4.5.2。You can install Microsoft .NET Framework 4.5.2 by following the instructions at the download location.

WinRM 依赖关系WinRM Dependency

Windows PowerShell Desired State Configuration (DSC) 依赖 WinRM。Windows PowerShell Desired State Configuration (DSC) depends on WinRM. 在 Windows Server 2008 R2 和 Windows 7 上默认不启用 WinRM。WinRM is not enabled by default on Windows Server 2008 R2 and Windows 7. 若要启用 WinRM,在 Windows PowerShell 提升的会话中运行 Set-WSManQuickConfigRun Set-WSManQuickConfig, in a Windows PowerShell elevated session, to enable WinRM.

安装适用于 Windows Server 2012 R2、Windows Server 2012 和 Windows 8.1 的 WMF 5.1Install WMF 5.1 for Windows Server 2012 R2, Windows Server 2012, and Windows 8.1

在 Windows 资源管理器(或 Windows Server 2012 R2 或 Windows 8.1 中的文件资源管理器)中安装Install from Windows Explorer (or File Explorer in Windows Server 2012 R2 or Windows 8.1)

  1. 导航到在其中下载了 MSU 文件的文件夹。Navigate to the folder into which you downloaded the MSU file.
  2. 双击 MSU 以运行它。Double-click the MSU to run it.

通过命令提示符进行安装Installing from the Command Prompt

  1. 下载适用于计算机体系结构的正确程序包后,使用提升的用户权限(以管理员身份运行)打开“命令提示符”窗口。After downloading the correct package for your computer's architecture, open a Command Prompt window with elevated user rights (Run as Administrator). 在 Windows Server 2012 R2、Windows Server 2012 或 Windows Server 2008 R2 SP1 的服务器核心安装选项上,命令提示符默认使用提升的用户权限打开。On the Server Core installation options of Windows Server 2012 R2, Windows Server 2012, or Windows Server 2008 R2 SP1, Command Prompt opens with elevated user rights by default.
  2. 将目录更改为向其中下载或复制 WMF 5.1 安装包的文件夹。Change directories to the folder into which you have downloaded or copied the WMF 5.1 installation package.
  3. 运行下列命令之一:Run one of the following commands:
    • 在运行 Windows Server 2012 R2 或 Windows 8.1 x64 的计算机上,运行 Win8.1AndW2K12R2-KB3191564-x64.msu /quietOn computers that are running Windows Server 2012 R2 or Windows 8.1 x64, run Win8.1AndW2K12R2-KB3191564-x64.msu /quiet.
    • 在运行 Windows Server 2012 的计算机上,运行 W2K12-KB3191565-x64.msu /quietOn computers that are running Windows Server 2012, run W2K12-KB3191565-x64.msu /quiet.
    • 在运行 Windows 8.1 x86 的计算机上,运行 Win8.1-KB3191564-x86.msu /quietOn computers that are running Windows 8.1 x86, run Win8.1-KB3191564-x86.msu /quiet.

备注

安装 WMF 5.1 需要重新启动。Installing WMF 5.1 requires a reboot. 使用 /quiet 选项将重新启动系统而不发出警告。Using the /quiet option will reboot the system without warning. 使用 /norestart 选项可避免重新启动。Use the /norestart option to avoid rebooting. 但是,要重新启动才会安装 WMF 5.1。However, WMF 5.1 will not be installed until you have rebooted.