Microsoft Virtualization Discussions

equivalent to running df -hr

SKIP_HOFMANN
3,974 Views

hello all

whats the equivalent command in powershell toolkit for the "DF -HR" command

2 REPLIES 2

cscott
3,974 Views

I think what you are looking for is going to be get-navolsize.  However if you wish to manipulate the data once you have it, that is more complicated.

-Scott

edit: This appears to be dependent on the version of the toolkit.  On one laptop I cannot use get-navolsize because of the human readable out, on my current laptop I am getting the raw size output.

Message was edited by: Scott Chubb

bsti
3,974 Views

You actually need more than two commands to get all of the info you are looking for:

Get-NaVol will return the volume size and most properties about it.  Get-NaVolsize works too, and is more specific.

Get-NaSnapshotReserve gets the reserve amount.

To get the closest output to DF -HR, try this:

Get-NaVol | FT -autosize Name,@{ "l" = "SizeGB"; "e" = { "{0:#,##0}" -f ($_.SizeTotal / 1gb) } },@{ "l" = "SizeUsedGB"; "e" = { "{0:#,##0}" -f ($_.SizeUsed / 1gb) } },@{ "l" = "SizeAvailGB"; "e" = { "{0:#,##0}" -f ($_.SizeAvailable / 1gb) } },@{ "l" = "SizeReservedGB"; "e" = { "{0:#,##0}" -f (($_ | Get-NaSnapshotReserve).Size / 1gb) } }

Public