fix: update DNS helper executable references and remove unused resolver logic
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
$DNSHelperURL = 'https://www.emberkom.com/tools/dnshelper.exe'
|
$DNSHelper = $Global:ToolsDirectory + '\ekdns.exe'
|
||||||
$DNSHelper = $Global:ToolsDirectory + '\dnshelper.exe'
|
|
||||||
If ( !(Test-Path $DNSHelper) ) {
|
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
|
Download-File -URL $DNSHelperURL -File $DNSHelper
|
||||||
}
|
}
|
||||||
$RefreshScript = $Global:ToolsDirectory + '\refresh-local-hosts.bat'
|
$RefreshScript = $Global:ToolsDirectory + '\refresh-local-hosts.bat'
|
||||||
@@ -13,13 +16,6 @@ REM Author: David Yoder, Emberkom LLC (Fix-UpdateLocalHosts.ps1)
|
|||||||
REM Updated: ${todaysDate}`n
|
REM Updated: ${todaysDate}`n
|
||||||
"@
|
"@
|
||||||
|
|
||||||
$Resolvers = @(
|
|
||||||
'1.1.1.1',
|
|
||||||
'8.8.8.8',
|
|
||||||
'1.0.0.1',
|
|
||||||
'8.8.4.4'
|
|
||||||
)
|
|
||||||
|
|
||||||
$Hosts = @(
|
$Hosts = @(
|
||||||
'auth.services.mspbackups.com',
|
'auth.services.mspbackups.com',
|
||||||
'ws.mspbackups.com'
|
'ws.mspbackups.com'
|
||||||
@@ -29,12 +25,6 @@ If ($BackupBucket.Length -ge 2 ) {
|
|||||||
$Hosts += $BackupBucket
|
$Hosts += $BackupBucket
|
||||||
}
|
}
|
||||||
|
|
||||||
$ResolverString = ''
|
|
||||||
ForEach ($Resolver in $Resolvers) {
|
|
||||||
If ($ResolverString.Length -gt 0) { $ResolverString = $ResolverString + ',' + $Resolver }
|
|
||||||
Else { $ResolverString = $Resolver }
|
|
||||||
}
|
|
||||||
|
|
||||||
$HostString = ''
|
$HostString = ''
|
||||||
ForEach ($Hostname in $Hosts) {
|
ForEach ($Hostname in $Hosts) {
|
||||||
If ($HostString.Length -gt 0) { $HostString = $HostString + ',' + $Hostname }
|
If ($HostString.Length -gt 0) { $HostString = $HostString + ',' + $Hostname }
|
||||||
@@ -42,7 +32,7 @@ ForEach ($Hostname in $Hosts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
If ( Test-Path $DNSHelper ) {
|
If ( Test-Path $DNSHelper ) {
|
||||||
$commandString = """${DNSHelper}"" add -host ${HostString} -server ${ResolverString}"
|
$commandString = """${DNSHelper}"" add -host ${HostString}"
|
||||||
$content = $RefreshScriptHeader + $commandString
|
$content = $RefreshScriptHeader + $commandString
|
||||||
Write-Output "Creating latest refresh script"
|
Write-Output "Creating latest refresh script"
|
||||||
If ( Test-Path $RefreshScript ) { Remove-Item -Path $RefreshScript -Force }
|
If ( Test-Path $RefreshScript ) { Remove-Item -Path $RefreshScript -Force }
|
||||||
|
|||||||
Reference in New Issue
Block a user