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?