22
2
I'm trying to get a list of all the XSL and XSLT files in a directory.
dir -recurse -filter *.xsl,*.xslt -name
But the following error:
Get-ChildItem : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'Filter'. Specified method is not supported.
dir -recurse -filter *.xsl -filter *.xslt -name
But got this error:
Get-ChildItem : Cannot bind parameter because parameter 'Filter' is specified more than once. To provide multiple values to parameters that can accept multiple values, use the array syntax. For example, "-parameter value1,value2,value3".
Can I list both file extensions with a single command?
How to properly -filter multiple strings in a PowerShell copy script – KyleMit – 2016-11-28T16:13:52.143