Documentation
¶
Index ¶
- func BuildPowerShellCheckScript(checkScript string) (string, error)
- func CloneParams(params map[string]any) map[string]any
- func IsPowerShellCheckResultLine(line string) bool
- func JSONVarScript(name string, value any) (string, error)
- func NormalizeFirewallPorts(value any) (string, error)
- func NormalizePackageParams(params map[string]any) (map[string]any, error)
- func NormalizeRegistryParams(params map[string]any) (map[string]any, error)
- func NormalizeRemoveAppxParams(params map[string]any) (map[string]any, error)
- func NormalizeScheduledTaskParams(params map[string]any) (map[string]any, error)
- func NormalizeWingetParams(params map[string]any) (map[string]any, error)
- func ParseBool(v any) (bool, error)
- func ValidateScheduledTaskParams(params map[string]any) error
- type PowerShellCheckResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPowerShellCheckScript ¶
BuildPowerShellCheckScript wraps a user-authored check script and normalizes its return value into a compact JSON object for Go-side parsing.
func CloneParams ¶
CloneParams returns a shallow copy of params.
func JSONVarScript ¶
JSONVarScript emits a PowerShell snippet that reconstructs a Go value as a PowerShell variable through JSON + base64 encoding.
func NormalizeFirewallPorts ¶
NormalizeFirewallPorts canonicalizes firewall port values into the string format expected by the Windows firewall PowerShell cmdlets.
func NormalizePackageParams ¶
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 ¶
NormalizeRegistryParams canonicalizes registry value specs into a list form that is easy for PowerShell scripts to consume.
func NormalizeRemoveAppxParams ¶
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 ¶
NormalizeScheduledTaskParams applies aliases and defaults so both the local Windows module and the WinRM implementation use the same semantics.
func NormalizeWingetParams ¶
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 ValidateScheduledTaskParams ¶
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.