启动 Windows PowerShellStarting Windows PowerShell

PowerShell 是一个脚本引擎 dll,嵌入到多个主机中。PowerShell is a scripting engine dll which is embedded into multiple hosts. 启动的最常见主机是交互式命令行 PowerShell.exe 和交互式脚本环境 PowerShell_ISE.exe。The most common host you will start are the interactive command line PowerShell.exe and the Interactive Scripting Environment PowerShell_ISE.exe.

若要在 Windows Server® 2012 R2、Windows® 8.1、Windows Server 2012 和 Windows 8 上启动 Windows PowerShell®,请参阅常见管理任务和导航To start Windows PowerShell® on Windows Server® 2012 R2, Windows® 8.1, Windows Server 2012, and Windows 8, see Common Management Tasks and Navigation.

如何在早期版本的 Windows 上启动 Windows PowerShellHow to Start Windows PowerShell on Earlier Versions of Windows

本部分介绍了如何在 Windows® 7、Windows Server® 2008 R2 和 Windows Server® 2008 上启动 Windows PowerShell 和 Windows PowerShell 集成脚本环境 (ISE)。This section explains how to start Windows PowerShell and Windows PowerShell Integrated Scripting Environment (ISE) on Windows® 7, Windows Server® 2008 R2, and Windows Server® 2008. 还介绍了如何在 Windows Server® 2008 R2 和 Windows Server® 2008 上的 Windows PowerShell 2.0 中启用 Windows PowerShell ISE 的可选功能。It also explains how to enable the optional feature for Windows PowerShell ISE in Windows PowerShell 2.0 on Windows Server® 2008 R2 and Windows Server® 2008.

使用以下任一方法来启动已安装的 Windows PowerShell 3.0 或 Windows PowerShell 4.0 版本(如果适用)。Use any of the following methods to start the installed version of Windows PowerShell 3.0, or Windows PowerShell 4.0, where applicable.

在“开始”菜单中From the Start Menu

  • 单击“开始” ,键入 PowerShell,然后单击“Windows PowerShell” 。Click Start, type PowerShell, and then click Windows PowerShell.
  • 在“开始” 菜单中,依次单击“开始” 、“所有程序” 、“附件” 、“Windows PowerShell” 文件夹,然后单击“Windows PowerShell” 。From the Start menu, click Start, click All Programs, click Accessories, click the Windows PowerShell folder, and then click Windows PowerShell.

在命令提示符处At the Command Prompt

在 Cmd.exe、Windows PowerShell 或 Windows PowerShell ISE 中,若要启动 Windows PowerShell,请键入:In Cmd.exe, Windows PowerShell, or Windows PowerShell ISE, to start Windows PowerShell, type:

PowerShell

你还可以使用 PowerShell.exe 程序的参数来自定义会话。You can also use the parameters of the PowerShell.exe program to customize the session. 有关详细信息,请参阅 PowerShell.exe 命令行帮助For more information, see PowerShell.exe Command-Line Help.

使用管理权限(“以管理员身份运行”)With Administrative privileges ("Run as administrator")

单击“开始”,键入 PowerShell,右键单击“Windows PowerShell”,然后单击“以管理员身份运行”。Click Start, type PowerShell, right-click Windows PowerShell, and then click Run as administrator.

如何在早期版本的 Windows 上启动 Windows PowerShell ISEHow to Start Windows PowerShell ISE on Earlier Releases of Windows

使用以下任一方法启动 Windows PowerShell ISE。Use any of the following methods to start Windows PowerShell ISE.

在“开始”菜单中From the Start Menu

  • 单击“开始” ,键入 ISE,然后单击“Windows PowerShell ISE” 。Click Start, type ISE, and then click Windows PowerShell ISE.
  • 在“开始” 菜单中,依次单击“开始” 、“所有程序” 、“附件” 、“Windows PowerShell” 文件夹,然后单击“Windows PowerShell ISE” 。From the Start menu, click Start, click All Programs, click Accessories, click the Windows PowerShell folder, and then click Windows PowerShell ISE.

在命令提示符处At the Command Prompt

在 Cmd.exe、Windows PowerShell 或 Windows PowerShell ISE 中,若要启动 Windows PowerShell,请键入:In Cmd.exe, Windows PowerShell, or Windows PowerShell ISE, to start Windows PowerShell, type:

PowerShell_ISE

or

ISE

使用管理权限(“以管理员身份运行”)With Administrative privileges ("Run as administrator")

单击“开始”,键入 ISE,右键单击“Windows PowerShell ISE”,然后单击“以管理员身份运行”。Click Start, type ISE, right-click Windows PowerShell ISE, and then click Run as administrator.

如何在早期版本的 Windows 上启用 Windows PowerShell ISEHow to Enable Windows PowerShell ISE on Earlier Releases of Windows

在 Windows PowerShell 4.0 和 Windows PowerShell 3.0 中,默认情况下,所有版本的 Windows 上都启用 Windows PowerShell ISE。In Windows PowerShell 4.0 and Windows PowerShell 3.0, Windows PowerShell ISE is enabled by default on all versions of Windows. 如果尚未启用,则 Windows Management Framework 4.0 或 Windows Management Framework 3.0 会启用它。If it is not already enabled, Windows Management Framework 4.0 or Windows Management Framework 3.0 enables it.

在 Windows PowerShell 2.0 中,默认情况下,在 Windows 7 上启用 Windows PowerShell ISE。In Windows PowerShell 2.0, Windows PowerShell ISE is enabled by default on Windows 7. 但是,在 Windows Server 2008 R2 和 Windows Server 2008 上,它是一项可选功能。However, on Windows Server 2008 R2 and Windows Server 2008, it is an optional feature.

若要启用 Windows Server 2008 R2 或 Windows Server 2008 上的 Windows PowerShell 2.0 中的 Windows PowerShell ISE,请使用以下过程。To enable Windows PowerShell ISE in Windows PowerShell 2.0 on Windows Server 2008 R2 or Windows Server 2008, use the following procedure.

启用 Windows PowerShell 集成脚本环境 (ISE)To enable Windows PowerShell Integrated Scripting Environment (ISE)

  1. 启动“服务器管理器”。Start Server Manager.
  2. 单击“功能” ,然后单击“添加功能” 。Click Features and then click Add Features.
  3. 在“选择功能”中,单击“Windows PowerShell 集成脚本环境 (ISE)”In Select Features, click Windows PowerShell Integrated Scripting Environment (ISE).

启动 32 位版本的 Windows PowerShellStarting the 32-Bit Version of Windows PowerShell

在 64 位计算机 (Windows PowerShell (x86) ) 上安装 Windows PowerShell 时,除 64 位版之外,还将安装 32 位版本的 Windows PowerShell。When you install Windows PowerShell on a 64-bit computer, Windows PowerShell (x86), a 32-bit version of Windows PowerShell is installed in addition to the 64-bit version. 运行 Windows PowerShell 时,默认运行 64 位版。When you run Windows PowerShell, the 64-bit version runs by default.

但是,有时可能需要运行 Windows PowerShell (x86) ,例如使用需要 32 位版的模块时,或者远程连接到 32 位计算机时。However, you might occasionally need to run Windows PowerShell (x86), such as when you are using a module that requires the 32-bit version or when you are connecting remotely to a 32-bit computer.

若要启动 32 位版本的 Windows PowerShell,请使用以下任何过程。To start a 32-bit version of Windows PowerShell, use any of the following procedures.

在 Windows Server® 2012 R2 中In Windows Server® 2012 R2

  • 在“开始” 屏幕上,键入 Windows PowerShell (x86)On the Start screen, type Windows PowerShell (x86). 单击“Windows PowerShell x86” 磁贴。Click the Windows PowerShell x86 tile.
  • 在“服务器管理器” 中,从“工具” 菜单中选择“Windows PowerShell (x86)” 。In Server Manager, from the Tools menu, select Windows PowerShell (x86).
  • 在桌面上,将光标移动到右上角,单击“搜索” ,键入PowerShell x86,然后单击“Windows PowerShell (x86)” 。On the desktop, move the cursor to the upper right corner, click Search, type PowerShell x86 and then click Windows PowerShell (x86).
  • 通过命令行,输入:%SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell.exeVia command line, enter: %SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell.exe

在 Windows Server® 2012 中In Windows Server® 2012

  • 在“开始” 屏幕上,键入 PowerShell,然后单击“Windows PowerShell (x86)” 。On the Start screen, type PowerShell and then click Windows PowerShell (x86).
  • 在“服务器管理器” 中,从“工具” 菜单中选择“Windows PowerShell (x86)” 。In Server Manager, from the Tools menu, select Windows PowerShell (x86).
  • 在桌面上,将光标移动到右上角,单击“搜索” ,键入 PowerShell,然后单击“Windows PowerShell (x86)” 。On the desktop, move the cursor to the upper right corner, click Search, type PowerShell and then click Windows PowerShell (x86).
  • 通过命令行,输入:%SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell.exeVia command line, enter: %SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell.exe

在 Windows® 8.1 中In Windows® 8.1

  • 在“开始” 屏幕上,键入 Windows PowerShell (x86)On the Start screen, type Windows PowerShell (x86). 单击“Windows PowerShell x86” 磁贴。Click the Windows PowerShell x86 tile.
  • 如果你正在运行 Windows 8.1 的远程服务器管理工具,则也可从“服务器管理器工具” 菜单中打开 Windows PowerShell x86。If you are running Remote Server Administration Tools for Windows 8.1, you can also open Windows PowerShell x86 from the Server ManagerTools menu. 选择“Windows PowerShell (x86)” 。Select Windows PowerShell (x86).
  • 在桌面上,将光标移动到右上角,单击“搜索” ,键入PowerShell x86,然后单击“Windows PowerShell (x86)” 。On the desktop, move the cursor to the upper right corner, click Search, type PowerShell x86 and then click Windows PowerShell (x86).
  • 通过命令行,输入:%SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell.exeVia command line, enter: %SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell.exe

在 Windows® 8 中In Windows® 8

  • 在“开始” 屏幕上,将光标移动到右上角,依次单击“设置” 、“磁贴” ,然后将“显示管理工具” 滑块移动到“是”。On the Start screen, move the cursor to the upper right corner, click Settings, click Tiles, and then move the Show Administrative Tools slider to Yes. 然后,键入 PowerShell,单击“Windows PowerShell (x86)” 。Then, type PowerShell and click Windows PowerShell (x86).
  • 如果你正在运行 Windows 8 的远程服务器管理工具,则也可从“服务器管理器工具” 菜单中打开 Windows PowerShell x86。If you are running Remote Server Administration Tools for Windows 8, you can also open Windows PowerShell x86 from the Server ManagerTools menu. 选择“Windows PowerShell (x86)” 。Select Windows PowerShell (x86).
  • 在“开始” 屏幕或桌面上,键入 PowerShell (x86) ,然后单击“Windows PowerShell (x86)” 。On the Start screen or the desktop, type PowerShell (x86) and then click Windows PowerShell (x86).
  • 通过命令行,输入:%SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell.exeVia command line, enter: %SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell.exe