windows软件包管理器

来源自我的博客

http://www.yingzinanfei.com/2017/02/04/windowsruanjianbaoguanliqi/

  1. 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
    ----                -------------         ------ ----
    d-----       2016/12/14     20:25                chocInstall
    Downloading https://chocolatey.org/api/v2/package/chocolatey/ to     C:\Users\yingzi\AppData\Local\Temp\chocolatey\chocInstall\chocolatey.zip
    Extracting C:\Users\yingzi\AppData\Local\Temp\chocolatey\chocInstall\chocolatey.zip to ...
    Installing chocolatey on this machine
    Creating ChocolateyInstall as an environment variable (targeting 'Machine')
    Setting ChocolateyInstall to 'C:\ProgramData\chocolatey'
    WARNING: It's very likely you will need to close and reopen your shell
    before you can use choco.
    Restricting write permissions to Administrators
    We are setting up the Chocolatey package repository.
    The packages themselves go to 'C:\ProgramData\chocolatey\lib'
    (i.e. C:\ProgramData\chocolatey\lib\yourPackageName).
    A shim file for the command line goes to 'C:\ProgramData\chocolatey\bin'
    and points to an executable in 'C:\ProgramData\chocolatey\lib\yourPackageName'.
    
    Creating Chocolatey folders if they do not already exist.
    
    WARNING: You can safely ignore errors related to missing log files when
    upgrading from a version of Chocolatey less than 0.9.9.
    'Batch file could not be found' is also safe to ignore.
    'The system cannot find the file specified' - also safe.
    chocolatey.nupkg file not installed in lib.
    Attempting to locate it from bootstrapper.
    PATH environment variable does not have C:\ProgramData\chocolatey\bin in it. Adding...
    警告: Not setting tab completion: Profile file does not exist at
    'D:\Users\yingzi\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'.
    Chocolatey (choco.exe) is now ready.
    You can call choco from anywhere, command line or powershell by typing choco.
    Run choco /? for a list of functions.
    You may need to shut down and restart powershell and/or consoles
    first prior to using choco.
    Ensuring chocolatey commands are on the path
    THIS IS DEPRECATED. Please use the install from     https://chocolatey.org/install.ps1
    • 查询软件包
    clist 软件名
    • 安装软件包
    cinst 软件名
  2. 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值