Hi Everyone,
I'd like to know why the formatting for this powershell doesn't work ?
[PS] C:\>Get-MailboxStatistics | sort-object -descending totalItemSize | ft -autosize DisplayName, @{expression={$_.totalitemsize.value.ToMB()};label=”Mailbox Size(MB)”}, itemcount, lastlogontime | Sort-Object Itemcountout-lineoutput : Object of type "Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData" is not legal or not in the correct sequence. This is likely caused by a user-specified "format-*" command which is conflicting with the default formatting.
any pointer to correction would be greatly appreciated.
Thanks.
I think that there is problem due to location
Format-* must locate last pipeline , so
before formating, sort 2 property and then formating
Get-MailboxStatistics -database testdb1 | sort-object -property ` @{Expression="ItemCount";Descending=$true}, ` @{Expression="totalItemSize";Descending=$false} `| ft -autosize DisplayName, @{expression={$_.totalitemsize.value.ToMB()}; label="Mailbox Size(MB)"}, `itemcount, lastlogontime
ahh, IC
thanks for the correction man :-)