Import-Csv
Read a CSV file as objects
Import-Csv -Path .\people.csv
- Works on
- WindowsLinuxmacOS
- PowerShell
- 5.1 and later
- Reference
- Microsoft Learn: Import-Csv
Each row becomes an object. Column headers become property names. All values are strings until you cast them.
Try this
Import-Csv -Path .\people.csv | Where-Object City -eq 'Albany'