🧬 WQL / PowerShell
Win32_PhysicalMemory: Physical Memory Modules (WQL)
A minimal WQL reference query against Win32_PhysicalMemory — the raw SELECT statement plus a one-line runner, useful for learning WMI Query Language independent of any host language.
PhysicalMemoryQuery.ps1
<#
.SYNOPSIS
WQL reference: Physical Memory Modules (Win32_PhysicalMemory).
.DESCRIPTION
A minimal example of querying Win32_PhysicalMemory with a raw WQL SELECT
statement via Get-CimInstance -Query — useful as a WMI Query
Language reference, independent of any particular scripting
language's WMI binding.
The same query string works with Get-WmiObject -Query (older
PowerShell), GetObject("winmgmts:...").ExecQuery(...) in VBScript
or JScript, and ManagementObjectSearcher in C# — only the syntax
around the query changes, not the WQL itself.
.EXAMPLE
.\PhysicalMemoryQuery.ps1
#>
[CmdletBinding()]
param()
$wqlQuery = "SELECT BankLabel, Capacity, Speed, Manufacturer FROM Win32_PhysicalMemory"
Write-Host "WQL: $wqlQuery" -ForegroundColor DarkGray
Get-CimInstance -Query $wqlQuery | Format-Table -Property BankLabel, Capacity, Speed, Manufacturer -AutoSize