tente isto:
systeminfo | find "Virtual Memory"
isso retornará:
Virtual Memory: Max Size: 17.297 MB
Virtual Memory: Available: 7.186 MB
Virtual Memory: In Use: 10.111 MB
aqui está o meu script powershell que retorna o uso de swap:
$maxSizeStr = systeminfo | select-string "Virtual Memory: Max Size:"
$maxSize = [int][regex]::Matches($maxSizeStr, '[\d.]+').Value -replace "\.",""
$inUseStr = systeminfo | select-string "Virtual Memory: In Use:"
$inUse = [int][regex]::Matches($inUseStr, '[\d.]+').Value -replace "\.",""
$swapUsage = ($inUse / $maxSize) * 100
Write-Output $swapUsage