I want to add "GB" to each instance of "Size" so each output shows "8GB". I'm not sure how to add or concatenate a string to the integer within the table...
I have tried simply adding +"GB"
, assigning "GB" to a variable then adding + $GB
. But get back Select-Object : A positional parameter cannot be found that accepts argument 'System.Object[]'.
Input:
$RAM = Get-WmiObject Win32_PhysicalMemory -ComputerName $Computer |
select DeviceLocator,Manufacturer,PartNumber, @{n="Size";e={[math]::truncate($_.Capacity / 1073741824)}},Speed | FT -AutoSize
Write-Output $RAM
Output:
DeviceLocator Manufacturer PartNumber Size Speed
------------- ------------ ---------- ---- -----
DIMM1 000000000000 8 1600
DIMM2 000000000000 8 1600
DIMM3 000000000000 8 1600
DIMM4 000000000000 8 1600