$ErrorActionPreference = "Stop" $limitBytes = 100MB $large = Get-ChildItem -Recurse -File | Where-Object { $_.FullName -notmatch "\\.git\\" -and $_.Length -gt $limitBytes } if ($large) { $large | ForEach-Object { Write-Host ("LARGE-FILE: {0} {1:N0} bytes" -f $_.FullName, $_.Length) } Write-Host "WARN: files over 100MB found; document the handling strategy." } else { Write-Host "PASS: no files over 100MB found." }