Shortcut placed in tiles that is set to run as administrator will not run as admin

I made a copy of the default powershell 7 shortcut, then modified the shortcut to run as administrator.  I then put both icons on a tile and attempted to run them.  The one set as admin will not run as an admin.  When I run the icon I copied and changed to run as administrator directly it prompts for admin access and works as admin.

Any suggestions, or ways to get that to work?

Thank you,

Steve

2,944 views 1 replies
Reply #1 Top

I found a solution.

#1: Create a powershell script with this content:

Start-Process pwsh.exe -Wait -verb runas

#2: Save the script in a location of your choice

#3: create a shortcut with this command line, replace "C:\Temp\PowerShell 7 admin.ps1" with the location of the script you created

"C:\Program Files\PowerShell\7\pwsh.exe" -ExecutionPolicy Bypass -file "C:\Temp\PowerShell 7 admin.ps1"