diff --git a/build/Modules/Umbraco.Build/Build-UmbracoDocs.ps1 b/build/Modules/Umbraco.Build/Build-UmbracoDocs.ps1 index 41b261ea55..23041cd3ec 100644 --- a/build/Modules/Umbraco.Build/Build-UmbracoDocs.ps1 +++ b/build/Modules/Umbraco.Build/Build-UmbracoDocs.ps1 @@ -104,8 +104,7 @@ function Get-DocFx($uenv, $buildTemp) { Write-Host "Download DocFx..." $source = "https://github.com/dotnet/docfx/releases/download/v2.19.2/docfx.zip" - $client = new-object Net.WebClient - $client.DownloadFile($source, "$buildTemp\docfx.zip") + Invoke-WebRequest $source -OutFile "$buildTemp\docfx.zip" &$uenv.Zip x "$buildTemp\docfx.zip" -o"$buildTemp\docfx" -aos > $nul Remove-File "$buildTemp\docfx.zip" diff --git a/build/Modules/Umbraco.Build/Get-UmbracoBuildEnv.ps1 b/build/Modules/Umbraco.Build/Get-UmbracoBuildEnv.ps1 index 2ec4b3f592..b2cd63306d 100644 --- a/build/Modules/Umbraco.Build/Get-UmbracoBuildEnv.ps1 +++ b/build/Modules/Umbraco.Build/Get-UmbracoBuildEnv.ps1 @@ -14,7 +14,7 @@ function Get-UmbracoBuildEnv { mkdir $path > $null } - + # ensure we have NuGet $nuget = "$path\nuget.exe" $source = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" @@ -25,8 +25,7 @@ function Get-UmbracoBuildEnv if (-not (test-path $nuget)) { Write-Host "Download NuGet..." - $client = new-object Net.WebClient - $client.DownloadFile($source, $nuget) + Invoke-WebRequest $source -OutFile $nuget } # ensure we have 7-Zip @@ -98,8 +97,7 @@ function Get-UmbracoBuildEnv if (-not (test-path $node)) { Write-Host "Download Node..." - $client = new-object Net.WebClient - $client.DownloadFile($source, "$path\node-v6.9.1-win-x86.7z") + Invoke-WebRequest $source -OutFile "$path\node-v6.9.1-win-x86.7z" &$sevenZip x "$path\node-v6.9.1-win-x86.7z" -o"$path" -aos > $nul Remove-File "$path\node-v6.9.1-win-x86.7z" } diff --git a/build/Modules/Umbraco.Build/Verify-NuGet.ps1 b/build/Modules/Umbraco.Build/Verify-NuGet.ps1 index dd6eb9ef01..1a2239393c 100644 --- a/build/Modules/Umbraco.Build/Verify-NuGet.ps1 +++ b/build/Modules/Umbraco.Build/Verify-NuGet.ps1 @@ -357,7 +357,19 @@ function Verify-NuGet $uenv.Semver ) - add-type -referencedAssemblies $assem -typeDefinition $source -language CSharp + try + { + # as long as the code hasn't changed it's fine to re-add, but if the code + # has changed this will throw - better warn the dev that we have an issue + add-type -referencedAssemblies $assem -typeDefinition $source -language CSharp + } + catch + { + if ($_.FullyQualifiedErrorId.StartsWith("TYPE_ALREADY_EXISTS,")) + { Write-Error "Failed to add type, did you change the code?" } + else + { Write-Error $_ } + } if (-not $?) { break } $nuspecs = (