I've got a bunch of files in the following format:
00092-100221-01M-V-3-20-001 Building A, plan 1M Piping
I'd like to rename only the files containing both the words "Building A" and "Piping" I've tried the following code
dir -filter "*Building A*", "*Piping*" | Rename-Item -NewName {$_.basename + " As built" + $_.extension}
but I get an error stating that the parameter -filter does not support this method. Is there a way I can filter for 2 conditions in Powershell?