Question: Why this code doesn’t display files with extensions (*docx, *.txt, *.pdf, *.xlsx ) in the folder (and subfolders)?
Not working
Working
Answer :
1 2 3 4 5 6 |
# Answer: Get-ChildItem -Path 'C:\demo' -Include @('*.docx', '*.txt', '*.pdf', '*.xlsx') -Recurse # Explanation: -Filter : only accepts a single string. -Include : accepts an array. |