Skip to content

Instantly share code, notes, and snippets.

@tao-zhang
Last active February 3, 2020 09:22
Show Gist options
  • Save tao-zhang/23b68c37bca63c67fc10cf0fe7d2886f to your computer and use it in GitHub Desktop.
Save tao-zhang/23b68c37bca63c67fc10cf0fe7d2886f to your computer and use it in GitHub Desktop.
# Download and install cygwin and some packages
function Install-Cygwin {
param ( $TempCygDir="$env:USERPROFILE\Downloads\cygInstall" )
if(!(Test-Path -Path $TempCygDir -PathType Container))
{
$null = New-Item -Type Directory -Path $TempCygDir -Force
}
$client = new-object System.Net.WebClient
$client.DownloadFile("https://cygwin.com/setup-x86_64.exe", "$TempCygDir\setup.exe" )
# Comma-separated list of packages you want goes at the end
Start-Process -wait -FilePath "$TempCygDir\setup.exe" -ArgumentList "-q -l $TempCygDir -R c:\Cygwin -P openssh, vim"
}
# 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