It is possible to open PowerShell as an administrator in Windows 11 as many times as we want, we can even configure it so that it always opens with elevated privileges. PowerShell would come to replace the Command Prompt for all command line actions in the operating system. It is part of the Windows Terminal application and we can use it to solve different problems that we have in the OS..
Open PowerShell as administrator in Windows 11
By running PowerShell with administrator permissions in Windows 11, we have the ability to run commands that bypass Windows file protection, such as those used for Windows installation files.
What we have to do is press “Start” or the “Windows” key on our keyboard. After this we are going to write “PowerShell” or “Terminal”; Next, we'll choose Run as administrator in the right pane..
How do we know it was run as administrator? In the upper bar we will be able to see that it says "Administrator", this means that we have indeed managed to run PowerShell with elevated privileges.
How to run it as administrator permanently
If we want PowerShell to run with administrator privileges at all times, we will have to configure Windows Terminal (which uses PowerShell by default) and to do so we will first have to verify the version of Windows Terminal by typing the following command: Wt -v
A small window will open where we can view the version of Terminal that we currently have available..
We are going to have to update the version of Windows Terminal to the latest available, for this we simply copy and paste the following command: Winget install –id Microsoft.WindowsTerminal.Preview
A text similar to the one we see in the image will appear when it updates successfully.
Next, we will right click on the start menu and choose “Windows Terminal”.
In the terminal window, at the top, we will press the arrow pointing down and in the menu we will choose "Settings".
Right in the "Settings" menu, we go to "Profiles" in the left sidebar and we are going to click on PowerShell. We will have to activate the "Run this profile as administrator" switch and click on "Save".