How to Work with Chocolatey in PowerShell – A Guide with Examples

How to Work with Chocolatey in PowerShell

Today, we live in a world of software. Now every step is impossible without software. Software is needed in almost every field, from Google Meet for online classes to Excel for IT professionals.

But the problem is the software installation process, because you have to visit different websites each time to download the software. Clicking the Next button again and again, agreeing to the terms and conditions, and then clicking Install can make this entire setup process feel frustrating. It wastes a lot of your time. So, what is the solution?

Hi, I'm Hemanta. Let's learn an easy way to install software on Windows using Chocolatey.

Table of Contents


Chocolatey is not chocolate! Chocolatey is package manager software. It allows you to install, update, and uninstall software with just a single command.

🔗You can find the Chocolatey packages in the official community repository.

Prerequisites

Before working with Chocolatey, you should have:

  • Chocolatey works on Windows 7+ or a later version
  • Administrator Access: You need admin rights to install Chocolatey.
  • PowerShell Version: 5.0 or higher is recommended.
  • Basic Command Line Knowledge: PowerShell or Command Prompt.

How to Install Chocolatey

To install Chocolatey, open PowerShell (Admin) (shortcut key Win + X) and run the following command.

Set-ExecutionPolicy Bypass -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol = 3072;
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Before running the Chocolatey installation script in PowerShell, make sure to check the URL carefully.

This command may seem strange to you at first, but it works in three simple steps. So, Let's break down the command and explain everything.

  1. ExecutionPolicy: ❌ Windows ✅ Overprotective mom

Think of ExecutionPolicy as an overprotective mother in Windows who says, "Son, don't run scripts from strangers". This ExecutionPolicy is set by default in Windows to block harmful scripts from running on the system. Because of mother restriction, PowerShell sometimes displays the "running scripts is disabled on this system" error message.

powershell execution policy errorPowerShell Execution Policy Error

When you run the Chocolatey installation command in PowerShell, the files will not load because the execution policy is set to restricted. To resolve this issue, we'll bypass the PowerShell execution policy.

Set-ExecutionPolicy Bypass -Scope Process -Force

This command changes the execution policy of the PowerShell session only for that time. That is, once you close the PowerShell window, the previous security settings will automatically return. Otherwise, you can use the following command to manually disable the bypass.

Set-ExecutionPolicy Undefined -Scope Process

This command will remove any ExecutionPolicy set on the current PowerShell Process scope.

  1. TLS 1.2: Forcing your old mobile to use 5G

Now imagine your PC is old or your .NET Framework is outdated. Your browser might open HTTPS sites without any issues, but PowerShell's download engine acts like it's from 2010 and won't accept modern secure connections.

However, Chocolatey requires a secure (HTTPS) internet connection to download scripts during installation. In many cases, TLS 1.2 (Transport Layer Security) is disabled by default, causing SSL/TLS secure channel errors.

SSL/TLS secure channel errorError: Could not create SSL/TLS secure channel.
[System.Net.ServicePointManager]::SecurityProtocol = 3072

So, we'll use this command, which forces PowerShell to use TLS 1.2. Therefore, Chocolatey is downloaded securely from the official website.

  1. install.ps1: Download and run the official installer
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

This section downloads the install.ps1 script from the official Chocolatey website and executes it immediately. As a result, Chocolatey is automatically installed on the system.

Run the following command in PowerShell to verify that Chocolatey is installed.

choco --version

Installation Problems in Chocolatey (Case Study)

Sometimes, you may face issues while installing Chocolatey. My Codehemu team also faced an issue during installation.

Here, we'll discuss some real-world case studies so you know the problems.

(407) Proxy Error:

A member of our CodeHemu team tried to install Chocolatey over the office Wi-Fi, and the install command failed due to (407) Proxy Authentication Required.

The solution was to check if the PC was behind a proxy. Then, configure Chocolatey and the proxy settings, or ask the IT team to allow the required domain.

Lesson: If you are using college or office internet, try using a mobile hotspot. And if the command works, then the problem is with your network policy.

SSL/TLS Failures:

Another reported issue is The request was aborted: Could not create SSL/TLS secure channel. This error is seen when PowerShell tries to download install.ps1 but fails because TLS 1.2 is disabled.

Lesson: On older Windows systems, outdated .NET and PowerShell settings can lead to HTTPS failures. That's why TLS 1.2 is required.

Trust Relationship Error:

We have found that some users are facing the Could not establish trust relationship for the SSL/TLS secure channel error.

According to the Chocolatey proxy guide, this issue shows up when trusted root certificates are missing or outdated.

Lesson: If HTTPS works in the browser but the PowerShell download fails, it could still be a problem with the certificate or proxy issue.

What Is Chocolatey and Why Should You use?

Chocolatey is a command-line-based system-level package manager for Windows, which works using PowerShell or Command Prompt.

This works like installing software packages on Linux with apt or on macOS with Homebrew. Similarly, you can use Chocolatey to install software on Windows.

Here are similar types of package managers on different platforms:

Package Manager Operating System Command
APT Linux sudo apt install <package-name>
Homebrew macOS brew install <package-name>
Chocolatey Windows choco install <package-name> -y

Here are similar types of package managers on windows:

Tool CodeHemu Use Case Example Command
Chocolatey Main package manager choco install vscode -y
Winget Windows 11 only quick installs winget install Google.Chrome
Scoop Portable apps only scoop install git

Using Chocolatey, you can install software like Python, Java, Git, VS Code, Chrome, Node.js, and many more with this single command in PowerShell.

Chocolatey vs. Manual Installation

Imagine you want to install software on a Windows operating system. To install software manually:

  1. Open a web browser.
  2. Go to the official website.
  3. Download the installer.
  4. Complete the setup manually.

Manual installation wastes both your time and effort, but Chocolatey automates all processes. Running just one command in PowerShell (Admin) with Chocolatey will install and download the software.

If you're learning web development with CodeHemu tutorials, you can set up your development environment by running this command:

choco install python nodejs git sublimetext3 -y

This single command installs Python for backend learning, Node.js for frontend development, Git for version control, and our recommended editor, Sublime Text 3. Otherwise, you'll have to visit four separate websites for manual installation.

How Chocolatey Works?

Chocolatey works in a few steps. The user doesn't see these steps directly, but the complicated process is automated in the background.

First, when the user runs the choco install command, Chocolatey understands which software needs to be installed. Then, Chocolatey searches for that package in the official Community Repository.

How Chocolatey Works

After finding the package, Chocolatey downloads the install script. The script specifies where to download the software, how to install it, and the settings for use.

Next, Chocolatey download the installer file of the main software from the official source. Sometimes, packages are downloaded from mirror sites or CDNs, not directly from the official software server.

Once the download is complete, Chocolatey automatically installs the software. This complicated automation runs without needing any Next or Agree button clicks.

At the end of the software installation, Chocolatey stores package details for future updates and uninstalling.

Top 8 Developer Workflow Commands

Here, we'll discuss the 8 CodeHemu developer workflow commands of Chocolatey.

  1. Web Development Stack
choco install nodejs git vscode sublimetext3 python live-server -y

If you are learning web development and setting up new Windows, then this command is for you. This one command installs Node.js, Git, VSCode, Sublime, Python, and Live Server on your system, saving you 45 minutes of manual download time.

  1. Responsive Testing Stack
choco install googlechrome firefox notepadplusplus postman -y

Chrome, Firefox, Notepad++, and Postman are used for cross-browser testing. This setup catches responsive bugs before they go into production.

  1. DevOps Starter Kit
choco install docker-desktop git kubernetes-cli docker-compose -y

Docker, K8s, and Git for containerized development.

  1. Debug and Inspect Power Pack
choco install fiddler processhacker sysinternals -y

Installs Fiddler (network), Process Hacker, and Sysinternals.

  1. Screen Recording Workflow
choco install obs-studio sharex greenshot -y

OBS, ShareX, and Greenshot are perfect for YouTube content creators. Using these, you can easily create coding video tutorials.

  1. Backup and Restore Commands
# List everything installed
choco list --local-only > my-packages.txt

# Reinstall everything later
choco install my-packages.txt -y

Save this file to GitHub for machine recovery.

  1. Update Everything
# Check what's outdated
choco outdated

# Update ALL (safe mode)
choco upgrade all -y --confirm

# Verify versions
choco list --local-only

Run first Saturday of every month.

  1. Clean Up Unused Packages
# Find unused/broken packages
choco list --local-only | Select-String "obsolete"

# Remove specific package
choco uninstall old-package-name -y

# Full cleanup
choco uninstall all -y

This step is applicable only to newly installed Windows systems. Running it on an existing system may cause conflicts or unexpected problems.


Top 10 Student-Favorite Packages on Chocolatey

Here's a list of 10 student-favorite software programs that you can install using Chocolatey.

Software Name Chocolatey Command
Python choco install python -y
Visual Studio Code choco install vscode -y
Git choco install git -y
Google Chrome choco install googlechrome -y
Node.js choco install nodejs -y
Java (JDK) choco install temurin -y
7-Zip choco install 7zip -y
Notepad++ choco install notepadplusplus -y
Docker Desktop choco install docker-desktop -y
Android Studio choco install androidstudio -y

Can Winget Replace Chocolatey?

Microsoft released Windows Package Manager (Winget) in 2021, and many people think, "Why use Chocolatey when Microsoft's official tool exists?"

Honestly, I think both package manager tools are excellent, and they are performing equally. Let's break down why most developers are still using Chocolatey.

What Is Windows Package Manager (Winget)?

Windows Package Manager (winget) is Microsoft's official package manager for Windows 10/11. It's a free and open-source tool, which is built into Windows 11.

"Developed by Microsoft" is more trusted, right? So, Why Does Chocolatey Win the Hearts of Developers?

Reason 1: Chocolate has more packages ❌

14 Jan 2026 (Update): The Chocolatey repository has more than 10905 Unique packages available. Winget has about 10850+ packages. No one is any less in this respect.

Reason 2: Chocolatey Works on Old Windows ✅

Winget only works on Windows 10 (version 1809 and later) and Windows 11. But Chocolatey works all the way back to Windows 7 and even Windows Server 2008.

Reason 3: Chocolatey Community Support ✅

Chocolatey launched in 2011, and Winget launched in 2020. That's 10 years of difference. In those 10 years, Chocolatey built a massive community. There are solutions for almost any problem. You can find answers on Stack Overflow, Reddit, and GitHub in seconds

Reason 4: Better Package Management ❌

Chocolatey allows you create private package repositories for internal company software. Here you can pin specific versions to stop automatic updates. However, Winget is quickly improving, especially for organizations that use Microsoft Intune.

Chocolatey vs. Winget

Here, the two tools are compared for CodeHemu web development students.

Your Setup Chocolatey Winget CodeHemu Pick
Windows 7 lab PC ✅ Works ❌ Fails Chocolatey 🏆
Install Node+Git+VSCode 1 command 1 command Both ⚡
Microsoft Store Apps ❌ No ✅ Yes Winget 💼
Install only Chrome on Windows 11 Extra setup, Slow Built-in, Fast Winget 🎯
Notepad++ portable version ✅ Available ✅ Available Both 📝

CodeHemu Workflow Test Results:

This test was performed on a Windows 10 system. The internet speed was 26.1 Mbps for download and 27.5 Mbps for upload. Other environments will have different results, the CodeHemu team does not claim these results to be completely accurate.

Task Chocolatey Time Winget Time Success Rate
Install Node.js, Git, and VS Code 3 mins 46s 9 mins 24s Chocolatey: 100%
Winget: 100%
Update 5 packages 4 mins 14s 11 mins 42s Chocolatey: 100%
Winget: 100%
Windows 10 (1803) install ✅ Success ❌ Fail Chocolatey only
Find obscure tool (Sysinternals) ✅ Found ✅ Found Both

CodeHemu Readability Score:

Metric Chocolatey Winget Why It Matters
Tutorial availability 10,000+ YouTube/StackOverflow 2,000+ (growing) Help/Support
Works on older PCs Windows 7 SP1 Minimum Windows 10 (1809) Compatibility
DevOps automation score 9.5/10 7/10 Professional workflows
chocolatey win

When Should You Use Winget?

Winget is also a winner, and let's look at those things.

  • Winget comes built into Windows 11, so no setup is required.
  • If you're just installing Chrome, Firefox, VS Code, or Git, then winget is the best option.
  • Anything can be installed from the Microsoft Store.
  • You will get official support from Microsoft.
  • Winget is easier to learn, and the command syntax is clearer.

Chocolatey vs. Winget Commands

Task Chocolatey Winget
Search choco search python winget search python
Install choco install python -y winget install Python
List Installed choco list --local-only winget list
Update One choco upgrade python winget upgrade python
Update All choco upgrade all -y winget upgrade --all
Uninstall choco uninstall python winget uninstall python
Version Info choco info python winget show python

The concepts are the same, but the syntax is a little different. Once you master one, you can use the other within minutes.


Can Chocolatey install paid software?

Chocolatey cannot install any paid or licensed software. For example, suppose you want to install Adobe Photoshop. In this case, Adobe does not allow you to distribute Photoshop directly through Chocolatey.

What you can't do

# Not works!
choco install photoshop

This command will not work because there is no official package named photoshop. However, there are legal and right ways. You can install Adobe Creative Cloud.

choco install adobe-creative-cloud

Next, create an Adobe account on Creative Cloud to install Photoshop. Keep in mind that you need a subscription or license.

Simply put, the following categories of software can be easily installed using Chocolatey:

  • Browsers
  • Programming Tools
  • Media Players
  • Compression Tools
  • Database Tools
  • DevOps Software


Keep Learning

Want to dive deeper? Here's what to explore next:

  • Scoop – Another Windows package manager
  • Winget Configuration FilesYAML-based app configuration
  • DevOps Automation – Using Chocolatey with Ansible
  • Private Repositories – Creating your own package repository

Conclusion

Chocolatey is a time-saving tool for new Windows users. Although Microsoft itself has launched the Windows Package Manager (winget), Chocolatey is still the most trusted solution. However, the number of winget users is now growing very rapidly. In my opinion, winget and Chocolatey are equally excellent. So, master both of them.

Not just developers, but anyone can use Chocolatey to make software installation easier.

If you're not using Chocolatey yet, start today. Once you use it, you won't want to go back to manual installation.

Thank you for reading. If you have any problems with Chocolatey, don't hesitate to come back. Keep unknown commands away from PowerShell and set Execution Policy to restricted when done.

Happy Chocolatey Installing!

Post a Comment

0 Comments