none
Bytestransferred to GB RRS feed

  • Question

  • Hi All,

    I have a script that shows me the bytestransferred and the bytestransferredperminute in a form but it also shows the bytes in brackets.

    How can I get rid of the bytes portion?

    I have tried:-

    $outputbox.text = get-moverequest| get-moverequeststatistics |Sort-Object PercentComplete -Descending | ft displayname, @{label=" % "; expression="percentcomplete"}, statusdetail, @{label=" moved "; expression={S_.bytestransferred.value.toGB}},@{label=" Rate"; expression={$_.bytestransferredperminute.value.toGB}} -AutoSize | Out-String

    This didn't give me any value in the 2 columns (Rate & Moved)

    What am I doing wrong?

    TIA

    Andy


    • Edited by UKMorite Tuesday, June 10, 2014 8:14 AM
    Tuesday, June 10, 2014 8:06 AM

Answers

  • I managed to resolve the issue:-

    $outputbox.text = get-moverequest| get-moverequeststatistics |Sort-Object PercentComplete -Descending | ft displayname, @{label=" % "; expression="percentcomplete"},@{l="Size";e={$_.Totalmailboxsize.ToString().SubString(0,($_.totalmailboxsize.ToString().IndexOf("MB")))}} ,@{l="Moved";e={$_.BytesTransferred.ToString().SubString(0,($_.BytesTransferred.ToString().IndexOf("MB")))}},@{l="Rate";e={$_.BytesTransferredPerMinute.ToString().SubString(0,($_.BytesTransferredPerMinute.ToString().IndexOf("MB")))}}  ,statusdetail  -AutoSize| Out-String

    Thanks

    Andy

    • Marked as answer by UKMorite Tuesday, June 10, 2014 11:56 AM
    Tuesday, June 10, 2014 10:58 AM

All replies

  • Are you running this in an EMS shell, or from an implicit remoting session?

    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

    Tuesday, June 10, 2014 10:22 AM
    Moderator
  • I managed to resolve the issue:-

    $outputbox.text = get-moverequest| get-moverequeststatistics |Sort-Object PercentComplete -Descending | ft displayname, @{label=" % "; expression="percentcomplete"},@{l="Size";e={$_.Totalmailboxsize.ToString().SubString(0,($_.totalmailboxsize.ToString().IndexOf("MB")))}} ,@{l="Moved";e={$_.BytesTransferred.ToString().SubString(0,($_.BytesTransferred.ToString().IndexOf("MB")))}},@{l="Rate";e={$_.BytesTransferredPerMinute.ToString().SubString(0,($_.BytesTransferredPerMinute.ToString().IndexOf("MB")))}}  ,statusdetail  -AutoSize| Out-String

    Thanks

    Andy

    • Marked as answer by UKMorite Tuesday, June 10, 2014 11:56 AM
    Tuesday, June 10, 2014 10:58 AM
  • $_.bytestransferredperminute.value.ToGB()

    You need parens on this it is a method. ToGB()


    ¯\_(ツ)_/¯

    Tuesday, June 10, 2014 11:48 AM