Accessing Current PowerShell Process

If you ever want to access the process that is executing your current PowerShell session, use the $pid automatic variable which tells you the Process ID, and feed it to Get-Process:

Get-Process -id $pid

Twitter This Tip! ReTweet this Tip!


Posted Aug 31 2009, 08:00 AM by ps1

Comments

Accessing Current PowerShell Process - Power Tips - PowerShell.com power wrote Accessing Current PowerShell Process - Power Tips - PowerShell.com power
on 09-14-2009 12:21 PM

Pingback from  Accessing Current PowerShell Process - Power Tips - PowerShell.com power

Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.