Hey, i got the following script for my homework in my school and dont understand it. Anything will help. :
$colItems = (Get-ChildItem $strDirectory -recurse | Measure-Object -property length -sum) $size = $colItems.sum / 1MB
if( $size -le $numLimitMB ) { $succ = “SUCCESS: Directory size = ” + $size + ” MB, maximum allowed = ” + $numLimitMB + ” MB DATA:” + $numLimitMB echo $succ } else { $err = “ERROR: Directory size = ” + $size + ” MB maximum allowed = ” + $numLimitMB + ” MB DATA:” + $numLimitMB echo $err }
submitted by /u/aydragon
[link] [comments]
The post Need help understanding this script. appeared first on How to Code .NET.