Continuing from my comment.
For example:
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:
Get-PSDrive -PSProvider FileSystem |
Where-Object DisplayRoot -like '\\*'
# Results
<#
Name Used (GB) Free (GB) Provider Root CurrentLocation
---- --------- --------- -------- ---- ---------------
Z 11076,55 0,00 FileSystem \\192.168.2.107\docs
#>
One nice touch is that Get-PSDrive returns useful additional details such as
the size of the drive.
solved Get a list of network folders and the path to them [closed]