PowerCLI-Example-Scripts icon indicating copy to clipboard operation
PowerCLI-Example-Scripts copied to clipboard

Error Using Set-HVFARM with value $false

Open nfoley84 opened this issue 4 years ago • 0 comments

I am trying to change a few settings within an Horizon farm

Set-HVFarm -FarmName $poolName -Key 'data.displayProtocolSettings.allowDisplayProtocolOverride' -Value $false

but it gives an error

Set-HVFarm : Both key:[data.displayProtocolSettings.allowDisplayProtocolOverride] and value:[False] need to 
be specified
At line:25 char:1
+ Set-HVFarm -FarmName $poolName -Key 'data.displayProtocolSettings.all ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Set-HVFarm
 
Exception calling "Farm_Update" with "3" argument(s): "There is an error in the XML document."
At C:\Program Files\WindowsPowerShell\Modules\VMware.Hv.Helper\VMware.HV.Helper.psm1:6085 char:9
+         $farm_service_helper.Farm_Update($services,$item,$updates)
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : InvalidOperationException

Setting Value to $true has no issue, it's only when the value is set to $false it's giving the above error.

Thank you..

nfoley84 avatar Apr 30 '21 09:04 nfoley84