How it works...
If you ran Get-Command select, you would have understood by now that select is in fact an alias for Select-Object. As already established, PowerShell outputs objects. These objects are then formatted using built-in formatting rules that are shown on the screen in a certain way.
When we use Select-Object, we override the formatting rules by specifying which objects need to be shown to us. While the primary objective of Select-Object is to pick the columns we need, the cmdlet also allows us to sequence the output columns.
PowerShell also gives us the freedom to modify the name of the columns that are returned. In such a case, we use a hashtable to specify the name that we want, and what data we want shown under the column. You ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access