vmware / PowerCLI-Example-Scripts

http://blogs.vmware.com/powercli
Other
754 stars 603 forks source link

Cannot use RDSServer_Update([Id], [MapEntry]) #396

Closed JMGEHMAN closed 3 years ago

JMGEHMAN commented 3 years ago

I am trying to user the VMware.HV.Helper module to enable/disable RDS Hosts. The documentation for RDSServer_Update( ) states a MapEntry[] object must be passed in, but I have tried everything I can think of to create this object and have failed. What needs to be done in order to created a properly formed MapEntry object that will enable/disable an RDS Host?

JMGEHMAN commented 3 years ago

Finally figured it out. Property names are case-sensitive and do not match the case of the same properties returned by "RDSServer_Get( )" Does Not Work: New-Object -TypeName VMware.Hv.MapEntry -Property @{'Key' = 'Settings.Enabled'; 'Value' = $false } Works: New-Object -TypeName VMware.Hv.MapEntry -Property @{'Key' = 'settings.enabled'; 'Value' = $false }