diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 index c97b164c04..1be8718025 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 @@ -157,7 +157,7 @@ Describe "Test-Connection" -tags "CI" { It "ResolveDestination for address" { $result = Test-Connection $targetAddress -ResolveDestination -Count 1 - $resolvedName = [System.Net.DNS]::GetHostByName($targetName).HostName + $resolvedName = [System.Net.DNS]::GetHostEntry($targetAddress).HostName $result.Destination | Should -BeExactly $resolvedName $result.Replies[0].Address | Should -BeExactly $targetAddress