Was this page helpful?
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 AvailableSpace Property

Windows PowerShell

Definition: The amount of space available on the specified drive or share.


Available drive space is just one of the properties you can retrieve from the DriveInfo .NET Framework object. Use the New-Object cmdlet to retrieve a reference to the object, passing the drive letter as the argument. Once you have a reference to the DriveInfo object, you can check the AvailableFreeSpace property.

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

Note that this does not work with network shares (i.e., \\atl-fs-01\scripts), it works only with mapped drives letters.

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