如何将标题添加到PowerShell窗口?

我打开了许多PowerShell窗口,并具有特定于任务的命令历史logging。

在良好的旧batch file天,我会使用Title finance dptTitle Email Admin 。 我怎么能在PS中完成这个?

 PS C:\> $Host.UI.RawUI.WindowTitle = "New Window Title" 

如果你想在每个新的PS窗口上find你想要的东西,也可以把它放到你的configuration文件中。

查看TechNet文章“ 定制Windows PowerShell控制台”

如果你的自己的控制台,你想自定义然后下面的文章在如何到极客有你需要的细节。 不less步骤,但值得。

如果你想在产生一个进程的时候设置标题:

 $StartInfo = new-object System.Diagnostics.ProcessStartInfo $StartInfo.FileName = "$pshome\powershell.exe" $StartInfo.Arguments = "-NoExit -Command `$Host.UI.RawUI.WindowTitle=`'Your Title Here`'" [System.Diagnostics.Process]::Start($StartInfo)