The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

mjolinor (5) [Avatar] Offline
#1
Hi Jeff! This is forum is entirely too empty, so I'm going to start the party.

On page 94 you have this:

You might also notice at this point that the output from our script doesn’t list the
properties in the same order that we defined them. That’s okay – PowerShell kind of puts things in whatever order it wants.


In V3, they gave us a type accelerator ([ordered]) for ordered hash tables. If you're going to cover that in Chapter 16 (and I think you should), I think you need to change that to explain it's the hash table that's doing that, and you can use an ordered hash table to avoid it.
Jeffery Hicks (22) [Avatar] Offline
#2
Re: Explanation of property ordering
We do mention [ordered] elsewhere. In example you cite we're still accurate. PowerShell sees a "normal" hash table and does its own thing which means items can be in any order. In v2 a solution was to either pipe the hash table to Select-Object and put the properties in the order you want, or turn to custom type/format extensions. PowerShell 3 with [ordered] makes life much easier.

Thanks for your support.
don.jones (21) [Avatar] Offline
#3
Re: Explanation of property ordering
BTW, keep in mind that page numbers do us no good - we're still working in Word docs, one doc per chapter smilie. The more you can point us to chapters and section numbers, the easier we can find this stuff!

Good tip on [ordered], too - will make sure that gets in there.