Home> Common Problem> body text

How to install Chocolatey on Windows 11 using PowerShell

王林
Release: 2023-04-15 10:10:05
forward
1897 people have browsed it

How to install Chocolatey on Windows 11?

The first step is to openPowerShellon your Windows 11 computer and also have administrator rights. It's important to open PowerShell with administrator rights because you won't be able to install Chocolatey without it.

Open PowerShell with administrator rights

The easiest way to open PowerShell with administrator rights on Windows 11 is to use the "Windows R " shortcut key to open it"Run", enterPowerShell, and then use "Ctrl Shift Enter" to open PowerShell with administrator rights.

or, right-click the Start menu and select the Terminal (Administrator) option.

Now typethe following command to know the execution policy status of PowerShell.

Get-ExecutionPolicy
Copy after login

If it says"Restricted",as shown in the screenshot below, type the command shown below on PowerShell with administrator privileges.

Set-ExecutionPolicy AllSigned
Copy after login

When you are asked to confirm, you must type"Y" and press Enter.

How to install Chocolatey on Windows 11 using PowerShell

Run the Chocolatey installation command on Windows 11

Now, we can finally proceed with the installation of Chocolatey. If you have questions about how to download Chocolatey, the download and installation process will be completed simultaneously.

Just copy and paste the following command and press enter.

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Copy after login

        
Copy after login
How to install Chocolatey on Windows 11 using PowerShell

The process will take a few seconds to a minute to complete, however, the exact duration of the installation process will vary depending on your internet speed and the size of your Windows 11 system. Varies with speed. Once the process is complete, you can continue using Chocolatey.

Now that Chocolatey is ready to use on your computer, you can use the Choco install command to install your favorite packages on your Windows 11 computer, avoiding searching for the application on your web browser. Cut out the clutter and avoid jumping between several unnecessary pop-ups and end up with unwanted bundled apps.

Now it's obvious how good Chocolatey is for you. Let’s try out the Chocolatey download and install package on Windows 11 to give you an idea of how easy it is to use Chocolatey download and install on Windows 11.

How to use chocolate?

Before you can proceed to download and install a package on Chocolatey, you must find out whether the package is available on Chocolatey (in most cases it is) and then find out the exact name of the package to proceed Install.

For example, we will install Google Chrome here. So, we will enter the following command to search Google Chrome on Chocolatey.

Choco Search Package/chocolatey Search Package

choco search google chrome
Copy after login

It takes some time to display the package list. Don't get confused by a long list of packages. Use the most specific keywords to narrow your search results and get the most relevant results. However. In most cases, the package you are looking for will appear on the first few listings.

How to install Chocolatey on Windows 11 using PowerShell

Now you mustenter the following command to continueinstalling the package.

Choco Installation Package/chocolatey Installation Package

choco install GoogleChrome
Copy after login

You can simply ignore the version number, I always recommend that you only install those approved packages unless you are sure What are you doing.

Because Chocolatey will execute certain scripts to download and install programs on your computer, it will request script execution permissions. Simply type"A"to allow execution of all scripts, or"Y"to allow execution of scripts one after the other.

How to install Chocolatey on Windows 11 using PowerShell

Other Convenient But Useful Tasks

In addition to searching and installing packages, you can also uninstall chocolatey packages using specific commands, or upgrade specific ones from time to time Chocolatey package.

To uninstall a software package, the command is "choco uninstall package" or "chocolatey uninstall package".

Similarly, you can use the command "choco upgrade package" or "chocolatey upgrade package" to upgrade a specific Chocolatey package. In both cases, you must replace package with the package name you used during installation.

If you want to install Chocolatey on cmd or Command Prompt, the process is similar. If you completed this process on PowerShell, you can use PowerShell and Command Prompt interchangeably to use Chocolatey and the handler. If you want to use Chocolatey to install a licensed application, for example if you want to use Chocolatey to install Microsoft Office, you can do that too, however, you should have a valid license to use that program. This applies to all other paid apps distributed through Chocolatey.

If you are wondering how to install Chocolatey manually, that is also possible, however, I have excluded it from this tutorial. Unless you want to install Chocolatey offline, I don't recommend doing this.

Do you need to install Chocolatey when you can install all Windows programs using a user-friendly GUI interface? It’s all up to you, Chocolatey is a great software management automation tool that takes away all the confusion when it comes to installing programs. If you want to install Chocolatey on PowerShell on any Windows operating system, you can continue with the same steps. Chocolatey is a Swiss knife for professional users who want to save valuable time while working on their programs.

The above is the detailed content of How to install Chocolatey on Windows 11 using PowerShell. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yundongfang.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn