Created
August 18, 2017 10:21
-
-
Save bentaylorwork/25d68b9e90c20c52080445a3af1d4b94 to your computer and use it in GitHub Desktop.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-MailboxFolderStatistics [email protected] | Select-Object name, @{ | |
Name="FolderSize"; | |
Expression={ | |
[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