Closed spex3141 closed 2 years ago
2 Problems: If transfered value does not match pattern in if clause it uses the value from the job before If transfered value is above 2GByte int value is to large for int
I use: if ($o365JobLastSession.Statistics.TransferredData -match '\d+(.\d+)? [A-Z]B') { $transferred = [math]::Round($(Invoke-Expression -Command ($o365JobLastSession.Statistics.TransferredData -replace ' '))) } else { $transferred=0 }
2 Problems: If transfered value does not match pattern in if clause it uses the value from the job before If transfered value is above 2GByte int value is to large for int
I use: if ($o365JobLastSession.Statistics.TransferredData -match '\d+(.\d+)? [A-Z]B') { $transferred = [math]::Round($(Invoke-Expression -Command ($o365JobLastSession.Statistics.TransferredData -replace ' '))) } else { $transferred=0 }