Converting the Windows Script Host RemoveNetworkDrive Method
Definition: Removes a shared network drive from your computer system.
Neither Windows PowerShell nor the .NET Framework includes a mechanism for removing a mapped network drive from your computer. Fortunately, though, the command-line utility Net.exe does provide a way for you to remove a mapped network drive from your computer. Want to get rid of drive Z? Then just call Net.exe, using the following syntax:
net use z: /delete