Currently, Windows Terminal does not support running individual tabs as Administrator.
There is an elegant workaround employing a third-party application,
Start PowerShell as Administrator.
choco install gsudo -y
Note: you don’t need chocolatey; refer to the gsudo source.
Open Windows Terminal ->
Command lineadd this:
pwsh.exe -Command "gsudo pwsh"
pwshis for PowerShell 7 (if you have it). This works equally well for the default PowerShell: just replace
- Change the tab icon to distinguish it from the non-elevated version.
Here’s a red one.