Created
November 25, 2019 19:28
-
-
Save jakerobinson/9cb529ae40393a1b5c7cdcb7cda0c073 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$vm = Get-VM twodiskvm | |
$disk = Get-HardDisk -VM $vm -Name "Hard disk 3" | |
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec | |
$spec.deviceChange = New-Object VMware.Vim.VirtualDeviceConfigSpec[] (1) | |
$spec.deviceChange[0] = New-Object VMware.Vim.VirtualDeviceConfigSpec | |
$spec.deviceChange[0].operation = 'edit' | |
$spec.deviceChange[0].Device = $disk.ExtensionData | |
$spec.DeviceChange[0].Device.UnitNumber = 0 | |
$vm.ExtensionData.ReconfigVM($spec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment