Y
Y
yegotojave2016-01-31 01:36:04
PowerShell
yegotojave, 2016-01-31 01:36:04

How to display two variables in one table in powershell?

there are two variables:
$1 = Get-Process | select processname
$2 = Get-Service
I would like to see the result of the first variable in the output of the second, separate column.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Nikitin, 2016-02-04
@padla2k

The second variable is an array of ServiceController objects, adding a column there just won't work. You tell us what data you want to extract from the 1st and 2nd variables, then it will be possible to collect an array of PSCustomObject from them with the necessary fields.

A
azarij, 2016-01-31
@azarij

end goal is unclear.
describe what you want to achieve in the end.
both commands seem to produce the same results...
PS C:\Windows\System32\WindowsPowerShell\v1.0> Get-Process | gm
TypeName: System.Diagnostics.Process
Name MemberType Definition
---- ---------- ----------
Handles AliasProperty Handles = Handlecount
NPM AliasProperty NPM = NonpagedSystemMemorySize64
PM AliasProperty PM = PagedMemorySize64

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question