parsing

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package parsing provides functions for parsing Windows specific data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeCliXmlErr

func DecodeCliXmlErr(text string) (string, error)

DecodeCliXmlErr converts a CLIXML error string to a human-readable PowerShell error message.

func EncodePwshCmd

func EncodePwshCmd(cmd string) (string, error)

EncodePwshCmd encodes a powershell command to be executed on a Windows machine. It encodes the command to UTF-16-LE and then to base64. It returns a valid powershell.exe command with no profile and the encoded command.

Types

type DotnetTime

type DotnetTime struct {
	time.Time
}

DotnetTime is a custom time type that embeds the time.Time type. It is designed to handle the unmarshalling of dotnet JSON datetime strings in the format "\"/Date(timestamp)/\"" when used as a field in a struct that is being unmarshalled from JSON.

func (*DotnetTime) UnmarshalJSON

func (t *DotnetTime) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for the DotnetTime type. It parses a JSON-encoded dotnet JSON datetime string and converts it into a DotnetTime object. The input byte slice is expected to represent a dotnet JSON datetime string in the format "\"/Date(timestamp)/\"".

Jump to

Keyboard shortcuts

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