Get-ChildItem in PowerShell 7.3 not returning expected file types when using -Include
I'm deploying to production and I'm running into a question with the `Get-ChildItem` cmdlet in PowerShell 7.3..... I want to list all `.txt` and `.log` files in a specific directory, but when I use the `-Include` parameter along with `-Recurse`, it seems to only return `.txt` files and ignores the `.log` files. Here's the command I'm using: ```powershell Get-ChildItem -Path 'C:\Logs' -Include '*.txt', '*.log' -Recurse ``` This command returns a list of `.txt` files, but no `.log` files are shown, even though I know there are `.log` files present in the subdirectories. I've tried running the command without the `-Recurse` switch, and it lists both file types correctly, which makes me think the scenario is related to how `-Include` interacts with `-Recurse`. I've also considered using a different approach by combining `Where-Object`, but I want to understand why `-Include` isn't working as expected. Hereβs what I attempted: ```powershell Get-ChildItem -Path 'C:\Logs' -Recurse | Where-Object { $_.Extension -eq '.txt' -or $_.Extension -eq '.log' } ``` This works, but the performance is noticeably slower, especially when dealing with a large number of files. I'm hoping to find a more efficient way to retrieve both file types using the `-Include` parameter without compromising performance. Any insights on this behavior or suggestions on how to resolve this? How would you solve this? Cheers for any assistance!