Skip to content

DSC v3 resource for PowerShell configuration file #25487

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

adityapatwardhan
Copy link
Member

PR Summary

This pull request introduces a new Desired State Configuration (DSC) resource for PowerShell, along with necessary updates to include the resource in the build process. The changes add support for managing PowerShell configurations through DSC by defining a JSON schema and implementing corresponding PowerShell scripts. Below are the key changes grouped by theme:

Addition of DSC Resource for PowerShell

  • Created a new DSC resource manifest file, pwsh.dsc.resource.json, which defines the schema, operations (Get, Set, Export), and configuration properties for managing PowerShell settings. This includes support for features like script execution policies, logging configurations, and transcription settings.
  • Added a PowerShell script, pwsh.resource.ps1, to implement the functionality for the Get, Set, and Export operations. This script validates input, manages configuration files, and handles errors gracefully.

Integration into Build Process

  • Updated powershell-unix.csproj to include the new DSC resource files (pwsh.dsc.resource.json and pwsh.resource.ps1) in the build output.
  • Updated powershell-win-core.csproj to include the same DSC resource files in the build output for the Windows platform.

PR Context

PR Checklist

@adityapatwardhan adityapatwardhan added the CL-Tools Indicates that a PR should be marked as a tools change in the Change Log label Apr 30, 2025
@adityapatwardhan
Copy link
Member Author

/azp run PowerShell-Windows-Packaging-CI, PowerShell-CI-linux-packaging

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@adityapatwardhan
Copy link
Member Author

/azp run PowerShell-Windows-Packaging-CI, PowerShell-CI-linux-packaging

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

"-NonInteractive",
"-NoProfile",
"-Command",
"./pwsh.resource.ps1 Get"
Copy link
Collaborator

Choose a reason for hiding this comment

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

What if we run the pwsh not from PSHome directory? I mean OS current directory != PSHome.

Maybe convert pwsh.resource.ps1 to regular module and distribute like other in-box modules (Microsoft.PowerShell.Utility and etc.)?

@microsoft-github-policy-service microsoft-github-policy-service bot added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label May 4, 2025
Copy link
Contributor

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CL-Tools Indicates that a PR should be marked as a tools change in the Change Log Stale Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy