Is it possible to run powershell.exe with startup parameters? Specifically I am looking to create a Windows Terminal profile which will launch a Windows Powershell session as a different user (my admin account). Here is a portion of my profile. Ideally, I am looking to modify the commandline argument but I am open to alternative workarounds.
Asked
Active
Viewed 3,895 times
1
Jake Geers
- 11
- 1
- 2
1 Answers
3
Partial answer I know, but with respect to the specific requirement:
launch a Windows Powershell session as a different user
You can achieve this with
Start-Process powershell.exe -Credential “domain\username” -NoNewWindow -ArgumentList “Start-Process powershell.exe -Verb runAs”
spikey_richie
- 8,951
Start-Processfrom within my profile. This link is similar to how I would call it from a profile. – Jake Geers Jan 20 '20 at 13:17