Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

PPTenantSettings: EnableDesktopFlowDataPolicyManagement property type…

Open 1Dimitri opened this issue 1 year ago • 3 comments

… change String -> Boolean

Pull Request (PR) description

In the mof file and psm1 the EnableDesktopFlowDataPolicyManagement property is defined as string whereas it is a boolean. This leads to warnings or error with Set-TargetResource.

This Pull Request (PR) fixes the following issues

  • Fixes #6740

Task list

  • [x] Added an entry to the change log under the Unreleased section of the file CHANGELOG.md. Entry should say what was changed and how that affects users (if applicable), and reference the issue being resolved (if applicable).
  • [x] Resource parameter descriptions added/updated in the schema.mof.
  • [ ] Resource documentation added/updated in README.md.
  • [ ] Resource settings.json file contains all required permissions.
  • [ ] Examples appropriately added/updated.
  • [ ] Unit tests added/updated.
  • [x] New/changed code adheres to DSC Community Style Guidelines.

1Dimitri avatar Dec 04 '25 11:12 1Dimitri

Appreciate the fix. Unfortunately because this changes the type of the parameter, it is considered a breaking change. Boolean parameters are difficult because any non-null string is considered as a true-ish value, except for the number 0 which resolves to $false.

Edit: To not block this change, what you could do is a [System.Boolean]::Parse(...) before sending the request and add a #TODO in the module so that we consider this change for the next breaking change release in April of 2026.

FabienTschanz avatar Dec 04 '25 14:12 FabienTschanz

I'm not sure to understand what you mean by using [System.Boolean]::Parse() as the code using the string type already contains one statement of this kind. This leads to the warning

line breaks in current value of property EnableDesktopFlowDataPolicyManagement

from the LCM because the of the exception mechanism in the Utils module

1Dimitri avatar Dec 09 '25 11:12 1Dimitri

@1Dimitri If I do an export of the configuration, will the property EnableDesktopFlowDataPolicyManagement have the value $True or "True"? I am not on my desktop right now, so can't check that for myself. If it is, then we might be able to slip that change into the next release. If the exported value however is usually a String, then it's definitely a breaking change unfortunately.

One addition: You missed the parameter in the Test-TargetResource function. It needs to be updated there as well. I will check the changes again this evening, with your modifications, and get back to you.

FabienTschanz avatar Dec 09 '25 13:12 FabienTschanz