Powershell: Delete files based on extension?
The following powershell script searches in the specified folder ($folder) and filters for a file extension if parameter ($extension). The script will echo the filename and delete $folder = "C:\Users" $extension = "cmd" if (!($extension)){$filter="*"} Else{$filter=foreach ($item in $extension.split(",")){$item.insert(0,"*.")}} if (test-path $folder) { foreach ($file in get-childitem "$folder\*" -recurse -force...
