powershell

package
v0.154.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatHashTable

func FormatHashTable(table []KeyValue, variableName string) string

FormatHashTable formats table as a PowerShell hashtable. The caller is responsible for ensuring variableName is a valid PowerShell variable name and the key-value pairs can be surrounded by single-quoted strings.

func FormatParams

func FormatParams(params []KeyValue) string

FormatParams formats params into `-key "value"`, ignoring keys with empty values.

func FormatStringVariables

func FormatStringVariables(params []KeyValue) string

FormatStringVariables formats params as PowerShell string variables. The caller is responsible for ensuring the keys are valid PowerShell variable names and the values can be surrounded by single-quoted strings.

func JoinVariables

func JoinVariables(variables ...string) string

JoinVariables joins the specified variables.

func ToCLIArgs

func ToCLIArgs(params []KeyValue) string

ToCLIArgs formats params as CLI arguments.

Types

type KeyValue

type KeyValue struct {
	Key   string
	Value string
}

A KeyValue holds a key-value pair.

Jump to

Keyboard shortcuts

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