cmd/cli: fix typo in powershell command to get domain

This commit is contained in:
Cuong Manh Le
2024-09-30 18:17:12 +07:00
committed by Cuong Manh Le
parent e6f256d640
commit 8c661c4401
+1 -1
View File
@@ -34,7 +34,7 @@ func addExtraSplitDnsRule(lc *ctrld.ListenerConfig) {
// getActiveDirectoryDomain returns AD domain name of this computer. // getActiveDirectoryDomain returns AD domain name of this computer.
func getActiveDirectoryDomain() (string, error) { func getActiveDirectoryDomain() (string, error) {
cmd := "$obj = GetWmiObject Win32_ComputerSystem; if ($obj.PartOfDomain) { $obj.Domain }" cmd := "$obj = Get-WmiObject Win32_ComputerSystem; if ($obj.PartOfDomain) { $obj.Domain }"
output, err := powershell(cmd) output, err := powershell(cmd)
if err != nil { if err != nil {
return "", fmt.Errorf("failed to get domain name: %w, output:\n\n%s", err, string(output)) return "", fmt.Errorf("failed to get domain name: %w, output:\n\n%s", err, string(output))