Multiple choice technology

Which of the below script gives the name of memory slots installed in a system and the size of each memory slot(RAM)?

  1. \$strComputer = "Computer name" \$colRAM = Get-WmiObject -Class "win32_PhysicalMemory" -namespace "root\CIMV2"-computerName \$strComputer Foreach (\$objRAM In \$colRAM) { "Memory Installed: " + \$objRAM.DeviceLocator &quo
  2. \$strComputer = "Computer name" \$colRAM = Get-WmiObject -Class "win32_PhysicalMemoryArray" -namespace "root\CIMV2"-computerName \$strComputer Foreach (\$objRAM In \$colRAM) { "Memory Installed: " + \$objRAM.DeviceLocator
  3. \$strComputer = "Computer name" \$colRAM = Get-WmiObject -Class "win32_PhysicalMemorySize" -namespace "root\CIMV2"-computerName \$strComputer Foreach (\$objRAM In \$colRAM) { "Memory Installed: " + \$objRAM.DeviceLocator
  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The Win32_PhysicalMemory WMI class provides information about each physical memory module installed in the system. The DeviceLocator property identifies the memory slot location, and the Capacity property indicates the RAM size. Option B uses Win32_PhysicalMemoryArray which describes the memory array hardware rather than individual modules, while Option C references a non-existent WMI class.