I have a list of hashmaps. I want to create comma separated string for each item. If I use the following, it works fine.
$users | ForEach-Object {$_.firstname + "," + $_.surname}
But when I try to do it with string interpolation like this,
$users | ForEach-Object {"$_.firstname,$_.surname"}
It shows
System.Collections.Hashtable.firstname,System.Collections.Hashtable.surname
What mistake am I doing?