Check Page File Size and Usage with PowerShell
Query Win32_PageFileUsage to see page file size, current usage, and peak usage — how close you are to memory exhaustion.
01Command
$ Get-CimInstance Win32_PageFileUsage | Select-Object Name, AllocatedBaseSize, CurrentUsage, PeakUsage02What it does
The page file is the backup space on disk where Windows moves memory pages when RAM runs short. AllocatedBaseSize is the current page file size in MB, CurrentUsage is how much is in use right now, and PeakUsage is the highest since boot — a PeakUsage close to AllocatedBaseSize means the system has come near running out. That's the data you want before deciding to shrink it manually or add RAM. For a memory-starved PC this also explains slowdowns that Task Manager's percentage alone doesn't.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Win32_PageFileUsage classEvidence: Win32_PageFileUsage exposes AllocatedBaseSize (current MB), CurrentUsage and PeakUsage for each page file on the system.
Last verified: 2026-09-18 · Category: System & Settings
06Related solutions
Search inside text files and logs with regex, returning file, line number and match.
Create or update a .zip from any files or folder contents straight from PowerShell.
A built-in PowerShell one-liner that answers 'is port 5432/3389/443 actually open through this network?' — no telnet client needed.