Why and how are these two $null values different?
问题 Apparently, in PowerShell (ver. 3) not all $null 's are the same: >function emptyArray() { @() } >$l_t = @() ; $l_t.Count 0 >$l_t1 = @(); $l_t1 -eq $null; $l_t1.count; $l_t1.gettype() 0 IsPublic IsSerial Name BaseType -------- -------- ---- -------- True True Object[] System.Array >$l_t += $l_t1; $l_t.Count 0 >$l_t += emptyArray; $l_t.Count 0 >$l_t2 = emptyArray; $l_t2 -eq $null; $l_t2.Count; $l_t2.gettype() True 0 You cannot call a method on a null-valued expression. At line:1 char:38 + $l