Here is my code:
$problems = New-Object System.Collections.ArrayList
$problemObj = New-Object psobject -Property @{
problemName = "abc"
problemDescription = $null
}
$problemObj.problemDescription = "def"
$problems.Add($problemObj)
$problemObj.problemDescription = "ghi"
$problems.Add($problemObj)
$problems
And here is the output:
problemName problemDescription
----------- ------------------
abc ghi
abc ghi
I don't get what's wrong and why the first member gets modified. Any idea?
Thanks,