December 18th, 2014

PowerTip: Create Custom PowerShell Objects

Doctor Scripto
Scripter

Summary: Learn about the easiest way to create a custom Windows PowerShell object.

Hey, Scripting Guy! Question How can I easily create a custom object that contains only a few of the existing properties of a
           Windows PowerShell cmdlet?

Hey, Scripting Guy! Answer Use the Select-Object cmdlet in the pipeline and choose the properties you want to add to the object:

Get-Process | Select-Object name, 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.