I have a back file that is written weekly. I need to retrieve the data and calculate how many terabytes are being written. this is what i have so far. the only part i cant get to work is the division of the bytes to terabytes.i am sending this to another text so that it can be reviewed later as an archive. any ideas?
$date = Get-Date -UFormat "%y.%m.%d"
$res = @()
gc \\servername\d$\mediawritten\media*.txt | Select-String kilobytes | Out-File -FilePath c:\txt\tempresults.txt
$a = Get-Content C:\txt\tempresults.txt
gc c:\txt\tempresults.txt |%{$_.split(':')Ώ]} | measure-object -sum |? {$res += $_}
$res | select Sum |% {$_.Sum #this is where i have attempted to div# }| Out-File -FilePath \\servername\d$\MediaWritten\Total\$date.MediaWrittenSum.txt
|