U4-10006 - use Invoke-WebRequest, misc

This commit is contained in:
Stephan
2017-07-17 09:46:09 +02:00
parent f39531216c
commit bd0ca43b83
3 changed files with 17 additions and 8 deletions

View File

@@ -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"

View File

@@ -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"
}

View File

@@ -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 = (