dsccommunity/ExchangeDsc

MSFT_xExchMailboxDatabase: Bug with the DataMoveReplicationConstraint parameter.

Closed this issue · 2 comments

Details of the scenario you tried and the problem that is occurring

There is a bug in the file ' xExchange/DSCResources/MSFT_xExchMailboxDatabase/MSFT_xExchMailboxDatabase.psm1' at line '610'.

Here is the line:
if (!(Test-ExchangeSetting -Name 'DataMoveReplicationConstraint' **-Type 'Boolean'** -ExpectedValue $DataMoveReplicationConstraint -ActualValue $db.DataMoveReplicationConstraint -PSBoundParametersIn $PSBoundParameters -Verbose:$VerbosePreference))

The problem is the -Type is set to Boolean but the type of 'DataMoveReplicationConstraint' is String.

Verbose logs showing the problem

The result is this error at runtime:

Cannot process argument transformation on parameter 'Bool1'. Cannot convert value "System.String" to type "System.Nullable1[System.Boolean]". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0.`

Suggested solution to the issue

Use the correct type for the validation.

The DSC configuration that is used to reproduce the issue (as detailed as possible)

Any configuration using the parameter since all possible values are strings.

Exchange Server edition and version the target node is running

N/A (Not needed)

The operating system the target node is running

N/A (Not needed)

Version and build of PowerShell the target node is running

Tested on v4 and v5.1

Version of the DSC module that was used ('dev' if using current dev branch)

Production v1.26.0.0

Definitely looks like a bug to me. Thanks for the report!

I'm working this one.