DSC v3 resource for Powershell Profile#26157
Merged
adityapatwardhan merged 20 commits intoPowerShell:masterfrom Nov 13, 2025
Merged
DSC v3 resource for Powershell Profile#26157adityapatwardhan merged 20 commits intoPowerShell:masterfrom
adityapatwardhan merged 20 commits intoPowerShell:masterfrom
Conversation
SteveL-MSFT
requested changes
Oct 7, 2025
435987b to
61a580a
Compare
2cea1d3 to
b962617
Compare
c09dcb4 to
23836fa
Compare
6f92c8c to
ace8649
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new DSC v3 resource for managing PowerShell profiles, introducing the PSProfileDSCResource experimental feature. The implementation includes resource scripts, test infrastructure, and build configuration changes to package the resource with PowerShell.
Key changes:
- Adds DSC profile resource implementation (
pwsh.profile.resource.ps1andpwsh.profile.dsc.resource.json) - Introduces
PSProfileDSCResourceexperimental feature - Updates BOM files for Windows, macOS, and Linux to include the new resource files
- Adds comprehensive Pester tests and DSC configuration files for validation
- Modifies test workflows to download and configure DSC v3 for testing
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| dsc/pwsh.profile.resource.ps1 | Implements DSC resource operations (get, set, export) for PowerShell profile management |
| dsc/pwsh.profile.dsc.resource.json | DSC v3 resource manifest defining schema and execution commands |
| test/powershell/dsc/dsc.profileresource.Tests.ps1 | Pester tests validating DSC profile resource functionality |
| test/powershell/dsc/*.dsc.yaml | DSC configuration files for testing different profile types |
| src/System.Management.Automation/engine/ExperimentalFeature/ExperimentalFeature.cs | Adds PSProfileDSCResource experimental feature definition |
| experimental-feature-*.json | Enables the experimental feature for Windows and Linux |
| src/powershell-win-core/powershell-win-core.csproj | Configures DSC resource files to be copied to build output on Windows |
| src/powershell-unix/powershell-unix.csproj | Configures DSC resource files to be copied to build output on Unix |
| tools/packaging/boms/*.json | Updates packaging manifests to include DSC resource files |
| .github/actions/test/windows/action.yml | Adds DSC v3 download and setup for Windows test workflows |
| .github/actions/test/nix/action.yml | Adds DSC v3 download and setup for Linux/macOS test workflows |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
SteveL-MSFT
approved these changes
Nov 5, 2025
michaeltlombardi
approved these changes
Nov 10, 2025
SteveL-MSFT
approved these changes
Nov 11, 2025
TravisEz13
reviewed
Nov 11, 2025
TravisEz13
approved these changes
Nov 13, 2025
TravisEz13
pushed a commit
to TravisEz13/PowerShell
that referenced
this pull request
Nov 13, 2025
9 tasks
SIRMARGIN
pushed a commit
to SIRMARGIN/PowerShell
that referenced
this pull request
Dec 12, 2025
kilasuit
pushed a commit
to kilasuit/PowerShell
that referenced
this pull request
Jan 2, 2026
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 introduces a new DSC v3 resource for managing PowerShell profiles across platforms, and integrates it as an experimental feature. The changes include adding resource and script files, updating build configurations to include these files, and modifying workflows to fetch the latest DSC package for CI. The most important changes are grouped below:
PowerShell Profile DSC Resource Implementation:
pwsh.profile.dsc.resource.json) and implementation script (pwsh.profile.resource.ps1) to enable management of PowerShell profiles via DSC v3. The resource supports operations to get, set, and export profile content for different profile types. [1] [2]Experimental Feature Registration:
PSProfileDSCResourcein both configuration files (experimental-feature-linux.json,experimental-feature-windows.json) and in the engine code (ExperimentalFeature.cs). [1] [2] [3]Build and Packaging Updates:
powershell-unix.csproj) and Windows (powershell-win-core.csproj) to include the new DSC resource files in the output and publish directories, ensuring they are shipped with builds. [1] [2]CI Workflow Improvements:
(References: [1] [2] [3] [4] [5] [6] [7] [8] [9]
PR Context
Export all profiles:
Get current user all host
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header