diff --git a/build.cmd b/build.cmd index b48ba765..42feedbc 100644 --- a/build.cmd +++ b/build.cmd @@ -3,7 +3,7 @@ cd %~dp0 IF EXIST .nuget\NuGet.exe goto part2 echo Downloading latest version of NuGet.exe... -@powershell -NoProfile -ExecutionPolicy unrestricted -Command "((new-object net.webclient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', '.nuget\NuGet.exe'))" +@powershell -NoProfile -ExecutionPolicy unrestricted -Command ".\build\downloadnuget.ps1" :part2 set EnableNuGetPackageRestore=true diff --git a/build/downloadnuget.ps1 b/build/downloadnuget.ps1 new file mode 100644 index 00000000..78ca8842 --- /dev/null +++ b/build/downloadnuget.ps1 @@ -0,0 +1,13 @@ +Set-PSDebug -Trace 1 +[System.Net.ServicePointManager]::SecurityProtocol +[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::TLS12 +[System.Net.ServicePointManager]::SecurityProtocol +try +{ + $client = New-Object System.Net.WebClient + $client.DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', '.nuget\NuGet.exe') +} +catch [System.Exception] +{ + $Error[0].Exception.ToString() +} \ No newline at end of file