How to check drive is it a virtual (created using subst command)?
Get-VirtualDisk doesn't work(powershell 3.0)
How to check drive is it a virtual (created using subst command)?
Get-VirtualDisk doesn't work(powershell 3.0)
On
subst doesn't create a virtual disk, so Get-VirtualDisk won't return those drives.
You may be able to use Get-PSDrive and look for drives where the Description property matches the Description property of another drive. For example, on my system I have substed Q pointing to a path on my C drive:
>get-psdrive |where-object {$_.provider -like "*filesystem"}|select name,description|ft -auto
Name Description
---- -----------
C OSDisk
D
E
P
Q OSDisk
U
You could extract the first character from each line of
substoutput into an array and check if a particular drive is contained in that array: