PowerShell drives me nuts (I hope I missing something here).
Consider following code:
$var = $True
$foo = if ($var) {@(, 1)}
$foo # 1
$foo.GetType().FullName #System.Int32
$foo = @(, 1)
$foo # 1
$foo.GetTYpe().FullName #System.Object[]
Clearly that behavior should be the same. Right? But not exactly. Here is an output:
1
System.Int32
1
System.Object[]
I would say that this is a bug, not a trap!
PowerShell drives me nuts (I hope I missing something here).
Consider following code:
Clearly that behavior should be the same. Right? But not exactly. Here is an output:
I would say that this is a bug, not a trap!