(本文的修改方法参照http://www.cnblogs.com/grapeot/archive/2010/02/22/1670822.html,只是详细列出修改的步骤之一。)
通过修改profile来实现,profile的介绍见http://technet.microsoft.com/en-us/library/bb613488(v=vs.85).aspx
1.更改其窗口背景和图标,效果如下:
2.生成profile
先产看是否已经存在profile,
>test-path $profile
If the profile exists, the response is True; otherwise, it is False.
if not exists,then create it:
>new-item -path $profile -itemtype file –force
编辑生成的profile,填入以下的code:
function prompt { $path = Get-Location "$path>" } $host.UI.RawUI.WindowTitle = "C:\windows\system32\cmd.exe" $Shell = $Host.UI.RawUI Clear-Host $str[email protected]" Microsoft Windows [Version 6.3.9600] (c) 2013 Microsoft Corporation. All rights reserved. "@ $str
对于所有用户生效的profile:
>new-item -path $env:windir\System32\WindowsPowerShell\v1.0\profile.ps1 -itemtype file -force
3.效果图
时间: 2024-11-05 18:53:05