A shell in Windows Terminal [wt] can be launched/relaunched as Admin in three ways:
Powershell:
Start-Process -FilePath "powershell" -Verb RunAs
Pwsh:
Start-Process -FilePath "pwsh" -Verb RunAs
- These can be added as [environment variables](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables?view=powershell-7) to PowerShell [profiles](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7) [`$Profile`]:
`%UserProfile%\Documents\Windows Powershell\Microsoft.PowerShell_profile.ps1
%UserProfile%\Documents\Windows Powershell\profile.ps1
- Add
Relaunch-Admin function to profile, invoking Relaunch-Admin or alias psadmin:
`# Function to relaunch as Admin:
function Relaunch-Admin { Start-Process -Verb RunAs (Get-Process -Id $PID).Path }
Alias for the function:
Set-Alias psadmin Relaunch-Admin