Output at the same time on the one line, some properties of the two objects

I have two objects, both have a  same property -"Name" .

 $GenItems1 = gwmi Win32_ComputerSystem -Comp $StrComputer

 $GenItems2 = gwmi Win32_OperatingSystem -Comp $strComputer

How can I output at the same time on the one line, some properties of the two objects ?
nesher13Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

footechCommented:
You just need to build an object with custom properties.
Here's a couple methods.
"" | Select @{N="Computer";E={$GenItems1.Name}},@{N="OS";E={$GenItems2.Name}}
#or
New-Object PSObject -property @{ Computer = $GenItems1.Name; OS = $GenItems2.Name}

Open in new window

0
nesher13Author Commented:
Hi footech,

which means " in the pipeline
0
footechCommented:
I assume you're asking about the first method.  There we're sending an empty object through the pipeline to Select-Object which we use to create calculated properties (i.e. the property is not chosen from the properties associated with the object sent to Select-Object, but rather is calculated based on other information).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Legacy OS

From novice to tech pro — start learning today.