diff --git a/Install.ps1 b/Install.ps1 index 107fe7e..166a27f 100644 --- a/Install.ps1 +++ b/Install.ps1 @@ -550,11 +550,11 @@ $testHosts = Test-Path -Path $pathHosts if ($testHosts) { $hosts = Get-Content -Path $pathHosts - if ($hosts -match '.+scdn.+' -or $hosts -match '.+spotify.+' ) { + if ($hosts -match '^[^\#| ].+scdn.+|^[^\#].+spotify.+') { Write-Host ($lang).HostDel`n try { - $hosts = $hosts -replace '.+scdn.+', '' -replace '.+spotify.+', '' + $hosts = $hosts -replace '^[^\#| ].+scdn.+|^[^\#| ].+spotify.+', '' Set-Content -Path $pathHosts -Value $hosts -Force $hosts | Where-Object { $_.trim() -ne "" } | Set-Content -Path $pathHosts -Force }