If you need to expand a disk partition on a Windows system (which has PowerShell) then you can quickly and efficiently do so with the following commands further down.
Step 1 – Use Get-Volume to identify the disk(s) which you want expanding:
PS C:\Windows\system32> Get-Volume DriveLetter FileSystemLabel FileSystem DriveType HealthStatus OperationalStatus SizeRemaining Size ----------- --------------- ---------- --------- ------------ ----------------- ------------- ---- E DATA NTFS Fixed Healthy OK 26.88 GB 39.87 GB D CD-ROM Healthy Unknown 0 B 0 B System Reserved NTFS Fixed Healthy OK 162.88 MB 500 MB C NTFS Fixed Healthy OK 26.66 GB 39.51 GB
Step 2 – Use Get-PartitionSupportedSize -DriveLetter C to check if and to what size it can be expanded:
PS C:\Windows\system32> Get-PartitionSupportedSize -DriveLetter C SizeMin SizeMax ------- ------- 13831712768 42423287808
Step 3 – Here we store to $size variable the output from the command in Step 2 and then we resize the partition to its maximum size:
$size = Get-PartitionSupportedSize -DriveLetter C Resize-Partition -DriveLetter C -Size $size.SizeMax
Step 4 – Result





How do i do a query on the drive to see if it is healthy prior to expanding it? What i need to do is see if the Dirty Bit is flagged or not, then continue with patritioning the drive.
Get-volume and Get-PartitionSupportedSize commandlet you have mentioned is not available in powershell.
Could you please help me .
Thank you.
You need at least Powershell version 4. Alternatively you can use WMI – Get-WMIObject -Class Win32_Volume | Select DriveLetter,FreeSpace,Capacity,DeviceID,Label
hi, i got psversion: 5.1.14409.1005, for windows 7 x64, and do not have any of the cmdlets ? how come? do i need to load a module ?
So i have a task to extend a E drive of 2gb to 6 gb. I hv to add 4 gb unallocated space to it . Can you suggest me the comments?
Can you please help me in how to expand a disk for a fixed size say 4gb?