Forum Discussion

Boe Dillard's avatar
Boe Dillard
Iron Contributor
May 24, 2020

Please help change my output to GB units only.

My goal is to find the mailbox folder and subfolder sizes of a mailbox    This command works (but the units are kb, mb& gb - my goal is only gb)   Set-ExecutionPolicy RemoteSigned $UserCredentia...
  • VasilMichev's avatar
    May 24, 2020

    Remove .Value, you don't need it as the data is already returned as string. And you want to use Name instead of DisplayName

     

    Get-MailboxFolderStatistics bob@domain.com | select-object Name, @{name="FolderSize (GB)";expression={[math]::Round((($_.FolderSize).Split("(")[1].Split(" ")[0].Replace(",","")/1GB),2)}} | export-csv c:\bob.csv  

Resources