Reply To: Windows Powershell ISE (As Administrator with two ps1-files)

Home Forums Scripting PowerShell Windows Powershell ISE (As Administrator with two ps1-files) Reply To: Windows Powershell ISE (As Administrator with two ps1-files)

JeremyW
JeremyW
Moderator
#614421

There’s several ways to accomplish this with the noprofile option. From powershell:

Start-Process -FilePath powershell_ise.exe -ArgumentList “-File”,”C:\test\test1.ps1,C:\test\test2.ps1″,”-NoProfile” -Verb RunAs

From command prompt:

RunAs /User:domain\username “powershell_ise.exe \”C:\test\test1.ps1,C:\test\test2.ps1\” -NoProfile”

Note the backslash to escape the double quotes used in the arguments.

Of course there’s more ways to do it too. :)