datum icon indicating copy to clipboard operation
datum copied to clipboard

ConvertTo-Datum always returns `$null` when DatumHandler returns `$false`

Open DoLearnWhileAlive opened this issue 8 months ago • 0 comments

Issue Description

When a datum handler returns a result value of $false or 0, datum proceeds with $null as value. This results into an empty string in the merged YAML.

Issue Example

Source YAML using InvokeCommand datum handler:

NetworkIpConfiguration:
  Prefix: 24
  Gateway: 192.168.10.50
  DnsServer: 192.168.10.10
  InterfaceAlias: Ethernet
  DisableNetbios: '[x={ 0 -gt 1 }=]'

Resultant YAML:

NetworkIpConfiguration:
  Prefix: 24
  Gateway: 192.168.10.50
  DnsServer: 192.168.10.10
  InterfaceAlias: Ethernet
  DisableNetbios:

Expected Behauvior

Source YAML using InvokeCommand datum handler:

NetworkIpConfiguration:
  Prefix: 24
  Gateway: 192.168.10.50
  DnsServer: 192.168.10.10
  InterfaceAlias: Ethernet
  DisableNetbios: '[x={ 0 -gt 1 }=]'

Resultant YAML:

NetworkIpConfiguration:
  Prefix: 24
  Gateway: 192.168.10.50
  DnsServer: 192.168.10.10
  InterfaceAlias: Ethernet
  DisableNetbios: false

DoLearnWhileAlive avatar Jun 13 '24 09:06 DoLearnWhileAlive