PoshFunctions
PoshFunctions copied to clipboard
New-Shortcut does not enable "Run as administrator"
New-Shortcut -Path "C:\temp\test.lnk" -TargetPath "C:\Program Files\PowerShell\7\pwsh.exe" -RunAsAdmin
The command above completes without errors, but fails to enable the "Run this program as an administrator" checkbox. Tested on Windows 11 23H2 and Windows server 2022 21H2