powershell

package
v4.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Rendered for windows/amd64

Overview

Package powershell wraps Windows Powershell cmdlets

Package powershell wraps Windows Powershell cmdlets

Index

Constants

View Source
const (
	// MinimumGPTSize represents the minimum GPT size (i.e. 128 MiB)
	MinimumGPTSize = 128 * 1024 * 1024

	// PartitionStyleMBR is used to initialize a disk with the MBR partitioning style
	PartitionStyleMBR = "MBR"

	// PartitionStyleGPT is used to initialize a disk with the GPT partitioning style
	PartitionStyleGPT = "GPT"

	// TimeoutPartitionAndFormatVolume specifies the partition and format cmdlet timeout (in seconds)
	TimeoutPartitionAndFormatVolume = 5 * 60
)

Variables

This section is empty.

Functions

func AddPartitionAccessPath

func AddPartitionAccessPath(accessPath string, diskNumber uint32, partitionNumber uint32) (string, int, error)

AddPartitionAccessPath wraps the Add-PartitionAccessPath cmdlet

func ClearDisk

func ClearDisk(diskNumber int, removeData bool) (string, int, error)

ClearDisk wraps the Clear-Disk cmdlet

func InitializeDisk

func InitializeDisk(path string, partitionStyle string) (string, int, error)

InitializeDisk wraps the Initialize-Disk cmdlet. We only need the ability to create GPT partitions which is why this routine doesn't expose the option to select the partition style.

func PartitionAndFormatVolume

func PartitionAndFormatVolume(diskPath string, fileSystem string) (string, int, error)

PartitionAndFormatVolume wraps the New-Partition and Format-Volume cmdlets to allow the caller to create and format a volume with the specified file system. If no file system is passed in, we default to NTFS.

func RemovePartitionAccessPath

func RemovePartitionAccessPath(accessPath string, diskNumber uint32, partitionNumber uint32) (string, int, error)

RemovePartitionAccessPath wraps the Remove-PartitionAccessPath cmdlet

func SetDiskOffline

func SetDiskOffline(path string, isOffline bool) (string, int, error)

SetDiskOffline wraps the Set-Disk cmdlet with the -Path and -IsOffline options

func SetDiskReadOnly

func SetDiskReadOnly(path string, isReadonly bool) (string, int, error)

SetDiskReadOnly wraps the Set-Disk cmdlet with the -Path and -IsReadonly options

func UpdateDisk

func UpdateDisk(path string) (string, int, error)

UpdateDisk wraps the Update-Disk cmdlet with the -Path option

Types

This section is empty.

Jump to

Keyboard shortcuts

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