Extending a disk volume by using PowerShell- Windows server 2016

To extend the disk volume using powershell is pretty simple, Provided that you have admin access on VM and you know how much size is available on the disk for extension, here is how you would do it.

Start Windows PowerShell in elivated mode (Run As Administrator):

Enter the following command to resize the volume to the maximum size, specifying the drive letter of the volume you want to extend in the $drive_letter variable:

# Variable specifying the drive you want to extend

$drive_letter = “C”

# Script to get the partition sizes and then resize the volume

$size = (Get-PartitionSupportedSize -DriveLetter $drive_letter)

Resize-Partition -DriveLetter $drive_letter -Size $size.SizeMax

and thats it.

 

Go to My Computer and you should. be able to see new volume size.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top