Documentation ¶
Overview ¶
Package powershell wraps Windows Powershell cmdlets
Package powershell wraps Windows Powershell cmdlets
Index ¶
- Constants
- func AddPartitionAccessPath(accessPath string, diskNumber uint32, partitionNumber uint32) (string, int, error)
- func ClearDisk(diskNumber int, removeData bool) (string, int, error)
- func InitializeDisk(path string, partitionStyle string) (string, int, error)
- func PartitionAndFormatVolume(diskPath string, fileSystem string) (string, int, error)
- func RemovePartitionAccessPath(accessPath string, diskNumber uint32, partitionNumber uint32) (string, int, error)
- func SetDiskOffline(path string, isOffline bool) (string, int, error)
- func SetDiskReadOnly(path string, isReadonly bool) (string, int, error)
- func UpdateDisk(path string) (string, int, error)
Constants ¶
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 InitializeDisk ¶
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 ¶
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 ¶
SetDiskOffline wraps the Set-Disk cmdlet with the -Path and -IsOffline options
func SetDiskReadOnly ¶
SetDiskReadOnly wraps the Set-Disk cmdlet with the -Path and -IsReadonly options
Types ¶
This section is empty.