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

前端 未结 6 1123
忘掉有多难
忘掉有多难 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:47

    Take this a step further as shown below:

    ([System.IO.DriveInfo]("C")).Drivetype
    

    Note this only works for the the local system. Use WMI for remote computers.

提交回复
热议问题