PowerTip: Create Custom PowerShell Objects

Doctor Scripto

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


Discussion is closed.

Feedback usabilla icon