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

Converting the FileSystemObject's TotalSize Property


Windows PowerShell


Definition: Returns the total size of a drive or network share.

TotalSize


Retrieve an object reference to the .NET Framework object DriveInfo for the drive you want to work with. You can then use the DriveInfo TotalSize property to retrieve the total size of the drive.


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


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

Show:
© 2016 Microsoft