Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Updating window title bar to current location

Closed Thread
 
Thread Tools Display Modes
Old 12-30-2007   #1 (permalink)
Marc Scheuner
Guest


 

Updating window title bar to current location

Folks,

I would like to show the current location on my PowerShell window's
title bar.

I can achive that initially by having this line in my "profile.ps1":

$host.UI.RawUI.WindowTitle = "$(Get-Location)"

How can I get it to constantly update, whenever I issue a "cd" or
"Set-Location" command? Is there a way to trigger the title bar to
update to reflect the current location?

Thanks!
Marc
Old 12-30-2007   #2 (permalink)
Shay Levi
Guest


 

Re: Updating window title bar to current location


Hi Marc

You need put it in your $profile prompt function. If you don't have the prompt
function in your $profile
you can create one :

function Prompt{ $host.ui.rawui.windowtitle = "$pwd" }


-----
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com
Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic


Quote:

> Folks,
>
> I would like to show the current location on my PowerShell window's
> title bar.
>
> I can achive that initially by having this line in my "profile.ps1":
>
> $host.UI.RawUI.WindowTitle = "$(Get-Location)"
>
> How can I get it to constantly update, whenever I issue a "cd" or
> "Set-Location" command? Is there a way to trigger the title bar to
> update to reflect the current location?
>
> Thanks!
> Marc

Old 12-30-2007   #3 (permalink)
Marc Scheuner
Guest


 

Re: Updating window title bar to current location

>You need put it in your $profile prompt function. If you don't have the prompt
Quote:

>function in your $profile
>you can create one :
>
>function Prompt{ $host.ui.rawui.windowtitle = "$pwd" }
O gosh - this is sooo simple - it's embarassing - thanks! Works like a
charm !

Marc
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I keep the current window on top as new one loads? mattfbuelow Network & Internet 4 1 Day Ago 10:56 AM
rundll code to close current window ldvg General Discussion 2 07-11-2008 05:17 PM
Re-setting the window title when PSCX is installed Duncan Smith PowerShell 2 04-08-2008 11:00 AM
Vista - ? Mark - Current window Help Rox Vista General 6 08-21-2007 06:19 AM
How do I change the colours of window title bars? =?Utf-8?B?aW1hY2tlbg==?= Vista General 9 07-24-2006 06:47 AM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50