许多 IT 专业人员使用PowerShell来管理Windows计算机和设备并执行各种管理任务。在Windows 11和Windows 10中使用PowerShell之前,您首先需要知道如何启动它。这就是为什么我们列出了所有可用于启动Windows PowerShell的方法,包括以管理员权限运行它。继续阅读以了解所有内容:
注意:(NOTE:)本指南涵盖Windows 11 和Windows 10。两种操作系统之间的方法有时会略有不同。如果您不知道设备上的Windows 版本(Windows version),请阅读本教程:如何分辨我拥有的Windows。
1. 使用搜索启动 PowerShell
打开PowerShell的最快方法是使用Windows Search。在 Windows 11 中,访问搜索(Search)很简单:只需单击或点击(click or tap)任务栏上的相应按钮(看起来像放大镜的按钮)。然后,键入powershell。如果要运行它,只需单击或点击(click or tap)Windows PowerShell结果。如果您想以管理员身份运行它,请单击或点击搜索窗口(search window)右侧的按钮。
(Run PowerShell)在Windows 11中使用搜索(Search)运行 PowerShell
注意:(NOTE:)以管理员身份运行程序需要设备的管理权限并触发UAC(用户帐户控制(User Account Control))警告。
在Windows 10中,它更简单,因为默认情况下,您在任务栏中有一个搜索字段(search field)。只需单击或点击(Just click or tap)该字段,然后输入powershell。然后,单击或点击Windows PowerShell结果。与Windows 11(Windows 11)类似,如果您想以管理员身份运行PowerShell ,请单击或点击(click or tap)搜索窗口(search window)右侧窗格中的相应按钮。
(Run PowerShell)在Windows 10中使用搜索(Search)运行 PowerShell
提示:(TIP:)在这两个操作系统中,您还可以通过右键单击结果然后从上下文菜单中选择“以管理员身份运行”来以管理员身份运行程序。(“Run as administrator”)
2.使用运行窗口(Run window)打开 PowerShell(Open PowerShell)
在任何现代版本的Windows中启动(Windows)PowerShell的最快方法之一是使用“运行”(Run)窗口。启动此窗口的一种快速方法是按键盘上的Win + R键。然后,键入powershell并按Enter键或单击OK。
(Open PowerShell)使用“运行”窗口(Run window)打开 PowerShell
此方法适用于Windows 11和Windows 10。
3.从开始菜单启动(Start Menu)PowerShell
在Windows 11中从开始菜单(Start Menu)启动PowerShell比在Windows 10中要复杂一些。首先(First),按键盘上的Windows键(Windows)打开开始菜单(Start Menu),然后单击或点击(click or tap)所有应用程序(All apps)。
访问 Windows 11 中的所有应用
接下来,浏览应用程序,直到找到Windows 工具(Windows Tools)。点击它。
单击或点击 Windows 工具
这将打开一个新窗口。向下滚动(Scroll),直到找到Windows PowerShell图标,然后单击或点击它。
Windows PowerShell 图标(Windows PowerShell icon)位于列表末尾
如果您想以管理员身份运行程序,而不是单击图标,右键单击(或点击并按住(tap and hold))它以调出右键菜单。然后,单击或点击(click or tap)以管理员身份运行(Run as administrator)。
在 Windows 10 中,打开“开始”菜单(Start Menu)并转到Windows PowerShell快捷方式文件夹。在那里,您可以找到Windows PowerShell的快捷方式。
(Open PowerShell)在Windows 10中使用“开始”菜单(Start Menu)打开 PowerShell
注意:(NOTE:)要以管理员身份运行它,请右键单击Windows PowerShell快捷方式,单击更多(More),然后单击“以管理员身份运行(Run as administrator)”选项。
4.使用其可执行文件运行 PowerShell(Run PowerShell)
您还可以使用文件资源管理器打开(File Explorer)PowerShell。要访问该程序的 32 位版本,请导航至:“ C:\Windows\System32\WindowsPowerShell\v1.0 ”(或将路径复制并粘贴(copy and paste)到地址栏中)。在那里,您可以找到 32 位的 powershell 可执行文件。PowerShell的 64 位版本(64 位Windows默认打开的版本)位于:“ C:\Windows\SysWOW64\WindowsPowerShell\v1.0.” 要以管理员身份运行程序,请右键单击powershell.exe,然后选择“以管理员身份运行(Run as administrator)”选项。
使用文件资源管理器(File Explorer)启动PowerShell
注意:(NOTE:)如果您想知道 32 位和 64 位PowerShell之间有什么区别,答案是 - 在实际使用中,几乎没有。在 64 位计算机Windows PowerShell (x86)上,除了 64 位版本之外,还安装了 32 位版本的Windows PowerShell 。运行PowerShell时,默认运行 64 位版本。但是,当您使用需要 32 位版本的模块或远程连接到 32 位计算机时,您可能偶尔需要运行PowerShell (x86) 。
5.使用WinX 高级(WinX power)用户菜单(user menu)启动 PowerShell(Start PowerShell)
Windows 10 包含一个供高级用户使用的隐藏菜单,名为WinX 菜单(WinX menu)。启动它的最快方法是按键盘上的Win + X键,但您也可以在桌面左下角的Windows徽标上单击鼠标右键(或按住(press and hold)) 。在这里,您可以找到各种实用程序的快捷方式,包括两个用于启动PowerShell(一个具有有限权限,一个具有管理员权限)。
Windows 10中(Windows 10)WinX 菜单(WinX menu)中的PowerShell快捷方式
在Windows 11中,这两个快捷方式已替换为Windows Terminal的快捷方式。单击(Click)其中任何一个以启动Windows 终端(Windows Terminal),PowerShell将在终端(Terminal)窗口中打开。
Windows 10 WinX 菜单(WinX menu)中的终端(Terminal)快捷方式
提示:(TIP:)如果命令提示符(Command Prompt )在终端(Terminal )窗口中打开,或者您只需要在Windows 终端中运行(Windows Terminal)PowerShell的帮助,请阅读本文:如何在Windows 终端中在(Windows Terminal)CMD 和 PowerShell(CMD and PowerShell)之间切换。
6.在桌面上为PowerShell创建快捷方式
如果您更喜欢使用快捷方式,请不要犹豫,创建PowerShell的快捷方式。如果您不知道如何创建快捷方式并且需要帮助,请阅读本指南:如何在Windows(Windows)中为文件、文件夹和网页创建快捷方式。您唯一需要记住的是键入powershell作为您为其创建快捷方式的项目的位置,就像下面的屏幕截图一样。
创建Windows PowerShell的快捷方式(Windows PowerShell)
您还可以使用PowerShell可执行文件的直接路径,在本指南中的方法四中共享。
7.使用我们集合中的快捷方式打开 PowerShell(Open PowerShell)
当然,如果您懒得自己创建PowerShell的快捷方式,我们为(PowerShell)Windows收集了大量的快捷方式。下载(Download)存档并解压缩,您可以在Windows PowerShell子文件夹中找到(Windows PowerShell)PowerShell快捷方式。
您可以在同名文件夹中找到PowerShell的快捷方式(PowerShell)
8.使用任务管理器(Task Manager)启动PowerShell
打开PowerShell(PowerShell)的另一种方法是使用任务管理器(Task Manager)。启动任务管理器(Task Manager):一种快速的方法是同时按下键盘上的Ctrl + Shift + Esc键。如果任务管理器(Task Manager)以紧凑模式打开,请单击或点击“更多详细信息(More details)”。然后,打开“文件(File )”菜单并单击或点击“运行新任务(Run new task)”。在“创建新任务(Create new task)”窗口中,键入powershell并按Enter或OK。
(Run PowerShell)使用任务管理器(Task Manager)运行 PowerShell
如果您想以管理员权限启动应用程序,只需选中输入字段(input field)下方的框,然后按OK。
9.从命令提示符(Command Prompt)( CMD )打开PowerShell
一种有效的极客方法(geeky method)涉及从Command Prompt启动(Command Prompt)PowerShell。打开命令提示符(Command Prompt)后,输入以下命令,然后按Enter:
如果要以管理员身份从命令提示符启动(Command Prompt)PowerShell,请确保首先以管理员身份打开命令提示符(Command Prompt)。
(Run Windows PowerShell)使用命令提示符(Command Prompt)运行 Windows PowerShell
你知道其他启动PowerShell的方法吗?
这些是我们所知道的在Windows 11和Windows 10中启动(Windows 10)PowerShell的所有方式。如果您知道其他人,请随时在评论中分享。此外,如果您正在寻找一些关于如何使用PowerShell的好文章,请不要犹豫,阅读下面推荐的教程。
9 ways to open PowerShell in Windows (including as administrator)
Many IT professіonalѕ υsе PowerShell to manage Windows computers and devices and to execute administrative tasks of all kinds. Before you can use PowerShell in Windows 11 and Windows 10, you first need to know how to start it. That's why we made a list of all the methods available for starting Windows PowerShell, including running it with admin rights. Read on to learn them all:
NOTE: This guide covers Windows 11 and Windows 10. The methods sometimes differ slightly between the two operating systems. If you do not know the Windows version that you have on your device, read this tutorial: How to tell what Windows I have.
1. Start PowerShell using search
The fastest way to open PowerShell is by using Windows Search. In Windows 11, accessing Search is simple: just click or tap on the corresponding button on the taskbar (the one looking like a magnifying glass). Then, type powershell. If you want to run it, just click or tap on the Windows PowerShell result. If you want to run it as an administrator, click or tap the button on the right side of the search window.
Run PowerShell using Search in Windows 11
NOTE: Running a program as administrator requires administrative rights on the device and triggers a UAC (User Account Control) warning.
In Windows 10, it’s even simpler, since by default, you have a search field in the taskbar. Just click or tap on the field, then enter powershell. Then, click or tap the Windows PowerShell result. Similarly to Windows 11, if you want to run PowerShell as administrator, click or tap on the corresponding button in the right pane of the search window.
Run PowerShell using Search in Windows 10
TIP: In both operating systems, you can also run the program as administrator by right-clicking the result and then selecting “Run as administrator” from the context menu.
2. Open PowerShell using the Run window
One of the quickest ways to start PowerShell in any modern version of Windows is to use the Run window. A fast way to launch this window is to press the Win + R keys on your keyboard. Then, type powershell and press the Enter key or click OK.
Open PowerShell using the Run window
This method applies to both Windows 11 and Windows 10.
3. Launch PowerShell from the Start Menu
Launching PowerShell from the Start Menu in Windows 11 is a bit more complicated than it was in Windows 10. First, open the Start Menu by pressing the Windows key on your keyboard, then click or tap on All apps.
Access All apps in Windows 11
Next, browse through the apps until you find Windows Tools. Click on it.
Click or tap on Windows Tools
This opens a new window. Scroll down until you find the Windows PowerShell icon and click or tap on it.
The Windows PowerShell icon is at the end of the list
If you want to run the program as administrator, instead of clicking the icon, right-click (or tap and hold) on it to bring up the right-click menu. Then, click or tap on Run as administrator.
In Windows 10, open the Start Menu and go to the Windows PowerShell shortcuts folder. There, you can find a shortcut to Windows PowerShell.
Open PowerShell using the Start Menu in Windows 10
NOTE: To run it as administrator, right-click on the Windows PowerShell shortcut, click on More and then on the “Run as administrator” option.
4. Run PowerShell using its executable file
You can also open PowerShell using File Explorer. To access the 32-bit version of the program, navigate to: “C:\Windows\System32\WindowsPowerShell\v1.0” (or copy and paste the path into the address bar). There, you find the powershell executable on 32-bits. The 64-bit version of PowerShell (the one that 64-bit Windows opens by default) is located under: “C:\Windows\SysWOW64\WindowsPowerShell\v1.0.” To run the program as administrator, right-click on powershell.exe and then choose the “Run as administrator” option.
Launch PowerShell using File Explorer
NOTE: If you’re wondering what’s the difference between the 32-bit and 64-bit PowerShell, the answer is - in actual usage, almost none. On a 64-bit computer, Windows PowerShell (x86), a 32-bit version of Windows PowerShell is installed in addition to the 64-bit version. When you run PowerShell, the 64-bit version runs by default. However, you might occasionally need to run PowerShell (x86), when you're using a module that requires the 32-bit version or when you're connecting remotely to a 32-bit computer.
5. Start PowerShell using the WinX power user menu
Windows 10 includes a hidden menu for power users, named the WinX menu. The quickest way to launch it is to press the Win + X keys on your keyboard, but you can also do it with right-click (or press and hold) on the Windows logo from the bottom-left corner of your desktop. Here, you can find shortcuts for various utilities, including two for starting PowerShell (one with limited permissions and one with admin rights).
The PowerShell shortcuts in the WinX menu in Windows 10
In Windows 11, the two shortcuts have been replaced with ones for Windows Terminal. Click on either of them to launch Windows Terminal, and PowerShell will open inside the Terminal window.
The Terminal shortcuts in the WinX menu in Windows 10
TIP: If the Command Prompt opens instead inside the Terminal window, or you just need assistance with running PowerShell in Windows Terminal, read this article: How to switch between CMD and PowerShell in Windows Terminal.
6. Create a shortcut for PowerShell on your desktop
If you prefer using shortcuts, then do not hesitate to create a shortcut to PowerShell. If you do not know how and need help with creating shortcuts, read this guide: How to create shortcuts for files, folders, and web pages in Windows. The only thing you have to remember is to type powershell as the location of the item you create the shortcut for, just like in the screenshot below.
Create a shortcut to Windows PowerShell
You can also use the direct path to the PowerShell executable file, shared at method four from this guide.
7. Open PowerShell by using the shortcut from our collection
Of course, if you can’t be bothered to create a shortcut to PowerShell yourself, we assembled an extensive collection of shortcuts for Windows. Download the archive, extract it, and you can find the PowerShell shortcut in the Windows PowerShell subfolder.
You can find the shortcut to PowerShell in the folder with the same name
8. Use Task Manager to start PowerShell
Another way of opening PowerShell is to use the Task Manager. Launch Task Manager: a quick way is to simultaneously press the Ctrl + Shift + Esc keys on your keyboard. If the Task Manager opens up in its compact mode, click or tap on "More details." Then, open the File menu and click or tap on "Run new task." In the "Create new task" window, type powershell and press Enter or OK.
Run PowerShell using the Task Manager
If you want to start the app with administrator privileges, just check the box below the input field before pressing OK.
9. Open PowerShell from the Command Prompt (CMD)
A geeky method that works involves starting PowerShell from the Command Prompt. After opening the Command Prompt, type in the following command, followed by Enter:
If you want to start PowerShell from the Command Prompt, as administrator, make sure that you first open the Command Prompt as administrator.
Run Windows PowerShell using the Command Prompt
Do you know other ways of starting PowerShell?
These are all the ways we know for launching PowerShell in Windows 11 and Windows 10. If you know of others, do not hesitate to share them in a comment. Also, if you are looking for some good articles on how to use PowerShell, do not hesitate to read the tutorials recommended below.