Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

Converting the FileSystemObject's DriveType Property

Windows PowerShell

Definition: Returns the drive type.


In VBScript, the DriveType returns an integer representing the type of drive (i.e., 1 represents a removable drive, 2 represents a fixed drive). In PowerShell you don’t need to worry about converting the integer to something readable. By using the .NET Framework, the DriveType property of the DriveInfo class will return a string containing the drive type.

$d = New-Object -typename System.IO.DriveInfo -argumentlist "C:"

Here’s the output from this code:


See conversions of other FileSystemObject methods and properties.
Return to the VBScript to Windows PowerShell home page

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft