2024年9月13日 星期五

[研究]用PowerShell安裝Chocolatey (Windows 2019)

[研究]用PowerShell安裝Chocolatey (Windows 2019)

2024-09-13

********************************************************************************

Chocolatey => 巧克力口味

官方網站
https://chocolatey.org/

Open Source, Pro, Business 版本比較
https://chocolatey.org/compare

Chocolatey是一個Windows下的軟體套件管理器,讓使用者可以像在類Unix系統中使用Yum和APT一樣使用它,在Windows中實現自動化輕鬆管理Windows軟體的所有方面(安裝,組態,升級和解除安裝)。
https://zh.wikipedia.org/zh-tw/Chocolatey

安裝


Windows PowerShell
著作權(C) Microsoft Corporation。保留擁有權利。
                                                                                                                        
安裝最新的 PowerShell 以取得新功能和改進功能!https://aka.ms/PSWindows  
PS C:\Users\Administrator> Set-ExecutionPolicy Bypass -Scope Process -Force  
PS C:\Users\Administrator> iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) 
Forcing web requests to allow TLS v1.2 (Required for requests to Chocolatey.org)                                                                                                                                                                        
Getting latest version of the Chocolatey package for download.
Not using proxy.
Getting Chocolatey from https://community.chocolatey.org/api/v2/package/chocolatey/2.3.0.
Downloading https://community.chocolatey.org/api/v2/package/chocolatey/2.3.0 to C:\Users\ADMINI~1\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip
Not using proxy.
Extracting C:\Users\ADMINI~1\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip to C:\Users\ADMINI~1\AppData\Local\Temp\chocolatey\chocoInstall
Installing Chocolatey on the local 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 CLI folders if they do not already exist.

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
'C:\Users\Administrator\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'.
Chocolatey CLI (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
PS C:\Users\Administrator>
PS C:\Users\Administrator> choco
Chocolatey v2.3.0
Please run 'choco -?' or 'choco <command> -?' for help menu.
PS C:\Users\Administrator>


(完)

相關



沒有留言:

張貼留言