winutil

package
v1.0.0-beta.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2026 License: ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPowerShellCheckScript

func BuildPowerShellCheckScript(checkScript string) (string, error)

BuildPowerShellCheckScript wraps a user-authored check script and normalizes its return value into a compact JSON object for Go-side parsing.

func CloneParams

func CloneParams(params map[string]any) map[string]any

CloneParams returns a shallow copy of params.

func IsPowerShellCheckResultLine

func IsPowerShellCheckResultLine(line string) bool

func JSONVarScript

func JSONVarScript(name string, value any) (string, error)

JSONVarScript emits a PowerShell snippet that reconstructs a Go value as a PowerShell variable through JSON + base64 encoding.

func NormalizeFirewallPorts

func NormalizeFirewallPorts(value any) (string, error)

NormalizeFirewallPorts canonicalizes firewall port values into the string format expected by the Windows firewall PowerShell cmdlets.

func NormalizePackageParams

func NormalizePackageParams(params map[string]any) (map[string]any, error)

NormalizePackageParams accepts either a "packages" list or the legacy single-package form ("product_id" at the top level) and returns a params map with a canonical "packages" key.

func NormalizeRegistryParams

func NormalizeRegistryParams(params map[string]any) (map[string]any, error)

NormalizeRegistryParams canonicalizes registry value specs into a list form that is easy for PowerShell scripts to consume.

func NormalizeRemoveAppxParams

func NormalizeRemoveAppxParams(params map[string]any) (map[string]any, error)

NormalizeRemoveAppxParams accepts either a "packages" list or the legacy single-package form ("name" at the top level) and returns a params map with a canonical "packages" key.

func NormalizeScheduledTaskParams

func NormalizeScheduledTaskParams(params map[string]any) (map[string]any, error)

NormalizeScheduledTaskParams applies aliases and defaults so both the local Windows module and the WinRM implementation use the same semantics.

func NormalizeWingetParams

func NormalizeWingetParams(params map[string]any) (map[string]any, error)

NormalizeWingetParams accepts either a "packages" list or the legacy single-package form ("id" at the top level) and returns a params map with a canonical "packages" key.

func ParseBool

func ParseBool(v any) (bool, error)

ParseBool accepts common bool-like values used in Windows module params.

func ValidateScheduledTaskParams

func ValidateScheduledTaskParams(params map[string]any) error

ValidateScheduledTaskParams checks the normalized scheduled task parameter contract shared by the local Windows module and the WinRM implementation.

Types

type PowerShellCheckResult

type PowerShellCheckResult struct {
	NeedsChange bool   `json:"needs_change"`
	Message     string `json:"message,omitempty"`
}

PowerShellCheckResult is the normalized result emitted by the wrapped powershell check_script contract.

func ParsePowerShellCheckOutput

func ParsePowerShellCheckOutput(out []byte) (PowerShellCheckResult, []string, error)

func ParsePowerShellCheckResult

func ParsePowerShellCheckResult(out []byte) (PowerShellCheckResult, error)

ParsePowerShellCheckResult decodes the normalized JSON emitted by BuildPowerShellCheckScript.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL