From ac97c888767a6d8343b96af47d05c056951dcee8 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Tue, 7 May 2024 02:19:29 +0700 Subject: [PATCH] cmd/cli: do not get windows feature for checking DNS installed "Get-WindowsFeature -Name DNS" is slow to run, and seems to make low resources Windows VM slow down so much. --- cmd/cli/cli.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cmd/cli/cli.go b/cmd/cli/cli.go index 7872abd..4d48b23 100644 --- a/cmd/cli/cli.go +++ b/cmd/cli/cli.go @@ -2450,11 +2450,6 @@ func powershell(cmd string) ([]byte, error) { // windowsHasLocalDnsServerRunning reports whether we are on Windows and having Dns server running. func windowsHasLocalDnsServerRunning() bool { if runtime.GOOS == "windows" { - out, _ := powershell("Get-WindowsFeature -Name DNS") - if !bytes.Contains(bytes.ToLower(out), []byte("installed")) { - return false - } - _, err := powershell("Get-Process -Name DNS") return err == nil }