Listing Network Drives

by Aug 11, 2021

There are many ways to list mapped network drives. One of them uses PowerShell’s Get-PSDrive and checks to see whether the target root starts with “\\”, indicating a UNC network path:

PS> Get-PSDrive -PSProvider FileSystem | Where-Object DisplayRoot -like '\\*'

Name           Used (GB)     Free (GB) Provider      Root                    CurrentLocation
----           ---------     --------- --------      ----                    ---------------
Z               11076,55          0,00 FileSystem    \\\docs  

One nice touch is that Get-PSDrive returns useful additional details such as the size of the drive.

Twitter This Tip! ReTweet this Tip!