0

How I can I start a powershell session from a batch file so that it starts the Powershell command line (and imports some modules and then) stays open instead being closed once the commands are run in the bat. So that I can continue to work on the PS Shell command line with the modules imported.

Thanks

1 Answer 1

1

You could try this.

-noexit will stop powershell for terminating.

start powershell.exe -noexit
Sign up to request clarification or add additional context in comments.

2 Comments

And can I run it by also providing a powershell script file?
yes it should work fine. start powershell.exe -noexit -file <script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.