Installing Chocolatey on Windows Using PowerShell

Posted by

Chocolatey is a powerful package manager for Windows that simplifies software installation, similar to how package managers work on Linux. This blog will guide you through installing Chocolatey using PowerShell.

Step 1: Open PowerShell as Administrator

Before proceeding, ensure that PowerShell is running with administrative privileges:

  1. Press Win + X and select Windows Terminal (Admin) or PowerShell (Admin).
  2. Click Yes when prompted by the User Account Control (UAC).

Step 2: Run the Chocolatey Installation Command

Copy and paste the following command into PowerShell 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://community.chocolatey.org/install.ps1’))

Understanding the Command:

  1. Set-ExecutionPolicy Bypass -Scope Process -Force;
    • Temporarily allows PowerShell scripts to run without restrictions in the current session.
  2. [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
    • Ensures PowerShell uses TLS 1.2, which is required for secure downloads.
  3. iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
    • Downloads and executes the official Chocolatey installation script.

Step 3: Verify the Installation

Once the installation is complete, verify Chocolatey is installed by running:

choco -v

If the installation is successful, you should see the version number of Chocolatey displayed in the terminal.

Step 4: Installing Software Using Chocolatey

Now that Chocolatey is installed, you can use it to install software. For example, to install Google Chrome, run:

choco install googlechrome -y

Replace googlechrome with any package name available in the Chocolatey repository.

Conclusion

Chocolatey is an efficient way to install and manage software on Windows. With just a single command, you can automate software installations and updates. Now that you have it set up, explore Chocolatey’s vast repository and simplify your Windows software management!

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x