PoshFunctions icon indicating copy to clipboard operation
PoshFunctions copied to clipboard

New-Shortcut does not enable "Run as administrator"

Open docker-creator opened this issue 11 months ago • 0 comments

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

Image

docker-creator avatar Feb 14 '25 08:02 docker-creator