Powershell Disk Management

List drives (Get-Disk)

> Get-Disk

List physical drives (Get-physicalDisk)

> Get-physicalDisk

List partitions (Get-Partition)

> Get-Partition
> Get-Partition -DiskNumber 5

List volumes (Get-Volume)

> Get-Volume -DriveLetter C
> Get-Volume | Sort-Object -Descending SizeRemaining

Initialize disk (Initialize-Disk)

> Initialize-Disk
> Initialize-Disk -Number 1 -PartitionStyle MBR

New partition (New-Partition)

> New-Partition
> New-Partition -UseMaximumSize -DiskNumber 1 -DriveLetter Z
> New-Partition -Size 100MB -DiskNumber 1 -DriveLetter X

Set partition (Set-Partition)

> Set-Partition
> Set-Partition -DriveLetter C -NewDriveLetter Y

Format volume (Format-Volume)

> Format-Volume -DriveLetter F
> Format-Volume -DriveLetter F -FileSystem NTFS -NewFileSystemLabel "New name"
> Format-Volume -DriveLetter F -FileSystem FAT32 -Full -Force

Remove-Partition (Remove-Partition)

> Remove-Partition -DriveLetter F
> Remove-Partition -DiskNumber 5 -PartitionNumber 2