Hi all
I have read this thread here which has helped me so far to create a script for the removal of a VM Hard Disk Drive
So far the script I have knocked up is as follows:
Remove
PS C:\Users\Administrator> remove-vmhardDiskDrive -VMName 2012r2 -ControllerType SCSI -ControllerNumber 0 -ControllerLocation 0
Re-add
PS C:\Users\Administrator> add-vmhardDiskDrive -VMName 2012r2 -ControllerType SCSI -ControllerNumber 0 -ControllerLocation 0
This gets me this in the Hyper-V settings:
I need the script to add the VM Hard Disk drive in with the physical hard disk selected automatically.
Is there a way to do this?
As you can see I am not a powershell expert, im not even an "expert"
Thanks - Dan