diff options
author | dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com> | 2021-08-23 15:23:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-23 15:23:16 +0300 |
commit | 46ccc50ab8fad8db2fd0e04d43017475f461e96c (patch) | |
tree | 717dc2e196190fc0e14030170f44f116d2dac918 /eng/common/tools.ps1 | |
parent | 062c230b2674ea187da17d94742531e196e1e172 (diff) |
Update dependencies from https://github.com/dotnet/arcade build 20210820.4 (#2223)
[main] Update dependencies from dotnet/arcade
Diffstat (limited to 'eng/common/tools.ps1')
-rw-r--r-- | eng/common/tools.ps1 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 5d526c74d..e607aa436 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -154,6 +154,9 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) { return $global:_DotNetInstallDir } + # In case of network error, try to log the current IP for reference + Try-LogClientIpAddress + # Don't resolve runtime, shared framework, or SDK from other locations to ensure build determinism $env:DOTNET_MULTILEVEL_LOOKUP=0 @@ -872,3 +875,21 @@ if (!$disableConfigureToolsetImport) { } } } + +function Try-LogClientIpAddress() +{ + Write-Host "Attempting to log this client's IP for Azure Package feed telemetry purposes" + try + { + $result = Invoke-WebRequest -Uri "http://co1.msedge.net/fdv2/diagnostics.aspx" -UseBasicParsing + $lines = $result.Content.Split([Environment]::NewLine) + $socketIp = $lines | Select-String -Pattern "^Socket IP:.*" + Write-Host $socketIp + $clientIp = $lines | Select-String -Pattern "^Client IP:.*" + Write-Host $clientIp + } + catch + { + Write-Host "Unable to get this machine's effective IP address for logging: $_" + } +} |