none
Run .Ps1 file from exchange management shell into a new powershell window

    Question

  • I am writing a tool where it needs to run a .ps1 file that shows the progress of a server reboot until the server is back up. 

    what i want is when you select to run the .ps1 file, it opens a new powershell session and run it there and when done the popup powershell windows closes. 

    I thought 'Start-Process PowerShell' should work but it does not 

    any suggestions what am i missing here. .ps1 file has two parameters too

    Friday, February 09, 2018 9:01 PM

Answers

  • start-process powershell -ArgumentList 'd:\scripts\test.ps1',123,345


    \_(ツ)_/


    • Edited by jrvModerator Friday, February 09, 2018 9:16 PM
    • Marked as answer by Riaz Ansary Friday, February 09, 2018 9:26 PM
    Friday, February 09, 2018 9:15 PM
    Moderator

All replies

  • Try Invoke-command powershell -ArgumentList „-file PS1file”

    Best Regards,
    Łukasz Antoniak


    Please do take a moment to "Vote as Helpful" and/or "Mark as Answer", wherever applicable. Thanks!

    Friday, February 09, 2018 9:05 PM
  • start-process powershell -ArgumentList 'd:\scripts\test.ps1',123,345


    \_(ツ)_/


    • Edited by jrvModerator Friday, February 09, 2018 9:16 PM
    • Marked as answer by Riaz Ansary Friday, February 09, 2018 9:26 PM
    Friday, February 09, 2018 9:15 PM
    Moderator
  • Thanks a lot JRV. I was putting the parameters inside the ""
    Friday, February 09, 2018 9:27 PM