不一樣的命令列 – Windows PowerShell簡介 之 “蛋疼的偽裝–Profile”詳細實現

來源:互聯網
上載者:User

標籤:style   blog   http   color   io   os   ar   for   strong   

(本文的修改方法參照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.RawUIClear-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.

不一樣的命令列 – Windows PowerShell簡介 之 “蛋疼的偽裝–Profile”詳細實現

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.