Automating the world one-liner at a time…
jmanning wrote:
Also, given how common the request is, I'd ask Jeffrey to (pretty-please) also include in this post a prompt function that sets the title to include pwd.
Ask and yea shall receive:
function Prompt{ $host.ui.RawUI.WindowTitle = $(get-location) "PS> "}
If you want to see a bunch of great prompt examples, check out:
http://mshforfun.blogspot.com/2006/05/perfect-prompt-for-windows-powershell.html
Jeffrey Snover [MSFT]Windows PowerShell/Aspen ArchitectVisit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShellVisit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
PSMDTAG:FAQ: How do I set the Console Title to my current working directory?
PSMDTAG:SHELL: Prompt
PSMDTAG:ENVIRONMENT: Prompt
PingBack from http://shortcircuited.wordpress.com/2006/10/24/customizing-windows-powershell/
I understand what the function is doing but I dont understand why when I put it in my profile the function executes automatically? Is "prompt" called automatically by MSH?
Secondly, how does "PS >" set the prompt?
Thank you,
Fred Jacobowitz
Open run type in cmd.exe and type title cmd