Trevor Sullivan's Tech Room

Minding the gap between administration and development

PowerShell: Prompt Function to Monitor Memory Usage

Posted by Trevor Sullivan on 2012/01/23


Have you ever wanted to monitor your memory utilization in a PowerShell instance, but may not want to continually issue commands to determine it? Introducing …… the PowerShell Prompt to monitor memory utilization!!

function prompt {
    "$('{0:n2}' -f ([double](Get-Process -Id $pid).WorkingSet/1MB)) MB> "
}

Here’s the result:

image

Advertisements

One Response to “PowerShell: Prompt Function to Monitor Memory Usage”

  1. […] Monitor Memory usage from your PowerShell prompt […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: