Open Windows Terminal as admin with WIN+R - Super User

PHOTO EMBED

Fri Jan 21 2022 05:47:42 GMT+0000 (Coordinated Universal Time)

Saved by @pirate

$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$Home\Desktop\Windows Terminal.lnk")
$Shortcut.TargetPath = "$env:LOCALAPPDATA\Microsoft\WindowsApps\Microsoft.WindowsTerminal_8wekyb3d8bbwe\wt.exe"
$Shortcut.Save()

$bytes = [System.IO.File]::ReadAllBytes("$Home\Desktop\Windows Terminal.lnk")
$bytes[0x15] = $bytes[0x15] -bor 0x20 #set byte 21 (0x15) bit 6 (0x20) ON
[System.IO.File]::WriteAllBytes("$Home\Desktop\Windows Terminal.lnk", $bytes)
content_copyCOPY

https://superuser.com/questions/1560049/open-windows-terminal-as-admin-with-winr/1560192