Public/Remove-Folder.ps1
# Remove-Folder C:\src\Beispiele @("node_modules", "npm-cache") function Remove-Folder { Param( [string]$Path = $pwd, [Parameter(Mandatory = $true)] [string[]]$Names ) foreach ($item in Get-ChildItem $path) { if ($item -is [System.IO.DirectoryInfo]) { $curDir = Join-Path $path $item if ($names | Where-Object { $item.Name -eq $_ }) { Remove-Item –path $curDir -Recurse -Force Write-Host "$curDir" } else { #Write-Host "DeleteFolder $curDir" DeleteFolder $curDir $names } } } } |