Welcome to MSDN Blogs Sign in | Join | Help

Get-WindowTitle.ps1

I do this so frequently that I finally put it into a script called Get-WindowTitle.ps1 .

Get-Process |where {$_.mainWindowTItle} |format-table id,name,mainwindowtitle –AutoSize

Here is what it does:

[4696:0]PS> Get-WindowTitle

  Id Name              MainWindowTitle
  -- ----              ---------------
2448 mmc               Server Manager
4696 powershell        Administrator: Windows PowerShell
3828 powershell_ise    Administrator: C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe
4116 WindowsLiveWriter Get-VisibleProcess.ps1 - Windows Live Writer

Enjoy!

Jeffrey Snover [MSFT]
Distinguished Engineer
Visit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at:  http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

Published Friday, May 22, 2009 7:34 PM by PowerShellTeam

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Get-WindowTitle.ps1

Really, really useful.

Thank you for this.

Saturday, May 23, 2009 4:25 AM by Stuart Henderson

# re: Get-WindowTitle.ps1

Very nice, I just put this in my $PROFILE instead and called it

$getproc=Get-Process |where {$_.mainWindowTItle} |format-table id,name,mainwindowtitle –AutoSize

I guess I could call that .ps1 each time my profile loads, but I figured I don't mind typing $getproc when I need to run this :)

Thank you!  

Saturday, May 23, 2009 6:42 PM by ichoudhury

# re: Get-WindowTitle.ps1

Very nice script.  Jeffrey, is there a way to see a complete list of scripts submitted by the PowerShell team?  The search box does not work very well.

Wednesday, May 27, 2009 12:05 PM by MikeW

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker