Managing disk partitions is an essential aspect of maintaining a Windows operating system. Whether you need to check available partitions, resize them, or create new ones, having a good understanding of the system's storage layout is important. This tutorial explains how to get all disk partitions on Windows.
PowerShell provides a command called Get-Partition
that allows retrieving detailed information about all disk partitions on the Windows computer.
Use the Get-Partition
command without any arguments to retrieve information about all partitions on all disks.
Get-Partition
Here's an example of the output you might see when you run the command:
DiskPath: \\?\scsi#disk&ven_nvme&prod_samsung_ssd_990#4&3624ca1&0&000000#{XXXXXX-XXXX-...}
PartitionNumber DriveLetter Offset Size Type
--------------- ----------- ------ ---- ----
1 1048576 100 MB System
2 105906176 16 MB Reserved
3 C 122683392 200 GB Basic
4 D 214875242496 1.62 TB Basic
It is also possible to get all partitions on the specified disk only. For example, the following command retrieves all partitions located on disk number 0:
Get-Partition –DiskNumber 0
Leave a Comment
Cancel reply