Created
July 7, 2013 22:09
-
-
Save scarolan/5945168 to your computer and use it in GitHub Desktop.
Powershell code for installing cygwin packages.
This file contains hidden or 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
# Download and install cygwin and some packages | |
function Install-Cygwin { | |
param ( $TempCygDir="$env:temp\cygInstall" ) | |
if(!(Test-Path -Path $TempCygDir -PathType Container)) | |
{ | |
$null = New-Item -Type Directory -Path $TempCygDir -Force | |
} | |
$client = new-object System.Net.WebClient | |
$client.DownloadFile("http://cygwin.com/setup.exe", "$TempCygDir\setup.exe" ) | |
# This does a vanilla installation of Cygwin | |
Start-Process -wait -FilePath "$TempCygDir\setup.exe" -ArgumentList "-q -n -l $TempCygDir -s http://mirrors.kernel.org/sourceware/cygwin/ -R c:\Cygwin" | |
# Comma-separated list of packages you want goes at the end | |
Start-Process -wait -FilePath "$TempCygDir\setup.exe" -ArgumentList "-q -n -l $TempCygDir -s http://mirrors.kernel.org/sourceware/cygwin/ -R c:\Cygwin -P openssh, cygrunsrv, ncurses, vim, python, ruby, cron" | |
} | |
# then you just run it! | |
Install-Cygwin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment