Automation

 View Only
  • 1.  Remove-AdvancedSetting ctkDisallowed not working via PowerCLI

    Posted Aug 27, 2020 08:54 PM

    Hi All,

    Can someone share with me what I am doing wrong here plz?

    PS C:\temp> Get-AdvancedSetting -entity UVACPMMSQL03ENT | Remove-AdvancedSetting -AdvancedSetting ctkDisallowed -confirm:$false

    Remove-AdvancedSetting : Cannot bind parameter 'AdvancedSetting'. Cannot convert the "ctkDisallowed" value of type "System.String" to type

    "VMware.VimAutomation.ViCore.Types.V1.AdvancedSetting".

    At line:1 char:87

    + ... 03ENT | Remove-AdvancedSetting -AdvancedSetting ctkDisallowed -confir ...

    +                                                     ~~~~~~~~~~~~~

        + CategoryInfo          : InvalidArgument: (:) [Remove-AdvancedSetting], ParameterBindingException

        + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,VMware.VimAutomation.ViCore.Cmdlets.Commands.RemoveAdvancedSetting

    But it works when I do it like this.... manually :smileysad:

    PS C:\temp> Get-AdvancedSetting -entity UVACPMMSQL03ENT | Remove-AdvancedSetting

    Perform operation?

    Removing advanced setting 'ctkDisallowed' from entity 'VirtualMachine-vm-215184'.

    [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

    Perform operation?

    Removing advanced setting 'cpuid.coresPerSocket' from entity 'VirtualMachine-vm-215184'.

    [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): L

    PS C:\temp>

    I've got hundreds of VMs to remove this advanced setting from.

    Thanks for any help in advance,

    T



  • 2.  RE: Remove-AdvancedSetting ctkDisallowed not working via PowerCLI
    Best Answer

    Posted Aug 27, 2020 09:00 PM

    AFaik that should be

    Get-AdvancedSetting -Entity UVACPMMSQL03ENT -Name ctkDisallowed |

    Remove-AdvancedSetting -confirm:$false



  • 3.  RE: Remove-AdvancedSetting ctkDisallowed not working via PowerCLI

    Posted Aug 27, 2020 09:12 PM

    Thank you very much. That worked pretty swell. Guess I was using an old cmd. Thanks again!