func PrepareOneLiner(oneliner string, environment TLSEnvironment, target string) (string, error) {
	insecureTLS := ""
	if environment.Certificate != "" {
		if strings.HasSuffix(target, ShellTarget) {
			insecureTLS = InsecureShellTLS
		} else if strings.HasSuffix(target, PowershellTarget) {
			insecureTLS = InsecurePowershellTLS
		}
	}
	secretPath := environment.RemoveSecretPath
	if strings.HasPrefix(target, EnrollTarget) {
		secretPath = environment.EnrollSecretPath
	}
	t, err := template.New(target).Parse(oneliner)
	if err != nil {
		return "", err
	}
	data := struct {
		TLSHost     string
		Environment string
		SecretPath  string
		InsecureTLS string
	}{
		TLSHost:     environment.Hostname,
		Environment: environment.UUID,
		SecretPath:  secretPath,
		InsecureTLS: insecureTLS,
	}
	var tpl bytes.Buffer
	if err := t.Execute(&tpl, data); err != nil {
		return "", err
	}
	return tpl.String(), nil
}
PrepareOneLiner generic to generate  one-liners
package environments
import (
	"bytes"
	"strings"
	"text/template"
)
const (
	InsecureShellTLS = "k"
	InsecurePowershellTLS = "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true};"
)
const (
	ShellTarget = ".sh"
	PowershellTarget = ".ps1"
	EnrollTarget = "enroll"
	RemoveTarget = "remove"
	EnrollShell = EnrollTarget + ShellTarget
	RemoveShell = RemoveTarget + ShellTarget
	EnrollPowershell = EnrollTarget + PowershellTarget
	RemovePowershell = RemoveTarget + PowershellTarget
)