How to Check if Chocolatey is Installed in PowerShell

Posted by

Step 1: Open PowerShell

  1. Click on the Start Menu and search for PowerShell.
  2. Right-click on Windows PowerShell and select Run as administrator.

Note: Running PowerShell as an administrator is recommended to avoid permission issues.

Step 2: Check Chocolatey Installation

Method 1: Using the choco -v Command

Type the following command in PowerShell and press Enter:

choco -v
  • If Chocolatey is installed, you will see an output displaying the installed version, like this: 1.2.3 (Example version)
  • If Chocolatey is not installed, you will see an error message saying that choco is not recognized.

Method 2: Checking the Installation Directory

Another way to check if Chocolatey is installed is by verifying its installation folder. Run this command:

Test-Path "$env:ProgramData\chocolatey"
  • If the output is True, Chocolatey is installed.
  • If the output is False, Chocolatey is not installed.

Step 3: What to Do If Chocolatey Is Not Installed?

If you find that Chocolatey is not installed, you can install it by following these steps:

  1. Open PowerShell as Administrator.
  2. Run the following command to install Chocolatey:

    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'))
  3. Once the installation completes, restart your PowerShell and verify Chocolatey installation using:
    choco -v
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x