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 Encodings = map[int]encoding.Encoding{ 1200: unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM), 1201: unicode.UTF16(unicode.BigEndian, unicode.IgnoreBOM), 1252: charmap.Windows1252, 65001: unicode.UTF8, }
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.
Types ¶
type File ¶
func (*File) WriteString ¶
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
Click to show internal directories.
Click to hide internal directories.