Skip to content

Instantly share code, notes, and snippets.

@AshFlaw
Created April 15, 2018 11:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save AshFlaw/af6f901ca9c074dcefe4f61163f6d3c0 to your computer and use it in GitHub Desktop.
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