Uh oh!
There was an error while loading. Please reload this page.
ConvertTo-MOFInstance: Include resource properties with empty array value - #127
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where resource properties with empty array values were being excluded from MOF file compilation in PowerShell 7, creating inconsistency with Windows PowerShell 5.1 behavior.
- Removes conditional logic that excluded empty array properties from MOF generation
- Ensures consistent MOF compilation behavior across PowerShell versions
Steve Lee (SteveL-MSFT)
left a comment
There was a problem hiding this comment.
This looks fine to me, although I don't have the history of why the original code excluded empty arrays. Travis Plunk (@TravisEz13) do you have any recollection of this behavior since the conditional check is very explicit (although it could simply be wrong).
Steve Lee (SteveL-MSFT)
left a comment
There was a problem hiding this comment.
Can you add a test to cover this use case?
@microsoft-github-policy-service agree |
Steve Lee (@SteveL-MSFT) Test was added. PR is ready for review. |
Raimund Andrée (raandree)
commented
Nov 18, 2025
Steve Lee (@SteveL-MSFT), can you have a quick look at this one as well, please? |
Uh oh!
There was an error while loading. Please reload this page.
PR Summary
Fixes#126
PR Context
When switching from Windows PowerShell 5.1 to PowerShell 7 for DSC MOF compilation people are expecting no changes to the resulting MOF files. This is currently not the case for resource properties with an empty array value.