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.



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”

| improve this answer | |
  • YES YES.. but if you want to spawn as a specific user, I think you need "RunAsUser" instead of RunAs. I also found some neat tricks I didn't know under this post. – Señor CMasMas Jan 17 at 15:56
  • Not quite. I cannot use Start-Process from within my profile. This link is similar to how I would call it from a profile. – Jake Geers Jan 20 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.