ONTAP Discussions

How to Get Top 10 Consumers Via Get-NcQuotaReport


We would like to create a report that gives us the top X consumers of storage space on our volumes.  We can get a list of the users and their space used via Get-NcQuotaReport | select QuotaUsers,DiskUsed.  However, the number in the DiskUsed field is left aligned so it does not sort well. We can use a Format-Table to right-align the numbers, but we get an error if we try and sort after the formatting is done. How can we get the disk used right-aligned so we can sort on it?


function Get-Usage{

Get-NcQuotaReport | select QuotaUsers,DiskUsed | format-table QuotaUsers,@{n='Bytes';e={$_.DiskUsed};align='right'}

Get-Usage | Sort-Object -Property Bytes


out-lineoutput : The object of type

"Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData" is not valid
or not in the correct sequence. This is likely caused by a user-specified
"format-*" command which is conflicting with the default formatting.
+ CategoryInfo : InvalidData: (:) [out-lineoutput], InvalidOperat
+ FullyQualifiedErrorId : ConsoleLineOutputOutOfSequencePacket,Microsoft.P


Re: How to Get Top 10 Consumers Via Get-NcQuotaReport




why do you don't do the sort before the format table ?



Gidi Marcus (Linkedin) - Storage and Microsoft technologies consultant - Hydro IT LTD - UK

View solution in original post

Earn Rewards for Your Review!
GPI Review Banner
All Community Forums