Last active
August 29, 2015 14:14
-
-
Save KyleGobel/4e6a7a1a52bbf9dd1636 to your computer and use it in GitHub Desktop.
Chocolatey Setup Server Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#rem copy paste this to a command prompt | |
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://kylegobel.com/dev-setup'))" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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