PowerShell:
Код:
$sPath = "\\file_system\dir"
if(Test-Path -Path $sPath) {
Get-ChildItem -Path $sPath -Recurse |`
ForEach-Object -Process {
if(!$_.PSIsContainer) {
if($_.Length -lt 50KB) {
Remove-Item $_.FullName -WhatIf
}
}
}
} else {
Write-Host -ForegroundColor Red "Can't find path [$sPath]"
}