Skip to content

Instantly share code, notes, and snippets.

@bklockwood
Last active June 17, 2016 10:18
Show Gist options
  • Save bklockwood/ebe579667a91eb56c00a3b0593d5ea3e to your computer and use it in GitHub Desktop.
Save bklockwood/ebe579667a91eb56c00a3b0593d5ea3e to your computer and use it in GitHub Desktop.
Memory diagnosis
#this works for win10; older windows may not have same-same wmi class members
$physmem = (Get-CimInstance Win32_PhysicalMemory | select BankLabel, DeviceLocator, Capacity, ConfiguredClockSpeed, Manufacturer, PartNumber | Format-Table -AutoSize)
$pfsettings = (Get-CimInstance Win32_PageFileSetting | Select-Object Name, InitialSize, MaximumSize | Format-Table -AutoSize)
$pfuse = (Get-CimInstance Win32_PageFileUsage | select Name, Status, CurrentUsage, PeakUsage | Format-Table -AutoSize)
$pfdiskuse = (Get-CimInstance Win32_PageFile | Select-Object Name, Status, Compressed, FileSize | Format-Table -AutoSize)
$diskdrives = (get-psdrive | ?{$_.Provider.Name -eq "FileSystem"} | Format-Table -AutoSize)
$autopf = (Get-CimInstance Win32_ComputerSystem).AutomaticManagedPagefile
if ($autopf -eq $true) {
Write-Output "Pagefile settings ARE DEFAULT (automatically managed)."
} else {
Write-Output "Pagefile settings have been MANUALLY ALTERED; settings:"
$pfsettings
}
$pfuse
$pfdiskuse
$physmem
$diskdrives
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment