Quantcast
Channel: ONTAP Discussions topics
Viewing all articles
Browse latest Browse all 4960

How to Get Top 10 Consumers Via Get-NcQuotaReport

$
0
0

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: (Smiley Happy [out-lineoutput], InvalidOperat
ionException
+ FullyQualifiedErrorId : ConsoleLineOutputOutOfSequencePacket,Microsoft.P
owerShell.Commands.OutLineOutputCommand


Viewing all articles
Browse latest Browse all 4960

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>