I\'m currently running a PowerShell (v3.0) script, one step of which is to retrieve all the HTML files in a directory. That works great:
$srcfiles = Get-ChildItem
-Filter
is not the right way. Use the -exclude
parameter instead:
$srcfiles = Get-ChildItem $srcPath -exclude *.htm*
-exclude
accepts a string[]
type as an input. In that way you can exclude more than one extension/file type as follows:
$srcfiles = Get-ChildItem $srcPath -exclude *.htm*,*.css,*.doc*,*.xls*
..And so on.