mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
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.
This commit is contained in:
committed by
Cuong Manh Le
parent
a1fda2c0de
commit
ac97c88876
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user