PowerShell 7.3 - Unexpected Output when Filtering CSV Data with Select-String
I'm performance testing and This might be a silly question, but I'm trying to filter a CSV file using PowerShell 7.3 and `Select-String`, but I'm getting unexpected output that doesn't seem to match my search criteria..... My CSV file, `data.csv`, contains the following data: ```csv Name,Age,Location Alice,30,New York Bob,25,Los Angeles Charlie,35,Chicago ``` I want to find entries where the `Location` is `New York`. However, when I run the following command: ```powershell Import-Csv -Path 'data.csv' | Select-String -Pattern 'New York' ``` I receive the output indicating no matches found. I expected to see the line containing Alice's entry. I've also tried using the `Where-Object` cmdlet like this: ```powershell Import-Csv -Path 'data.csv' | Where-Object { $_.Location -eq 'New York' } ``` This command works fine and returns the correct entry. However, I'm wondering why `Select-String` did not work as expected. Is there a specific reason why `Select-String` might not be suitable for filtering CSV data in this manner, or am I using it incorrectly? Any insights or alternative approaches would be greatly appreciated! My development environment is Windows. I'm using Powershell stable in this project. I'm developing on Ubuntu 20.04 with Powershell. Cheers for any assistance! My development environment is Windows 10. Any suggestions would be helpful.