In PowerShell, how can I determine if the current drive is a networked drive or not?

前端 未结 6 1130
忘掉有多难
忘掉有多难 2020-12-19 06:08

I need to know, from within Powershell, if the current drive is a mapped drive or not.

Unfortunately, Get-PSDrive is not working \"as expected\":

PS:         


        
6条回答
  •  南笙
    南笙 (楼主)
    2020-12-19 06:51

    Try WMI:

    Get-WMI -query "Select ProviderName From Win32_LogicalDisk Where DeviceID='H:'"
    

提交回复
热议问题