Getting RAM info - Powershell
<p>I have a list of PC's that i need to get the Physical Memory and the amount of memory slots available.  I have a list of PC's in a text file and i am using the "get-content" cmdlet.  This is what I have:</p>

<pre><code>Get-WmiObject -Class Win32_PhysicalMemory -ComputerName (Get-Content "C:\TextFile.txt") | ForEach-Object {[math]::truncate($_.capacity / 1GB)}
</code></pre>

<p>When I run this, only the Memory total is displayed. My 2 questions are:</p>

<p>1) How can get the PC name to show up next to the corresponding number?</p>

<p>and </p>

<p>2) How can i add the total memory slots available to this as well?</p>

<p>Thank You!</p>