Issue
When assigning a (placeholder) hashtable to another variable and then resetting said hashtable, it also resets the value assigned to the variable.
Questions
- Why is it happening?
- How can I prevent that?
- Why does it only seem to be working this way for that specific example, but not if
$a
is a simple integer?
MWE
$a = @{test=$true}
$b = $a
$b
$a.Clear()
$b
Output
Name Value
---- -----
test True
The second call does not output anything as $b
is now considered as empty.