This tutorials shows how to install Choco tool on windows

To install Choco on Windows, Following are prerequisites

  • PowerShell 2.x
  • .NET Framework 4.8 or more
  • Windows 10 or Server 8.x or higher

Installation

Open Powershell in Adminsitrative mode. Administrative mode is required to install any software.

  • Go to Start Menu, and type “Windows PowerShell”, Right click on selecting this.
  • Context Menu appears, Select “Run as Administrator”
  • It opens Powershell command line
  • By default ExecutionPolicy is restricted, does not allow to install any package, so we need to set it to Bypass.
  • Check if ExecutionPolicy is set to Bypass or not
Get-ExecutionPolicy

If the above command gives Restricted, then we need to set it to Bypass

PS C:\WINDOWS\system32> Set-ExecutionPolicy AllSigned

Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): y
Set-ExecutionPolicy : Windows PowerShell updated your execution policy successfully, but the setting is overridden by
a policy defined at a more specific scope.  Due to the override, your shell will retain its current effective
execution policy of Unrestricted. Type "Get-ExecutionPolicy -List" to view your execution policy settings. For more
information please see "Get-Help Set-ExecutionPolicy".
At line:1 char:1
+ Set-ExecutionPolicy AllSigned
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : PermissionDenied: (:) [Set-ExecutionPolicy], SecurityException
    + FullyQualifiedErrorId : ExecutionPolicyOverride,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand
  • Enter the below command to set it to Bypass
  • Enter below scripts and click 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'))```

- It displays `Chocolatey has been installed` if there are no errors


Check choco is installed or not using below

C:>choco Chocolatey v2.1.0 Please run ‘choco -?’ or ‘choco -?’ for help menu.





## How to install Chocolatey UI in Windows

## Fix for choco not recognized command

By default choco installation,Changes the path in windows environment variable.

You can check Environment variables Such as System variable or User variable, and PATH variable contains a path to installed choco location(`C:\programfiles\chocolatey\choco.exe;`).

If PATH does not contains choco path, It will not work.