How to show currently mapped drives in PowerShell

.net frameworkccommand linemapped-drivepowershell

Need a PowerShell command to display drive letter and path it is mapped to.

In other words a command that shows me the same thing Windows Explorer would.

Tried this:

Get-WmiObject -Class Win32_MappedLogicalDisk | select Name, ProviderName

and it is missing several drives (listed in Windows Explorer).

Best Answer

In PowerShell 5 (Windows 10) and above, use:

Get-SMBMapping

https://docs.microsoft.com/en-us/powershell/module/smbshare/get-smbmapping?view=win10-ps

Related Question