Update PowerShell Profile DSC resource manifests to allow null for content#26929
Merged
adityapatwardhan merged 1 commit intomasterfrom Mar 2, 2026
Merged
Update PowerShell Profile DSC resource manifests to allow null for content#26929adityapatwardhan merged 1 commit intomasterfrom
adityapatwardhan merged 1 commit intomasterfrom
Conversation
Contributor
There was a problem hiding this comment.
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
contentto 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
contentto benull, but the property description only documents the behaviors for omitted / empty string / non-empty string. Please update the description to explicitly define whatnullmeans (for example, treated the same as omittingcontent, 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 setscontentto null (or omits it while still setting_exist) to ensure schema validation and runtime behavior remain correct.
"type": [ "string", "null" ]
TravisEz13
approved these changes
Mar 2, 2026
daxian-dbw
pushed a commit
to daxian-dbw/PowerShell
that referenced
this pull request
Mar 9, 2026
Merged
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
This pull request makes a small update to the schema for the
contentproperty in thedsc/pwsh.profile.dsc.resource.jsonfile. The change allows thecontentproperty to accept both string and null values, improving flexibility for scenarios where content may be intentionally omitted.contentproperty type now accepts both"string"and"null"values, instead of only"string".PR Context
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header