I am trying to filter CSV files. But the following script is giving an error. How do I specify that I want to run match on each String object?
I tried various combinations, but without result.
$FileNames = [System.IO.Directory]::GetFiles("C:\Users\anagre\Desktop")
$FileNames = $FileNames | Where { -match "*.csv"}