Skip to content

Commit

Permalink
Ensure Powershell uses TLS 1.2 for NuGet.exe download
Browse files Browse the repository at this point in the history
  • Loading branch information
bentoi committed Jun 16, 2020
1 parent a3dd882 commit 81cbef9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config/ice.common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<!-- Custom task to download files -->
<!-- Nuget executable -->
<PropertyGroup>
<NugetExe>$(MSBuildThisFileDirectory)NuGet-5.4.0.exe</NugetExe>
<NugetURL>https://dist.nuget.org/win-x86-commandline/v5.4.0/nuget.exe</NugetURL>
<NugetExe>$(MSBuildThisFileDirectory)NuGet-5.6.0.exe</NugetExe>
<NugetURL>https://dist.nuget.org/win-x86-commandline/v5.6.0/nuget.exe</NugetURL>
</PropertyGroup>

<!-- Download nuget.exe if not present -->
<Target Name="GetNuget" Condition="!Exists('$(NugetExe)')">
<Exec Command="powershell -ExecutionPolicy ByPass -Command &quot;(New-Object Net.WebClient).DownloadFile('$(NugetURL)', '$(NugetExe)')&quot;"/>
<Exec Command="powershell -ExecutionPolicy ByPass -Command &quot;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;(New-Object Net.WebClient).DownloadFile('$(NugetURL)', '$(NugetExe)')&quot;"/>
</Target>
</Project>

0 comments on commit 81cbef9

Please sign in to comment.