Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

Converting the FileSystemObject's FreeSpace Property


Windows PowerShell


Definition: The amount of free disk space on a given drive.

FreeSpace


See AvailableSpace. To retrieve the amount of free space on a drive, we use the New-Object cmdlet to create a DriveInfo object referencing - in this example - the C: drive. We then simply check the AvailableFreeSpace property.


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


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:
© 2015 Microsoft