PowerShell Scripts, Tips, Expert Advices, Forums, and Resources

Geek Sync Live

Welcome to PowerShell.com, the educational and community site for Windows PowerShell People. Get a quick overview.


As a Powershell.com member you will have access to:

  • Daily PowerShell tips written by Microsoft MVPs and other leading Windows PowerShell experts
  • Free Windows PowerShell advice and training provided by Microsoft MVPs and other leading Windows PowerShell experts
  • Access to leading Windows PowerShell blogs
  • A free ebook, Mastering PowerShell, written by Microsoft MVP Dr. Tobias Weltner
PowerTip of the Day

Mapping Network Drives (Part 2)

Beginning with PowerShell 3.0, you can use New-PSDrive to map network drives. They will be visible in File Explorer as well. Here is some sample code:

#requires -Version 3

New-PSDrive -Name N -PSProvider FileSystem -Root '\\dc-01\somefolder' -Persist 

Test-Path -Path N:\
explorer.exe N:\
Get-PSDrive -Name N

Remove-PSDrive -Name N -Force

If you’d like to provide logon credentials, add the –Credential parameter to New-PSDrive, and submit a username in the format domain\username. The password will be securely prompted.

Twitter This Tip! ReTweet this Tip!

Copyright 2012 PowerShell.com. All rights reserved.