Wouldn't it be great if I could change the window title to something more meaningful? No sweat, PowerShell gives you access to the window through the $Host variable. The command looks like this "$Host.UI.RawUI.WindowTitle = 'My New Title'". Of course, I'll never be able to remember this and it does seem like a lot of typing. So I added the following function and alias statement to my profile.
function Set-WindowTitle($title)
{
$Host.UI.RawUI.WindowTitle = $title
}
set-alias swt Set-WindowTitle
Notice that I tried to mimic the verb-noun convention used by the rest of the PowerShell commands. Now, to set the title I can type in "swt 'My New Title'".
No comments:
Post a Comment