diff --git a/Fix-UpdateLocalHosts.ps1 b/Fix-UpdateLocalHosts.ps1 index 252d017..4a99be0 100644 --- a/Fix-UpdateLocalHosts.ps1 +++ b/Fix-UpdateLocalHosts.ps1 @@ -1,6 +1,9 @@ -$DNSHelperURL = 'https://www.emberkom.com/tools/dnshelper.exe' -$DNSHelper = $Global:ToolsDirectory + '\dnshelper.exe' +$DNSHelper = $Global:ToolsDirectory + '\ekdns.exe' If ( !(Test-Path $DNSHelper) ) { + $DNSHelperURL = 'https://www.emberkom.com/tools/ekdns-x64.exe' + If !(Test-Path ${Env:ProgramFiles(x86)}) { + $DNSHelperURL = 'https://www.emberkom.com/tools/ekdns-x86.exe' + } Download-File -URL $DNSHelperURL -File $DNSHelper } $RefreshScript = $Global:ToolsDirectory + '\refresh-local-hosts.bat' @@ -13,13 +16,6 @@ REM Author: David Yoder, Emberkom LLC (Fix-UpdateLocalHosts.ps1) REM Updated: ${todaysDate}`n "@ -$Resolvers = @( - '1.1.1.1', - '8.8.8.8', - '1.0.0.1', - '8.8.4.4' -) - $Hosts = @( 'auth.services.mspbackups.com', 'ws.mspbackups.com' @@ -29,12 +25,6 @@ If ($BackupBucket.Length -ge 2 ) { $Hosts += $BackupBucket } -$ResolverString = '' -ForEach ($Resolver in $Resolvers) { - If ($ResolverString.Length -gt 0) { $ResolverString = $ResolverString + ',' + $Resolver } - Else { $ResolverString = $Resolver } -} - $HostString = '' ForEach ($Hostname in $Hosts) { If ($HostString.Length -gt 0) { $HostString = $HostString + ',' + $Hostname } @@ -42,7 +32,7 @@ ForEach ($Hostname in $Hosts) { } If ( Test-Path $DNSHelper ) { - $commandString = """${DNSHelper}"" add -host ${HostString} -server ${ResolverString}" + $commandString = """${DNSHelper}"" add -host ${HostString}" $content = $RefreshScriptHeader + $commandString Write-Output "Creating latest refresh script" If ( Test-Path $RefreshScript ) { Remove-Item -Path $RefreshScript -Force }