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

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

Tagged: 

This topic contains 4 replies, has 2 voices, and was last updated by dreivilo47 dreivilo47 1 day ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • dreivilo47
    dreivilo47
    Participant
    #614153

    I use the following code to open two files in Powershell ISE:
    powershell_ise.exe -File “C:\test\test1.ps1,C:\test\test2.ps1” -NoProfile

    But… how can I open the Powershell ISE as Administrator and then open the two files?


    wullieb1
    Moderator
    #614212

    Start-Process -FilePath powershell_ISE.exe “C:\Test\Test1.ps1,C:\Test\Test2.ps1”

    The NoProfile option doesn’t work.

     

    dreivilo47
    dreivilo47
    Participant
    #614221

    Thank you for your answer/solution wullieb1.
    You have forgotten “-Verb RunAs” to run it as administrator.

    So, the full line is:
    Start-Process -FilePath powershell_ise.exe -ArgumentList “C:\test\test1.ps1,C:\test\test2.ps1” -Verb RunAs

    Thank you very much for your support wullieb1, my problem is solved!


    wullieb1
    Moderator
    #614242

    Yep sorry i thought i had copied it verbose after testing it would definitely work but i obviously missed it.

    Glad it resolved your issue.

    dreivilo47
    dreivilo47
    Participant
    #614301

    No problem wullieb1, this happens sometimes.
    Thank you again.
    Have a nice day and weekend!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.