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

returns

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
  • Looking for Feedback
  • Attach files
  • Kamen Nikolov commented
    January 11, 2022 13:00

    Hello Vinay,

    You can try posting this question in the PowerCLI VMTN Community here: https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/bd-p/2805. It is a much better place to find help regarding PowerCLI scripts.

  • Guest commented
    January 11, 2022 07:50

    I am looking for a powercli script to share 100 disks on 40 virtual machines in a cluster and also to add 3 scsi controller's of type VMware Paravirtual. Any Help would be appreciated.


    Thank you in advance