Converting the FileSystemObject's FileSystem Property

Definition: Returns the type of file system of the given drive, such as FAT or NTFS.


Use the DriveFormat property of the .NET Framework DriveInfo object:

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

Here we called the New-Object cmdlet to create a DriveInfo oject, passing New-Object the -typename (the class) and the -argumentlist (in this case, the drive we want to retrieve information on). We then check the DriveFormat property on the object we just created.

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