From 8725ee9de394f1505c37646c4d3333e2d116a81c Mon Sep 17 00:00:00 2001 From: ScottNZ Date: Sat, 27 Dec 2014 22:05:54 +1300 Subject: [PATCH] Make fetch-thirdparty-deps.ps1 work on more Windows platforms. --- thirdparty/fetch-thirdparty-deps.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/thirdparty/fetch-thirdparty-deps.ps1 b/thirdparty/fetch-thirdparty-deps.ps1 index 9dfa7fef54..cf126af0c6 100644 --- a/thirdparty/fetch-thirdparty-deps.ps1 +++ b/thirdparty/fetch-thirdparty-deps.ps1 @@ -1,7 +1,10 @@ if (!(Test-Path "nuget.exe")) { echo "Fetching NuGet." - Invoke-WebRequest "http://nuget.org/nuget.exe" -OutFile "nuget.exe" + # Work around PowerShell's Invoke-WebRequest not being available on some versions of PowerShell by using the BCL. + # To do that we need to work around further and use absolute paths because DownloadFile is not aware of PowerShell's current directory. + $target = Join-Path $pwd.ToString() "nuget.exe" + (New-Object System.Net.WebClient).DownloadFile("http://nuget.org/nuget.exe", $target) } if (!(Test-Path "StyleCop.dll"))