Export (0) Print
Expand All
Expand Minimize

Converting the FileSystemObject's AvailableSpace Property


Windows PowerShell


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

AvailableSpace


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:"
$d.AvailableFreeSpace


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
Show:
© 2014 Microsoft