Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Join different tables in Powershell

$
0
0

Hi!

I am trying to get some information in two different WMI-tables. Win32_ComputerSystem and win32_PhyscialMemory and i would like to output Computername, Model and Amount of memory.

This is the best that i could figure out and it is a little complex and it output one table for each computer.

"Computer1","Computer2" | foreach { gwmi win32_computersystem -ComputerName $_ -ErrorAction SilentlyContinue | ft name,model, @{name="Memory (GB) ";Expression={$((gwmi win32_physicalmemory -ComputerName $_.name | measure capacity -sum).sum/1gb)}} -AutoSize}

Is there a better way to do this?


Viewing all articles
Browse latest Browse all 2562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>