Chocolatey 是 windows 下一款命令行包管理軟件 ,簡單說這就是 Windows 的 apt-get。習(xí)慣 Linux 操作方式并非常想用它操縱 Windows 的敬請折騰。Chocolatey 這套包管理系統(tǒng)目前已經(jīng)包含了近 500 多款常用軟件;依賴:
- powershell 2.0+;
- NET.framework 3.0+
-
確認powershell可以執(zhí)行腳本
首次在計算機上啟動 Windows PowerShell 時,現(xiàn)用執(zhí)行策略很可能是 Restricted(默認設(shè)置)。Restricted 策略不允許任何腳本運行。
????以管理員權(quán)限打開powershell,執(zhí)行以下命令了解當(dāng)前執(zhí)行策略:
get-executionpolicy
????若要在本地計算機上運行您編寫的未簽名腳本和來自其他用戶的簽名腳本,請使用以下命令將計算機上的 執(zhí)行策略更改為 RemoteSigned:
set-executionpolicy remotesigned -
在powershell中安裝Chocolatey
將下面的代碼,貼到powershell中,回車執(zhí)行;
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
再將下面的代碼,貼到powershell中,回車執(zhí)行:
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
-
享受Chocolatey
來安裝一個wegt,試試:
cinst Wget
????項目首頁:chocolatey官網(wǎng),更多命令,參看:GitHub命令參考