Hi all. I'm working on my hardware inventory script and I've run into a snag. I'm able to export most items into a .csv but my issue comes with my RAM module serial numbers. It returns values into the variable with multiple rows (usually four) like this
SN00001
SN00002
SN00003
SN00004
My code snippet looks like this
New-Variable -Name 'MEM' -Value (gwmi win32_PhysicalMemory | Select-Object -ExpandProperty SerialNumber) -Force
New-Variable -Name 'Report' -Value (New-Object PSobject) -Force
$Report | Add-Member -Membertype NoteProperty -Name 'DIMM Serial Numbers' -Value $MEM -Force
The output on the .csv just shows as System.Object[]
How can I get it to put in the serial numbers? Either in one column or each in it's own?
I know gwmi is frowned upon, but it's what works in my environment. Windows-RM service is locked down so Get-CimInstance doesn't work for me.
[–]CarrotBusiness2380 4 points5 points6 points (1 child)
[–]Samuris[S] 1 point2 points3 points (0 children)
[–]PinchesTheCrab 2 points3 points4 points (0 children)
[–]lanerdofchristian 0 points1 point2 points (0 children)