I want to use the Totalitemsize as an iteger for charts So I need to convert the xxxxxB to xxxxx (does not matter if it is in bytes, Kb, MB,.. as long as it is a number)
What does work but then it is not a number:
Get-MailboxStatistics -database 'ETRO2' | ft DisplayName,TotalItemSize,ItemCount
What does not work (result is just a blank in the formatte list):
Get-MailboxStatistics -database 'ETRO2' | Format-Table DisplayName,DatabaseName, TotalItemSize.value.ToMB
or
Get-MailboxStatistics -database 'ETRO2' | ft DisplayName,@{ expression={$_.TotalItemSize.Value.ToKB()}},ItemCount
or
Get-MailboxStatistics -database 'ETRO2' | ForEach { New-Object psobject | Add-Member -Passthru NoteProperty Displayname $_.Displayname | Add-Member -Passthru NoteProperty TotalItemSize $_.TotalItemSize.Value.ToKB() }