Summary: Use Windows PowerShell to get a row from a CSV file based on a specific value.
How can I use Windows PowerShell 4.0 to look up a specific row from a CSV file I imported into a variable?
Use the Where method, and use a match pattern to search on a specific column and value, for example:
$topics = import-csv -Path C:\lit\Shakespeare.txt
$topics.Where({$PSItem.play -eq 'hamlet'}).topic
0 comments