PowerTip: Use PowerShell to Add Disks to a Live Virtual Machine

Summary: Use Windows PowerShell to add disks to a live virtual machine on Hyper-V.

Hey, Scripting Guy! Question How can I easily add disk drives to my virtual machine while it is live?

Hey, Scripting Guy! Answer Use the Add-VMScsiController and Add-VMHardDiskDrive cmdlets.

First, stop the virtual machine, add the SCSI controller, then start the virtual machine:

STOP-VM "My Virtual Machine"

ADD-VMScsiController -VMname "My Virtual Machine"

START-VM "My Virtual Machine"

Now attach disks live:

NEW-VHD -Dynamic C:VHDMyDrive.vhdx -SizeBytes 60GB

ADD-VMHardDiskDrive -vmname "My Virtual Machine" -path C:VHDMyDrive.VHDX -ControllerType SCSI


Comments (9)

  1. jrv says:


    I understood that 'live' was a transient state even if no once else could see that.

    What do they say?  "Live is what you make of it."


  2. jrv says:


    Hey – it's Friday and I just finished the deployment from Hell.

    No weeds – I have my lawn done by a really excellent landscaper.

  3. jrv says:


    'Live' has many different interpretations.  It can be dependent on 'planet', on how much coffee you have had and by religion.  To animists 'live' includes rocks and blocks and on the things that don't go bump in the night.

    Have you looked under you bed lately?    

    It's just the beast under your bed

    In your closet in your head

    haa!  haa! ha! ha! ha!

  4. Paul_W says:

    "Use PowerShell to Add Disks to a Live Virtual Machine"

    "First, stop the virtual machine"

    Guys…How is this 'Live'?

  5. Pete Zerger says:

    I agree, the title is more than a little misleading.

  6. Krunch {The Commenter formerly known as K} says:



    i wouldn't call it misleading but instead a misinterpretation. If your VM already has a SCSI controller attached to it then the title 'Use PowerShell to Add Disks to a Live Virtual Machine' is truthful but if you don't the way you go about being able to add drives to live VMs is explained

  7. Paul_W says:


    Hi JRV,

    Look up Hyper-V's 'live migration' to see what MS defines as 'live'.

    (It means a running VM…)

    p.s. Cut down on the weed man

  8. Paul_W says:

    hehe… I sympathize.

    I hope it all went well, or you'll know on monday I guess 😉

  9. Ed Wilson says:

    @ALL Sorry for the confusion caused by the title … often brevity is the causality of clarity — or is it vice versa. Anyway thanks for helping to me to keep it real.

Skip to main content