Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Take Command tab as PowerShell

Jul
304
0
I have one of my tabs on Take Command set to open a PowerShell instance. If my PS tab starts with the following commands

Command=%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
Directory=C:\
RunAs=

What can I do/modify/add to have PowerShell running with Admin rights?
 
Here is one method of doing what you want;
1546945651215.png


Joe
 
It seemingly didn't work. I get the following error with the tab:

Set-ExecutionPolicy : Access to the registry key
'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell' is denied. To change the
execution policy for the default (LocalMachine) scope, start Windows PowerShell with the "Run as administrator"
option. To change the execution policy for the current user, run "Set-ExecutionPolicy -Scope CurrentUser".
At C:\Users\OL Man\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:1 char:1
+ Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (:) [Set-ExecutionPolicy], UnauthorizedAccessException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.SetExecutionPolicyCo
mmand
 
After opening the window (getting no error) I ran the following

([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
>>
>> [Security.Principal.WindowsBuiltInRole] "Administrator")
False
PS C:\>
 

Similar threads

Back
Top