Hash table question

I’m confused on when I should be using a Name vs a Label key when constructing my hash tables. I don’t know the difference between the two.
I’m currently going through the Powershell in a Month of Lunches book by the way.


gsv | select name,status,@{name=‘CanShutDown’;e={$_.canshutdown}}


gsv | select name,status,@{label=‘CanShutDown’;e={$_.canshutdown}}

They may be interchangeable, but I typically use Name for Select-Object, and Label for the Format-* commands (because that’s how I learned them.)

In v1. Select-Object used Name and Format commands used Label. Nobody was clear on the difference - it came down to different developers not talking to one another. So in v2, they just made either work in any situation. There’s no functional difference.

I tend to use “n” for name because “l” for label is too easy to mistake for a digit 1.

Thank you for the clarification! I’ve been scratching my head on this one and asking around the office but no one seemed to know.