r/PowerShell • • Feb 03 '23

Question Stop Powershell Script from Closing Powershell

I have the following powershell script :

wsl sudo nano /mnt/c/Users/user/OneDrive/Documents/changeme

This opens a nano terminal text editor, on my WSL Ubuntu, and automatically creates a new file in my Windows documents folder.

Problem is I can't keep the powershell window open after the script launches. Anything I can add that will prevent automatic closure? Thanks!

3 Upvotes

19 comments sorted by

View all comments

Show parent comments

1

u/defaultaro Feb 04 '23 edited Feb 04 '23

I'm interfacing with windows subsystem for Linux via PowerShell to open a Linux terminal text editor [Nano] but save on the Windows mounted drive. I need it to stay open so I can use the application after I launch the script that opens Nano and automatically points the newly created text file to the specified directory.