PowerShell for Windows Admins

Jul 18 2010   12:03PM GMT

Page File information



Posted by: Richard Siddaway
Operating System, PowerShell v2

A simple function to retrieve page file details

function Get-PageFile {
param(
    [string]$computer="."
)   
        Get-WmiObject -Class Win32_PageFileUsage  -ComputerName $computer |
        Select  @{Name="File";Expression={ $_.Name }},
        @{Name="Base Size(MB)"; Expression={$_.AllocatedBaseSize}},
        @{Name="Peak Size(MB)"; Expression={$_.PeakUsage}},
        @{Name="Install Date";Expression={ $_.ConvertToDateTime( $_.InstallDate) }},
        TempPageFile
  }

I’ve just modified the labels on the properties to emphasise the units of measurement for the sizes

Comment on this Post

Leave a comment: