I like having Cygwin installed on my machine, and since I always re-image, I needed a script to install Cygwin automatically.
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" ) Start-Process -wait -FilePath "$TempCygDir\setup.exe" -ArgumentList "-q -n -l $TempCygDir -s http://mirror.nyi.net/cygwin/ -R c:\Cygwin" Start-Process -wait -FilePath "$TempCygDir\setup.exe" -ArgumentList "-q -n -l $TempCygDir -s http://mirror.nyi.net/cygwin/ -R c:\Cygwin -P openssh" }
This will download and install Cygwin and install the openssh package.
A very useful little script. But you might want to unescape the " characters in your display. They make copy-pasting into PowerShell a bit of a hassle.
Done! Look right? WordPress messes with the quotes if I accidentally switch between HTML and Visual view. Thanks for taking the time to comment.