Skip to content

Conversation

DoLearnWhileAlive
Copy link

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.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me, although I don't have the history of why the original code excluded empty arrays. @TravisEz13 do you have any recollection of this behavior since the conditional check is very explicit (although it could simply be wrong).

Copy link
Member

@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test to cover this use case?

@DoLearnWhileAlive
Copy link
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A resource property with an empty array value does not land in the compiled MOF file
2 participants