The windows terminal normally it will not allow admin tabs to open simultaneously with other non-elevated tabs. But with a third party tool, it is possible! Here’s how to start PowerShell as administrator in Windows Terminal.
How Windows Terminal handles administrative permissions
Run PowerShell As administrator (also known as elevated PowerShell), allows you to execute commands and access files that are normally restricted. The commands and files that are restricted tend to be critical to the operation and security of the operating system, requiring special administrative permissions to run, move, modify, or delete.
Windows Terminal does not allow you to have PowerShell tabs open with mixed permissions for security reasons. It’s hard to completely isolate open tabs from each other; in practice, that means something running in a non-elevated PowerShell tab could escalate its permissions through an elevated PowerShell tab, leaving your PC exposed. The developers decided that the risk, while small, was best avoided altogether.
How to Start PowerShell as Administrator in Windows Terminal
Since Windows Terminal doesn’t natively allow mixed-permission tabs, there’s only one way to run PowerShell as an administrator within Windows Terminal: run Windows Terminal as an administrator. When Windows Terminal is running as administrator, all newly opened tabs will also run as administrator.
To run Windows Terminal as an administrator, click Start, type “terminal” in the search bar, then click the chevron (it looks like an arrow without a tail) to expand the list of options.
Click “Run as administrator” in the expanded list.
Suggestion: you can also right-click on the Windows Terminal shortcut after searching for it and select “Run as administrator”.
How to start PowerShell as administrator in Windows Terminal with third-party tools
Windows Terminal does not support mixing elevated and non-elevated PowerShell tabs for security reasons. If you want to do it anyway, you can enable it with a small open source program called gsudo.
Warning: Microsoft developers chose not to include this functionality for a reason. It has been repeatedly requested and refused. Note that mixing elevated and non-elevated command line environments in the same window presents a slight security risk.
Gsudo is installed from the command line using winget . Start PowerShell scribe
winget install gerardog.gsudoand then press Enter.
The installation will start immediately; When prompted to accept the terms and conditions, press the
ykey and then press Enter. If it completes successfully, you will see something like this:
Once gsudo has been installed, you need to open Windows Terminal and create a new profile. Click the chevron at the top of the Windows Terminal and then click “Settings.”
Click on “Add a new profile”, select “Windows PowerShell” and then click on “Duplicate”.
We need to modify some lines in this profile.
First, you need to rename the duplicate profile to something descriptive, like “PowerShell (Admin),” so it doesn’t get mixed up with the non-admin PowerShell profile.
We also need to modify the command that is executed when this profile is activated. Click on the line labeled “Command Prompt”, type
gsudo powershell.exeand then click “Save” at the bottom right.
Note: you can also change the icon if you want; it’s easy enough to create your own, or you can download icons from a site like iconfinder.com either iconarchive.com
You can launch the new elevated PowerShell in any Windows terminal by clicking the chevron near the top and selecting the PowerShell (Admin) profile.
That’s it: now you can have admin and non-admin PowerShell windows open in the same terminal. If you want, the exact same process also works for the command prompt, except the command line is changed to