powershell.exe Start-Process powershell.exe "set-executionpolicy" -Verb runAs
The above command will run a powershell window as admin and execute the command before it, however, if I want to make it say set-executionpolicy bypass, it will error out. How can I pass this parameter through the top command?
Below is the error I get when I pass said parameter:
Start-Process : A positional parameter cannot be found that accepts argument
'bypass'.
At line:1 char:1
+ Start-Process powershell.exe set-executionpolicy bypass -Verb runAs
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Start-Process], ParameterB
indingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell
.Commands.StartProcessCommand