Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use PowerShell to Add Drive to Virtual Machine

$
0
0

Summary: Use Windows PowerShell to add a new hard disk drive to a virtual machine on Hyper-V.

Hey, Scripting Guy! Question How can I to add another hard drive to my virtual machine?

Hey, Scripting Guy! Answer Use the Add-VMHardDiskDrive cmdlet with the following command:

STOP-VM -vmname "My Virtual Machine"

NEW-VHD -Dynamic C:\VHD\MyDrive.vhdx -SizeBytes 60GB

ADD-VMHardDiskDrive -vmname "My Virtual Machine" -path C:\VHD\MyDrive.VHDX

START-VM -vmname "My Virtual Machine"


Viewing all articles
Browse latest Browse all 3333

Trending Articles