powershell

package
v0.19.11 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunCommand

func RunCommand(command string) ([]byte, error)

RunCommand executes a given powershell command.

When the command throws a powershell exception, RunCommand will return the exception message as error.

func RunCommandWithJsonResult

func RunCommandWithJsonResult(command string, v interface{}) error

RunCommandWithJsonResult executes a given powershell command. The command will be wrapped with ConvertTo-Json.

You can Wrap your command with @(<cmd>) to ensure that the returned json is an array

When the command throws a powershell exception, RunCommandf will return the exception message as error.

func RunCommandf

func RunCommandf(command string, a ...interface{}) ([]byte, error)

RunCommandf executes a given powershell command. Command argument formats according to a format specifier (See fmt.Sprintf).

When the command throws a powershell exception, RunCommandf will return the exception message as error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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