-
Notifications
You must be signed in to change notification settings - Fork 8.1k
DSC v3 resource for Powershell Profile #26157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DSC v3 resource for Powershell Profile #26157
Conversation
435987b to
61a580a
Compare
2cea1d3 to
b962617
Compare
c09dcb4 to
23836fa
Compare
6f92c8c to
ace8649
Compare
There was a problem hiding this 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 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>
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