1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
$path = Read-Host "Pfad" if(!(Test-Path $path)){ Write-Host "Pfad $path unbekannt" }else{ if((Read-Host "Unterverzeichnisse in $path bereinigen (J/N)?") -eq "J"){ foreach($folder in (Get-ChildItem $path -Directory)){ foreach($file in (Get-ChildItem $folder.FullName)) { Remove-Item $file.FullName } } }else{ Write-Host "Skript wird abgebrochen" } }
You can clone a snippet to your computer for local editing. Learn more.