vm disk expansion

aspathak
aspathak used Ask the Experts™
on
I am in need of powershell script which can extend the drive of VM in vmware and also expands the disk on the windows os part, no need to go to disk management all are windows 2008 servers

Thanks
 Ajai
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
Commented:
for the operating system
run the following at an elevated command prompt. Adjust the disk and the volume as required.
diskpart /s diskpart.txt
select disk 1
select volume 1 
extend

Open in new window

Sr. Systems Administrator
Commented:
you can use set-harddisk and invoke external diskpart commands in powercli to do both

Set-HardDisk
https://www.vmware.com/support/developer/PowerCLI/PowerCLI41/html/Set-HardDisk.html

Resize Guest System Partition with PowerCLI
http://enterpriseadmins.org/blog/scripting/resize-guest-system-partition-with-powercli/

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial