cmder
windows的cmd感覺就是一個坑:
1.每次啟動都在c:\user\用戶名,需要cd一堆才能去到指定的文件根目錄;
2.不支持tab頁,切換管理不便;
3.黑白界面,沒有字體渲染;
4.可編程性沒有shell那么強。
安裝
偶然間接觸到cmder,發現比自帶的cmd好用的多,有兩個版本,我下的是完整版,解壓并且把
文件路徑添加到環境變量PATH(例如;C:\cmder;),最后執行cmder.exe。? cmder官網。
添加到右鍵菜單
在cmder的管理員身份執行:
Cmder.exe /REGISTERALL
把cmder添加到右側菜單。
解決文字重疊問題
Win + Ait + P喚出設置界面 > mian console font > font > monospce 的勾去掉
默認以powershell打開
posh-git
剛開始執行cmder的時候,就會發現頂部有個礙眼的警告,如果不需要涉及git操作的話,無視它也可以,如果想要把它消除掉,需要安裝psget(能在線或者本地安裝和搜索第三方的powershell組件的命令集)
(new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1") | iex
提示psget安裝成功后,就可以安裝posh-git了
Import-Module PsGet
Install-Module posh-git
這里可能會報錯,psget官網給的解決方法沒有及時更新
Set-ExecutionPolicy -scope LocalMachine -ExecutionPolicy RemoteSigned
更改了powershell的執行策略后,再執行posh-git的安裝,如果提示Module posh-git was not found in central repository,那就是powershell的版本過低。
$psversiontable.psversion
升級到4.0就可以,因為5.0還沒有簡體中文,會報錯。
先升級Microsoft .NET Framework 4.5,然后打上powershell4.0的補丁即可。
安裝chocolatey包管理軟件
在powershell用管理員身份安裝
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
或者在cmd同樣用管理員身份安裝
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
安裝軟件命令
choco install softwareName
可安裝的應用程序,可以參見其??Package列表