September 5th, 2013

PowerTip: Customize Table Headings with PowerShell

Doctor Scripto
Scripter

Summary: Learn how to create a custom table heading by using Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to display a table if the default property name is confusing?

Hey, Scripting Guy! Answer Use a hash table to customize the table properties. The elements of the hash table are Label and Expression (or alias’ L and E).

          In this example, I rename the ProcessName property to Name:

get-process | Format-Table @{L=’name’;E={$_.processname}}, id

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.