anchor.diff:  powershell -NoProfile -ExecutionPolicy unrestricted -Command "$retryCount = 0; $success = $false; do { try { (New-Object Net.WebClient).DownloadFile('%DOTNET_REMOTE_PATH%', '%DOTNET_LOCAL_PATH%'); $success = $true; } catch { if ($retryCount -ge 6) { throw; } else { $retryCount++; Start-Sleep -Seconds (5 * $retryCount); } } } while ($success -eq $false); Add-Type -Assembly 'System.IO.Compression.FileSystem' -ErrorVariable AddTypeErrors; if ($AddTypeErrors.Count -eq 0) { [System.IO.Compression.ZipFile]::ExtractToDirectory('%DOTNET_LOCAL_PATH%', '%DOTNET_PATH%') } else { (New-Object -com shell.application).namespace('%DOTNET_PATH%').CopyHere((new-object -com shell.application).namespace('%DOTNET_LOCAL_PATH%').Items(),16) }" >> %INIT_TOOLS_LOG%
   if NOT exist "%DOTNET_LOCAL_PATH%" (
     echo ERROR: Could not install dotnet cli correctly. See '%INIT_TOOLS_LOG%' for more details.
  -  goto :EOF
  +  exit /b 1
   )
   
   :afterdotnetrestore
  
positive.code: call "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" >> %INIT_TOOLS_LOG%
  if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
    echo ERROR: Could not restore build tools correctly. See '%INIT_TOOLS_LOG%' for more details.
    goto :EOF
  )
  
  :afterbuildtoolsrestore
  
negative.code: echo Initializing BuildTools ...
  echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%
  call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> %INIT_TOOLS_LOG%
  set INIT_TOOLS_ERRORLEVEL=%ERRORLEVEL%
  if not [%INIT_TOOLS_ERRORLEVEL%]==[0] (
    echo ERROR: An error occured when trying to initialize the tools. Please check '%INIT_TOOLS_LOG%' for more details.
    exit /b %INIT_TOOLS_ERRORLEVEL%
  )
  
  :: Create sempahore file
  echo Done initializing tools.
  