Instantly share code, notes, and snippets.

Embed
What would you like to do?
PowerShell function to install Chocolatey if it isn't already.
Function Install-Choco
{
Set-ExecutionPolicy Bypass -force
If (!(Test-Path -Path "C:\ProgramData\chocolatey"))
{
$env:chocolateyUseWindowsCompression = 'false'
Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression
choco feature enable -n=allowGlobalConfirmation
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment