-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
base: master
Are you sure you want to change the base?
Conversation
/azp run PowerShell-Windows-Packaging-CI, PowerShell-CI-linux-packaging |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run PowerShell-Windows-Packaging-CI, PowerShell-CI-linux-packaging |
Azure Pipelines successfully started running 2 pipeline(s). |
"-NonInteractive", | ||
"-NoProfile", | ||
"-Command", | ||
"./pwsh.resource.ps1 Get" |
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.
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.)?
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. |
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
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.pwsh.resource.ps1
, to implement the functionality for theGet
,Set
, andExport
operations. This script validates input, manages configuration files, and handles errors gracefully.Integration into Build Process
powershell-unix.csproj
to include the new DSC resource files (pwsh.dsc.resource.json
andpwsh.resource.ps1
) in the build output.powershell-win-core.csproj
to include the same DSC resource files in the build output for the Windows platform.PR Context
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright header