zabbix/templates/entrypoints/internal/hooks/command_windows.go
2026-07-15 17:51:41 +09:00

19 lines
422 B
Go

package hooks
import (
"os"
"path/filepath"
"strings"
)
func command(path string, _ os.FileMode) ([]string, bool) {
switch strings.ToLower(filepath.Ext(path)) {
case ".ps1":
return []string{"pwsh.exe", "-NoLogo", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-File", path}, true
case ".cmd", ".bat":
return []string{"cmd.exe", "/D", "/S", "/C", path}, true
default:
return nil, false
}
}