Is it possible to start an app as admin in powershell?
I want to create a scheduled task that runs an app as an admin. Is this possible?
My current task action is this
powershell
$packageFamilyName = (Get-AppxPackage | Where-Object { $_.Name -eq 'MyApp' }
| Select-Object -ExpandProperty PackageFamilyName);
Start-Process shell:appsFolder\$packageFamilyName!MyApp;
Solution 1:
Use the Start-Process command:
Start-Process powershell -Verb runAs -FilePath "notepad" -ArgumentList arguments
For more discussion and other possibilities, see Running a command as Administrator using PowerShell?