Skip to content

Instantly share code, notes, and snippets.

@ninmonkey
Last active November 18, 2021 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ninmonkey/ab5de63530a9f127e9e7784e8e6f3cc7 to your computer and use it in GitHub Desktop.
Save ninmonkey/ab5de63530a9f127e9e7784e8e6f3cc7 to your computer and use it in GitHub Desktop.
does order matter?
h1 'p ordered'
$p_o = [pscustomobject][ordered]@{
'f' = 93
'z' = 20
'q' = 4
}
h1 '$o'
$p_o
h1 '$o | ft'
$p_o | Format-Table
h1 '$h_no'
$h_no = @{
'f' = 93
'z' = 20
'q' = 4
}
$p_no = [pscustomobject]$h_no
$2stage_h_o = [ordered]@{
'f' = 93
'z' = 20
'q' = 4
}
$2stage_p_o = [pscustomobject]$2stage_h_o
label '$p_o' '= [pscustomobject][ordred]@{}'
$p_o | Format-Table
Out-Default
label '$p_no' '$h = @{}; $p = [pscustomobject]$h'
$p_no | Format-Table
label '$p_o_2step' '$h = [ordered]@{}; $p = [pscustomobject]$h'
$2stage_p_o | Format-Table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment