Remove-AdvancedSetting ctkDisallowed not working via PowerCLI

This post was originally published on this site

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

 

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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.