PowerTip: Create Custom PowerShell Objects


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

Comments (0)

Skip to main content