Powershell mapped network drive doesn't persist
- by Davidw
I'm trying to create a script that maps a network drive whenever I connect to a VPN, then disconnects the drive when I disconnect from the VPN, using Task Scheduler to launch the script when the event is created.
It launches the script, which creates the drive, but when Powershell closes, it disconnects the drive, so it only stays open for a few…