How to Map Network Drives Using PowerShell

Published July 8, 2017 by .

In years past, automatic map network drives required the use of primitive batch files, luckily for us you can now do it through PowerShell.

How to Map Network Drives Using PowerShell

Prior to the PowerShell era, we could map networks drives using a batch file that contained a net use command:

dos
net use M: \\nasserver\Share /Persistent:Yes

To do it in PowerShell, open up your favourite terminal application and enter the following command to map network drives.

powershell
New-PSDrive -Name "M" -PSProvider FileSystem -Root "\\nasserver\share" -Persist
Comments

My website and its content are free to use without the clutter of adverts, tracking cookies, marketing messages or anything else like that. If you enjoyed reading this article, or it helped you in some way, all I ask in return is you leave a comment below or share this page with your friends. Thank you.

There are no comments yet. Why not get the discussion started?

We respect your privacy, and will not make your email public. Hashed email address may be checked against Gravatar service to retrieve avatars. This site uses Akismet to reduce spam. Learn how your comment data is processed.