Hi Matt
Lucs FriendlyUnits function works great. I have one dilemma though. I can't seem to get it to work with the Get-View cmdlet:
Code:
Get-Datastore -Name DS1 |
Select Name,
@{N="Capacity";E={Get-FriendlyUnit -Value ($_.CapacityMB * 1MB) |
%{"{0,7:f2} {1,2}" -f $_.Value,$_.Unit}}},
@{N="FreeSpace";E={Get-FriendlyUnit -Value ($_.FreeSpaceMB * 1MB)
|
%{"{0,7:f2} {1,2}" -f $_.Value,$_.Unit}}},
@{N="ProvisionedSpace";E={Get-FriendlyUnit -Value
($_.ExtensionData.Summary.Capacity -
$_.ExtensionData.Summary.FreeSpace +
$_.ExtensionData.Summary.Uncommitted/1GB,0) |
%{"{0,7:f2} {1,2}" -f $_.Value,$_.Unit}}}
Maybe I'm not using the function properly with Get-View? Is there a way to get the Provisioned space other than using Get-View?
Thanks