windows軟體包管理器
阿新 • • 發佈:2019-02-13
來源自我的部落格
Chocolatey
cmd
命令提示符下下執行安裝
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
由於官網指令碼託管到github上了,所以更改下載路徑如下:
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/chocolatey/chocolatey/master/chocolateyInstall/InstallChocolatey.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
安裝結果如下:
C:\WINDOWS\system32>@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/chocolatey/chocolatey/master/chocolateyInstall/InstallChocolatey.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin Mode LastWriteTime Length Name ---- ------------- ------ ----
- 查詢軟體包
clist 軟體名
- 安裝軟體包
cinst 軟體名
OneGet
windows10自帶
- 開啟
powershell
- 輸入
Get-Command -Module PackageManagement
可看到具體用法
CommandType Name Version Source
----------- ---- ------- ------
Cmdlet Find-Package 1.0.0.1 PackageManagement
Cmdlet Find-PackageProvider 1.0.0.1 PackageManagement
Cmdlet Get-Package 1.0.0.1 PackageManagement
Cmdlet Get-PackageProvider 1.0.0.1 PackageManagement
Cmdlet Get-PackageSource 1.0.0.1 PackageManagement
Cmdlet Import-PackageProvider 1.0.0.1 PackageManagement
Cmdlet Install-Package 1.0.0.1 PackageManagement
Cmdlet Install-PackageProvider 1.0.0.1 PackageManagement
Cmdlet Register-PackageSource 1.0.0.1 PackageManagement
Cmdlet Save-Package 1.0.0.1 PackageManagement
Cmdlet Set-PackageSource 1.0.0.1 PackageManagement
Cmdlet Uninstall-Package 1.0.0.1 PackageManagement
Cmdlet Unregister-PackageSource 1.0.0.1 PackageManagement
- 查詢軟體包
Find-Package -Name 軟體包名
- 檢視軟體源
Find-PackageProvider
- 列舉已裝軟體
Get-Package
- 檢視電腦已安裝軟體提供者
Get-PackageProvider
- 安裝軟體
Install-Package
- 解除安裝軟體
Uninstall-Package
- 開啟