I have Horizon 7 environment that requires some automation. I am using powercli and vmware.hv.helper
$p = Get-HVPool -poolname '<poolname>'
this is the setting needing to change:
$p.DesktopSettings.LogoffSettings.PowerPolicy
to either of these values:
ALWAYS_POWERED_ON
POWER_OFF
TAKE_NO_POWER_ACTION
but when I try to use the set-HVPool, I am getting error:
with this command:
Set-HVPool -PoolName $p.base.name -Key 'DesktopSettings.LogoffSettings.PowerPolicy' -Value 'TAKE_NO_POWER_ACTION'
the error is:
Exception calling "Desktop_Update" with "3" argument(s): "ExceptionType : VMware.Hv.InvalidArgument
ErrorMessage : Invalid member name.
ParameterName : DesktopSettings.LogoffSettings.PowerPolicy"
At C:\Users\xxxxx\Documents\WindowsPowerShell\Modules\VMware.Hv.Helper\Modules\VMware.Hv.Helper\VMware.HV.Helpe
r.psm1:6171 char:8
+ $desktop_helper.Desktop_Update($services,$item,$updates)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : VimException
and with this command
Set-HVPool -PoolName $p.base.name -Key $p.DesktopSettings.LogoffSettings.PowerPolicy -Value 'TAKE_NO_POWER_ACTION'
the error is:
Exception calling "Desktop_Update" with "3" argument(s): "ExceptionType : VMware.Hv.InvalidArgument
ErrorMessage : Invalid member name.
ParameterName : ALWAYS_POWERED_ON"
At C:\Users\xxxxxx\Documents\WindowsPowerShell\Modules\VMware.Hv.Helper\Modules\VMware.Hv.Helper\VMware.HV.Helper.psm1:6171 char:8
+ $desktop_helper.Desktop_Update($services,$item,$updates)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : VimException
Any Idea?
Thanks