Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (8 sloc) 344 Bytes
#sum of most recent full backup files
$srvs = @("server1","server2","server3")
foreach ($srv in $srvs){
$path = "D:\backups\$($srv)"
$x = gci -path $path -Recurse | where-object {($_.extension -eq ".bak") -and ($_.lastWriteTime -gt (get-date).AddDays(-1))}
[long]$amt +=($x | measure-object -sum length).sum | out-string
}
$amt
You can’t perform that action at this time.