I'm trying to do something simple - sorry for the sloppiness:
$arr1 = Import-Csv c:\arr1.csv
$arr2 = Import-Csv c:\arr2.csv
ForEach($record in $arr1){
$test = $arr2.Where({$PSItem.User -eq $record.User}).Value
}
But when I do this, I get a method invocation failed because [System.Management.Automation.PSCustomObject] does not contain a method named 'where'.
However, it worked once and if I do $randomcsv = Import-Csv c:\random.csv and then type in $randomcsv, the Where method is available.
Is there a reason why sometimes this works and sometimes it doesn't? It's very strange to me.
Thanks in advance!
WB