I have a command that formats its output as CSV. I have a list of machines that this command will work against using a foreach loop. in the example below, $ serverlist is automatically created using AD Query.
foreach ($server in $serverlist) { $outputlist = mycommand }
what I would like to do somehow ends up with objects from the resulting CSV, so I can only select specific objects for the report. However, the only way I can do this is to use import-csv, which seems to only want to work with files, not variables: ie.
Import-Csv output.csv | ft "HostName","TaskName" | Where-object {$_.TaskName -eq 'Blah'}
I would like to have an import-csv $ list instead. this causes import-csv to have a synonym :)
Can someone point me in the right direction how to do this?
Greetings
source share