VMware PowerCLI

The Best User Interface for your VMware Datacenter!

Add all Common parameters, including WhatIf & Confirm, to all PowerCLI cmdlets that can cause a change

There are still a number of PowerCLI cmdlets, that change objects/settings/environments, that do not support the Common Parameters, of which WhatIf and Confirm are the more important ones.
Some examples: Update-Tools, Remove-EsxSoftwareDepot, Export-VMHostProfile...

Also note that some cmdlets mention in their Syntax definition CommonParameters, but that apparently does not imply the WhatIf and Confirm common parameters, as documented in About CommonParameters
That is at least confusing. Perhaps define in the PowerCLI Reference what PowerCLI understands under Common Parameters?

For example
Get-Command -Name Update-Tools


Update-Tools [[-Guest] <VMGuest[]>] [-NoReboot] [-RunAsync] [<CommonParameters>]
Update-Tools [[-VM] <VirtualMachine[]>] [[-Server] <VIServer[]>] [-NoReboot] [-RunAsync] [<CommonParameters>]
But that doesn't mean that WhatIf or Confirm are supported by the cmdlet.
  • Luc Dekens
  • Sep 29 2017
  • Attach files