Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Updating window title bar to current location

Reply
 
Old 12-30-2007   #1 (permalink)
Marc Scheuner


 
 

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

My System SpecsSystem Spec
Old 12-30-2007   #2 (permalink)
Shay Levi


 
 

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

My System SpecsSystem Spec
Old 12-30-2007   #3 (permalink)
Marc Scheuner


 
 

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
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Activeate a window by hovering over it (THE TITLE BAR) with the mouse Vista General
Get window title from PID VB Script
Please help with wierd problem - window stuck with title bar only Vista General
Re-setting the window title when PSCX is installed PowerShell
How do I change the colours of window title bars? Vista General


Vista Forums 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 Ltd

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