windows

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPowershellNotFound  = errors.New("powershell.exe not found")
	ErrUnsupportedCodePage = errors.New("unsupported code page")
)
View Source
var TempDir = getTempDir()

TempDir contains path to directory for temporary files. Can be not exists.

View Source
var Version = GetVersion()

Functions

func GetLocale

func GetLocale(shell *Powershell) *ms.Locale

GetLocale returns current locale set in hosted OS. If error occurred or returned value is empty, returns default locale.

func Install

func Install(file *ms.BundleFileInfo, shell *Powershell) error

Install package if its version higher that installed counterpart.

func MkDir

func MkDir(path string)

func Remove

func Remove(path string)

Types

type File

type File struct {
	*os.File
}

func NewFile

func NewFile(file *os.File) *File

func OpenFile

func OpenFile(path string, flag int) *File

func (*File) Close

func (f *File) Close()

func (*File) WriteString

func (f *File) WriteString(input string)

type Powershell

type Powershell struct {
	// contains filtered or unexported fields
}

func NewPowerShell added in v1.4.1

func NewPowerShell(params ...string) (*Powershell, error)

func (*Powershell) CodePage added in v1.4.1

func (s *Powershell) CodePage() int

func (*Powershell) Exec added in v1.4.1

func (s *Powershell) Exec(cmd string) (stdout string, err error)

func (*Powershell) Exit

func (s *Powershell) Exit() error

type WindowsVersion added in v1.4.1

type WindowsVersion int
const (
	W8 WindowsVersion = iota + 8
	W8d1
	W10
	W11
	Unsupported WindowsVersion = 0
)

func GetVersion added in v1.4.1

func GetVersion() WindowsVersion

Jump to

Keyboard shortcuts

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