I am working on a Powershell script to automate migration of a few hundreds of virtual disks of my vmware infrastructure and came up to an issue:
The parameter "-Confirm" from command Move-HardDisk (module VMware.VimAutomation.Core\13.3.0.24145081) is not working for me
So, the following command
Move-HardDisk -HardDisk $disk -Datastore $datastore -StorageFormat Thin -Confirm
has the same result as this command
Move-HardDisk -HardDisk $disk -Datastore $datastore -StorageFormat Thin
It just keeps opening the popup for confirmation which is a really blocking point for me.
Thanks for reading and looking forward for your help
The -Confirm
common switch parameter can be a bit counter-intuitive, because presence is it's default value - to suppress confirmation prompts, explicitly pass $false
as an argument value, like so:
Move-HardDisk -HardDisk $disk -Datastore $datastore -StorageFormat Thin -Confirm:$false