How to extend the disk from existing disk in powershell

D Vijayakumar VLR 126 Reputation points

Hi All,

I want to extend disk size 5GB or 10 GB in existing disk and i have windows and linux servers in vcenter i find VM with edit settings shows 5 Hard disk in VM (Hard disk 1, Hard disk 2, Hard disk 3, Hard disk 4 like that). i need to extend the hard disk 3 and 4 each 5 GB need to extend on multiple remote servers around 12 servers through powershell script guide me and teach me to learn new things it will helpfull for me.

Windows Server 2012
Windows Server 2012
A Microsoft server operating system that supports enterprise-level management, data storage, applications, and communications.
1,525 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,349 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Clément BETACORNE 2,031 Reputation points


    Did you try that :

    # 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  

    You can find more information in this article :


    1 person found this answer helpful.