Chocolatey is a free package manager for Windows that can be used to download and install software.
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 $outPath
if ($result.Status -ne 'Valid')
Write-Warning "Installation Script Damaged/Malware?"
# install chocolatey for current user
Start-Process -FilePath powershell -ArgumentList "-noprofile -noExit -ExecutionPolicy Bypass -File ""$outPath""" -Wait
# clean up
Remove-Item -Path $outPath
To view more installation options, please visit https://chocolatey.org/install.
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"
Please run 'choco -?' or 'choco -?' for help menu.
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.
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:
Once your environment is set up, check out how easy it is now to download and install utilities like Notepad++, for example:
PS C:\> $env:path += ";C:\ProgramData\chocoportable"
PS C:\> choco install notepadplusplus -y
[Pending] Removing incomplete install for 'notepadplusplus'
Installing the following packages:
By installing you accept licenses for the packages.
notepadplusplus.install v7.5.6 [Approved]
notepadplusplus.install package files install completed. Performing ot
her installation steps.
Installing 64-bit notepadplusplus.install...
notepadplusplus.install has been installed.
notepadplusplus.install installed to 'C:\Program Files\Notepad++'
Added C:\ProgramData\chocoportable\bin\notepad++.exe shim pointed to '
notepadplusplus.install may be able to be automatically uninstalled.
The install of notepadplusplus.install was successful.
Software installed as 'exe', install location is likely default.
notepadplusplus v7.5.6 [Approved]
notepadplusplus package files install completed. Performing other inst
The install of notepadplusplus was successful.
Software install location not explicitly set, could be in package or
default install location if installer.
Chocolatey installed 2/2 packages.
See the log for details (C:\ProgramData\chocoportable\logs\chocolatey
Once Chocolatey finished installing Notepad++, simply press Win+R, and in the “Run” dialog, enter Notepad++ The editor launches.
ReTweet this Tip!
This is already in PoSH v5x and 6x. Just type Find-Module. It use PowerShellGet (previously known as OneGet)
Avaialbe since circa 2014 --- Package Management for PowerShell Modules with PowerShellGet --- 'blogs.msdn.microsoft.com/mvpawardprogram/2014/10/06/package-management-for-powershell-modules-with-powershellget'
You'd need a minimum of PoSH v4 to use it, and for PoSH v4 you have to install it.
Why not just use OneGet provider for Chocolatey for all installs etc?
Chocaolatey signature out of date?