Author Posts

April 11, 2015 at 6:51 am

Hello

I am working with a Csv master list. After gathering data and exporting it to a "working set "csv list Id like to update my master list by matching computer names and update my 'online' field

any help would d be greatly appreciated.

heres what I have so far

$master = "C:\MasterList.csv"
$working = "C:\workingset.csv"

$masterlist = ipcsv $master
$workingset = ipcsv $working



 $Output = foreach ($m in $masterlist) {
    foreach ($w in $workingset) {
        if ($m.computername -like "*$($w.computername)*") { $m.online = $w.online }
   
    }
    $i
}
$Output | Export-Csv $CsvFile -NoTypeInformation

April 11, 2015 at 7:07 am

I solved the issue I needed to remove $output and add

$masterlist | Export-Csv $master -NoTypeInformation