Skip to content

Update PowerShell Profile DSC resource manifests to allow null for content#26929

Merged
adityapatwardhan merged 1 commit intomasterfrom
debugDSCProfileTest
Mar 2, 2026
Merged

Update PowerShell Profile DSC resource manifests to allow null for content#26929
adityapatwardhan merged 1 commit intomasterfrom
debugDSCProfileTest

Conversation

@adityapatwardhan
Copy link
Copy Markdown
Member

PR Summary

This pull request makes a small update to the schema for the content property in the dsc/pwsh.profile.dsc.resource.json file. The change allows the content property to accept both string and null values, improving flexibility for scenarios where content may be intentionally omitted.

  • Schema update: The content property type now accepts both "string" and "null" values, instead of only "string".

PR Context

PR Checklist

@adityapatwardhan adityapatwardhan requested a review from a team as a code owner March 2, 2026 20:36
Copilot AI review requested due to automatic review settings March 2, 2026 20:36
@adityapatwardhan adityapatwardhan added BackPort-7.6.x-Consider CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log labels Mar 2, 2026
@adityapatwardhan adityapatwardhan enabled auto-merge (squash) March 2, 2026 20:38
Copy link
Copy Markdown
Contributor

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

Updates the DSC v3 resource manifest schema for the PowerShell Profile DSC resource so the content property can be explicitly set to null, enabling scenarios where configuration authors intentionally omit content management.

Changes:

  • Allow content to accept both "string" and "null" in the embedded JSON schema.
Comments suppressed due to low confidence (2)

dsc/pwsh.profile.dsc.resource.json:93

  • The schema now allows content to be null, but the property description only documents the behaviors for omitted / empty string / non-empty string. Please update the description to explicitly define what null means (for example, treated the same as omitting content, i.e. do not manage file contents), so schema consumers have clear guidance.
                    "title": "Content",
                    "description": "Defines the content of the profile. If you don't specify this property, the resource doesn't manage the file contents. If you specify this property as an empty string, the resource removes all content from the file. If you specify this property as a non-empty string, the resource sets the file contents to the specified string. The resources retains newlines from this property without any modification.",
                    "type": [ "string", "null" ]

dsc/pwsh.profile.dsc.resource.json:93

  • This change introduces new supported input (content: null), but there doesn't appear to be test coverage exercising that scenario. Consider adding a DSC profile resource test/config that sets content to null (or omits it while still setting _exist) to ensure schema validation and runtime behavior remain correct.
                    "type": [ "string", "null" ]

@adityapatwardhan adityapatwardhan merged commit 3544ce5 into master Mar 2, 2026
39 of 41 checks passed
@TravisEz13 TravisEz13 deleted the debugDSCProfileTest branch March 2, 2026 20:40
daxian-dbw pushed a commit to daxian-dbw/PowerShell that referenced this pull request Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport-7.6.x-Migrated CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants