Files
sailpoint-cli/internal/util/exec_windows.go
2022-12-21 00:28:50 -06:00

21 lines
499 B
Go

// Copyright (c) 2021, SailPoint Technologies, Inc. All rights reserved.
//go:build windows
// +build windows
package util
import (
"os/exec"
"syscall"
)
// ExecCommand runs commands on windows environment with CREATE_NEW_PROCESS_GROUP flag,
// equivalent to Setpgid in linux like environment
func ExecCommand(name string, arg ...string) error {
cmd := exec.Command(name, arg...)
cmd.SysProcAttr = &syscall.SysProcAttr{CreationFlags: syscall.CREATE_NEW_PROCESS_GROUP}
return cmd.Start()
}