Can anybody explain the details? If I create an object using
$var = [PSObject]@{a=1;b=2;c=3}
and then I look for its type using getTy
Say I want to create a folder. If I use a PSObject you can tell it is wrong by looking at it
PS > [PSObject] @{Path='foo'; Type='directory'}
Name Value
---- -----
Path foo
Type directory
However the PSCustomObject looks correct
PS > [PSCustomObject] @{Path='foo'; Type='directory'}
Path Type
---- ----
foo directory
I can then pipe the object
[PSCustomObject] @{Path='foo'; Type='directory'} | New-Item