• 安装chocolatey


    下载文件:

    https://chocolatey.org/install.ps1

    切换到下载文件所在目录,执行:

    @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%chocolateyin"

    输出:

    C:UsersqiDownloads>@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%chocolateyin"
    Getting latest version of the Chocolatey package for download.
    使用“1”个参数调用“DownloadString”时发生异常:“操作超时”
    所在位置 行:138 字符: 10
    +   return $downloader.DownloadString($url)
    +          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : WebException
    Downloading  to C:UsersqiAppDataLocalTempchocolateychocInstallchocolatey.zip
    使用“1”个参数调用“IsBypassed”时发生异常:“相对 URI 不支持此操作。”
    所在位置 行:112 字符: 15
    +     } elseif (!$downloader.Proxy.IsBypassed($url)) {
    +               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : InvalidOperationException
    使用“2”个参数调用“DownloadFile”时发生异常:“路径的形式不合法。”
    所在位置 行:149 字符: 3
    +   $downloader.DownloadFile($url, $file)
    +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : ArgumentException
    Extracting C:UsersqiAppDataLocalTempchocolateychocInstallchocolatey.zip to C:UsersqiAppDataLocalTempchocolateychocInstall...
    Installing chocolatey on this machine
    Creating ChocolateyInstall as an environment variable (targeting 'Machine')
      Setting ChocolateyInstall to 'C:ProgramDatachocolatey'
    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:ProgramDatachocolateylib'
      (i.e. C:ProgramDatachocolateylibyourPackageName).
    A shim file for the command line goes to 'C:ProgramDatachocolateyin'
      and points to an executable in 'C:ProgramDatachocolateylibyourPackageName'.
    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.
    PATH environment variable does not have C:ProgramDatachocolateyin in it. Adding...
    警告: Not setting tab completion: Profile file does not exist at 'F:My
    DocumentsWindowsPowerShellMicrosoft.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
    Ensuring chocolatey.nupkg is in the lib folder
    

    测试:

    choco install ccleaner

    本文原创发表于http://www.cnblogs.com/qijj,转载请保留此声明。
  • 相关阅读:
    vue源码中的检测方法
    Node.js中Streams
    5_PHP数组_3_数组处理函数及其应用_6_数组检索函数
    5_PHP数组_3_数组处理函数及其应用_8_数组与数据结构
    5_PHP数组_3_数组处理函数及其应用_7_数组排列函数
    5_PHP数组_3_数组处理函数及其应用_1_快速创建数组的函数
    5_PHP数组_3_数组处理函数及其应用_2_数组统计函数
    5_PHP数组_3_数组处理函数及其应用_3_数组指针函数
    5_PHP数组_3_数组处理函数及其应用_4_数组和变量间的转换函数
    4_PHP流程控制语句_3_程序跳转和终止语句
  • 原文地址:https://www.cnblogs.com/qijj/p/6202997.html
Copyright © 2020-2023  润新知