TKMAX
Contributor
Contributor

Remove-AdvancedSetting ctkDisallowed not working via PowerCLI

Jump to solution

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 Smiley Sad

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

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

AFaik that should be

Get-AdvancedSetting -Entity UVACPMMSQL03ENT -Name ctkDisallowed |

Remove-AdvancedSetting -confirm:$false


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership

AFaik that should be

Get-AdvancedSetting -Entity UVACPMMSQL03ENT -Name ctkDisallowed |

Remove-AdvancedSetting -confirm:$false


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
TKMAX
Contributor
Contributor

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

0 Kudos