Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Deleting files of different extension type

$
0
0

Hi All.

I have the script below.

get-childitem "D:\files" -recurse -force -include *.dat *.avi | remove-item -force 

The above doesnt work on .dat and .avi file types

I would like to convert it to a function/Ps file whereby it takes 2 parameters, path and also the extension file types i.e .dat or .avi or .doc etc .

Thanks in advance.


Viewing all articles
Browse latest Browse all 21975

Trending Articles