From 7b6b0d5be72ad90abecf13d82c807407ef70bc80 Mon Sep 17 00:00:00 2001 From: Milos Curcic Date: Wed, 17 Jun 2020 16:08:57 +0200 Subject: [PATCH] Fixed bugs introduced by previous commit --- ReducedSQLConnectivityChecker.ps1 | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/ReducedSQLConnectivityChecker.ps1 b/ReducedSQLConnectivityChecker.ps1 index 161724e..e9a4334 100644 --- a/ReducedSQLConnectivityChecker.ps1 +++ b/ReducedSQLConnectivityChecker.ps1 @@ -159,10 +159,10 @@ function PrintLocalNetworkConfiguration() { $properties = $networkInterface.GetIPProperties() - Write-Output ' Interface name: ' $networkInterface.Name - Write-Output ' Interface description: ' $networkInterface.Description - Write-Output ' Interface type: ' $networkInterface.NetworkInterfaceType - Write-Output ' Operational status: ' $networkInterface.OperationalStatus + Write-Output ' Interface name: ' + $networkInterface.Name + Write-Output ' Interface description: ' + $networkInterface.Description + Write-Output ' Interface type: ' + $networkInterface.NetworkInterfaceType + Write-Output ' Operational status: ' + $networkInterface.OperationalStatus Write-Output ' Unicast address list:' Write-Output $(' ' + [String]::Join([Environment]::NewLine + ' ', [System.Linq.Enumerable]::Select($properties.UnicastAddresses, [Func[System.Net.NetworkInformation.UnicastIPAddressInformation, IPAddress]] { $args[0].Address }))) @@ -176,16 +176,16 @@ function PrintLocalNetworkConfiguration() { function PrintDNSResults($dnsResult, [string] $dnsSource) { if ($dnsResult) { - Write-Output ' Found DNS record in' $dnsSource '(IP Address:'$dnsResult.IPAddress')' + Write-Output ' Found DNS record in' + $dnsSource + '(IP Address:' + $dnsResult.IPAddress + ')' } else { - Write-Output ' Could not find DNS record in' $dnsSource + Write-Output ' Could not find DNS record in' + $dnsSource } } function ValidateDNS([String] $Server) { Try { - Write-Output 'Validating DNS record for' $Server + Write-Output 'Validating DNS record for' + $Server $DNSfromHosts = Resolve-DnsName -Name $Server -CacheOnly -ErrorAction SilentlyContinue PrintDNSResults $DNSfromHosts 'hosts file' @@ -292,6 +292,5 @@ try { [TDSClient.TDS.Utilities.LoggingUtilities]::ClearVerboseLog() } } catch { - -} finally { + Write-Output $_.Exception.Message } \ No newline at end of file