Chocolatey is a free package manager for Windows that can be used to download and install software. Installing Chocolatey via PowerShell Before you can use...
Chocolatey is a free package manager for Windows that can be used to download and install software.
Installing Chocolatey via PowerShell
Before you can use Chocolatey from PowerShell, you need to download and install it. If you don’t have administrator privileges, use the script below. It downloads the installation script, checks its digital signature to ensure the file is legit, then runs it:
# download and save installation script, then check signature
$url='https://chocolatey.org/install.ps1'$outPath="$env:temp\installChocolatey.ps1"Invoke-WebRequest-UseBasicParsing-Uri$url-OutFile$outPath# test signature
$result=Get-AuthenticodeSignature-FilePath$outPathif ($result.Status-ne'Valid')
{
Write-Warning"Installation Script Damaged/Malware?"exit1
}
# install chocolatey for current user
$env:ChocolateyInstall='C:\ProgramData\chocoportable'Start-Process-FilePathpowershell-ArgumentList"-noprofile -noExit -ExecutionPolicy Bypass -File ""$outPath"""-Wait# clean up
Remove-Item-Path$outPath
The above script installs Chocolatey with no administrator privileges as a portable app. To use it, you need to temporarily add the installation folder to the Windows “Path” environment variable. Then run “choco” to test the installation. It reports back its version:
PS> $env:path += ";C:\ProgramData\chocoportable"
PS> choco
Chocolatey v0.10.8
Please run 'choco -?' or 'choco -?' for help menu.
PS>
We’ll take a look at how you can use Chocolatey to automatically download and install PowerShell Core 6, and use it side-by-side with your current Windows PowerShell installation.
Key Steps to Use Chocolatey Effectively
Meanwhile, visit https://chocolatey.org/packages?q=notepadplusplus to see what you can install via Chocolatey. Here are the key steps to consider when using Chocolatey:
Use a PowerShell console window. Do not use PowerShell hosts without a true console window (i.e. ISE)
Use an elevated PowerShell if possible. Many packages require full Administrator permissions to install software
Add the Chocolatey installation path to the “Path” environment variable
Once your environment is set up, check out how easy it is now to download and install utilities like Notepad++, for example: