The default powershell for Windows 7 seems to be version 2. So the 'invoke-webrequest' doesn't work.
Maybe its better to use:
if not exist build\cygwin-x86.exe powershell -Command "$WebClient = New-Object System.Net.WebClient; $WebClient.DownloadFile('https://cygwin.com/setup-x86.exe','build\cygwin-x86.exe')"
The default powershell for Windows 7 seems to be version 2. So the 'invoke-webrequest' doesn't work. Maybe its better to use: if not exist build\cygwin-x86.exe powershell -Command "$WebClient = New-Object System.Net.WebClient; $WebClient.DownloadFile('https://cygwin.com/setup-x86.exe','build\cygwin-x86.exe')"