I am trying to update a full clone automated desktop pools template using Set-HVPool but facing an issue.
Am I doing it the wrong way?
Set-HVPool -PoolName 'MyPool' -Key '.AutomatedDesktopData.VirtualCenterNamesData.TemplatePath' -Value '/CLS/vm/MyTemplate'
Exception calling "Desktop_Update" with "3" argument(s): "ExceptionType : VMware.Hv.InvalidArgument
ErrorMessage : Invalid member name.
ParameterName : .AutomatedDesktopData.VirtualCenterNamesData.TemplatePath"
At \PowerCLI-Example-Scripts\Modules\VMware.Hv.Helper\VMware.HV.Helper.psm1:6442 char:8
+ $desktop_helper.Desktop_Update($services,$item,$updates)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : VimException
to up
Did you check the case of the letters?
See also Horizon 7 Pool changes via Powercli - VMware Technology Network VMTN
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes I checked the case and it looks good.
I even tried to retrieve data using the following which works.
(Get-HVPool -PoolName 'MyPool').AutomatedDesktopData.VirtualCenterNamesData
In the HV Admin GUI whenever I change the Template for the pool I need to re specifiy HostOrClusterPath, ResourcePoolPath and DatastorePath.
I tried something similar here just added multiple -Key '' -Value '' in my command but it looks that Set-HVPool does not support multiple Key,Value pairs.
Is there a way to update multiple values of the pool data at once? (TemplatePath, HostOrClusterPath, ResourcePoolPath, DatastorePath)?
The code you provided does not seem to have the correct case though.
See also #Issue83 in the repo.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes it looks like that after I see the link you sent but the results are the same even when I try like below:
Set-HVPool -PoolName 'MyPool' -Key '.automatedDesktopData.virtualCenterNamesData.templatePath' -Value '/CLS/vm/MyTemplate'
Why do you have that dot in front of the Key?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I was following an example from a different forum my bad 😥
Here is the results when i tried without the dot in the beginning:
Exception calling "Desktop_Update" with "3" argument(s): "ExceptionType : VMware.Hv.InvalidArgument
ErrorMessage : Cannot update read-only member.
ParameterName : automatedDesktopData.virtualCenterNamesData.templatePath"
At \PowerCLI-Example-Scripts\Modules\VMware.Hv.Helper\VMware.HV.Helper.psm1:6442 char:8
+ $desktop_helper.Desktop_Update($services,$item,$updates)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : VimException
The templatePath property in the DesktopVirtualCenterData object is indeed read-only, hence the error.
I think the correct key is mentioned in #Issue371
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Im having a similar issue.
When i try update the template i get a error regardless of the object i try update. The get command works fine and i see a template and id
$pool = Get-HVPool -PoolName IX_TESTING_20H2
$pool.automatedDesktopData.virtualCenterProvisioningSettings.virtualCenterProvisioningData.Template
$pool.AutomatedDesktopData.VirtualCenterNamesData.TemplatePath
Exception calling "Desktop_Update" with "3" argument(s): "ExceptionType : VMware.Hv.InvalidArgument
ErrorMessage : Invalid member name.
ParameterName : automatedDesktopData.virtualCenterProvisioningSettings.virtualCenterProvisioningData.Template"
At C:\Program Files\WindowsPowerShell\Modules\VMware.Hv.Helper\VMware.HV.Helper.psm1:6450 char:8
+ $desktop_helper.Desktop_Update($services,$item,$updates)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : VimException
I have tried these commands