Skip to content

Instantly share code, notes, and snippets.

@KyleGobel
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KyleGobel/4e6a7a1a52bbf9dd1636 to your computer and use it in GitHub Desktop.
Save KyleGobel/4e6a7a1a52bbf9dd1636 to your computer and use it in GitHub Desktop.
Chocolatey Setup Server Script
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="GoogleChrome" />
<package id="SublimeText3" />
<package id="SublimeText3.PowershellAlias" />
<package id="SpaceSniffer" />
<package id="Powershell" />
<package id="pscx" />
<package id="Putty" />
<package id="7zip.commandline" />
<package id="scriptcs" />
<package id="python" />
<package id="dotnet4.5.1" />
<package id="cmder" />
<package id="webdeploy" />
</packages>
#rem copy paste this to a command prompt
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://kylegobel.com/dev-setup'))"
function Install-NeededFor {
param([string]$packageName = '')
if ($packageName -eq '') {return $false}
$yes = '6'
$no = '7'
$msgBoxTimeout='-1'
$answer = $msgBoxTimeout
try {
$timeout = 10
$question = "Do you need to install $($packageName)? Defaults to 'Yes' after $timeout seconds"
$msgBox = New-Object -ComObject WScript.Shell
$answer = $msgBox.Popup($question, $timeout, "Install $packageName", 0x4)
}
catch {
}
if ($answer -eq $yes -or $answer -eq $msgBoxTimeout) {
write-host 'returning true'
return $true
}
return $false
}
#install chocolatey
if (Install-NeededFor 'chocolatey') {
iex ((new-object net.webclient).DownloadString('http://bit.ly/psChocInstall'))
}
if (Install-NeededFor 'Kyles Dev Env') {
$file = Join-Path $pwd 'packages.config'
$url = 'https://gist.githubusercontent.com/KyleGobel/4e6a7a1a52bbf9dd1636/raw/packages.config'
((new-object net.webclient).DownloadFile($url, $file))
cinst $file
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment