Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Converts the string output of Get-MailboxFolderStatistics into MB that can be sorted.Not the easiest to read but functional. Only needed when running the CmdLet remotely.
Get-MailboxFolderStatistics | Select-Object name, @{
[math]::Round(([regex]::matches($_.FolderSize,'\(([^\}]+)\)').value -replace 'bytes', '' -replace '\(', '' -replace '\)', '' -replace ',', '') / 1MB, 2)
} | Sort-Object FolderSize -Descending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.