Fixes Resources missing when using PSDesiredStateConfiguration 2.0.7#2110
Fixes Resources missing when using PSDesiredStateConfiguration 2.0.7#2110johlju merged 5 commits intodsccommunity:mainfrom raandree:fix/#2109
Conversation
WalkthroughThe changelog and module manifest for the SqlServerDsc project were updated. The Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes detected. Note 🔌 MCP (Model Context Protocol) integration is now available in Early Access!Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
CHANGELOG.md(1 hunks)source/SqlServerDsc.psd1(0 hunks)
💤 Files with no reviewable changes (1)
- source/SqlServerDsc.psd1
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: dsccommunity.SqlServerDsc (Build Package Module)
- GitHub Check: PSScriptAnalyzer
- GitHub Check: PSScriptAnalyzer
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2110 +/- ##
====================================
Coverage 94% 94%
====================================
Files 107 107
Lines 8094 8094
====================================
Hits 7655 7655
Misses 439 439
🚀 New features to boost your workflow:
|
|
@raandree question before merge, if setting it to |
|
@johlju, the bug was raised 5 years ago but was closed without getting fixed: PowerShell/PowerShell#12054. Only the class-based resources are effected by this issue. And yes, we should remove this property in all community resources and maybe also adapt the Sampler template. |
|
Looking at the code, if I'm readin it correct, it looks like if we set |
|
I'm for setting I can't think of a DscCommunity module uses this and will end up being cleared by ModuleBuilder. A check can be added in |
|
I have not gone through the source code, but other people discovered the issue a while ago:
The issue seems to happen if |
|
Any/most/all DscCommunity modules will have this set to Until it's fixed in PowerShell a HQRM test could be added to ensure the manifest is in the correct state? The only risk is the unknown performance impact of not including or setting the value of one of the *ToExport to |
On the long term
It is not an issue with PowerShell but PSDesiredStateConfiguration 2.0.7. Getting it fixed there is rather complicated.
I see rather a performance risk in setting it to |
|
Looking at Until this is fixed in PowerShell, I'd advocate just commenting out PowerShell bug in PowerShell/PowerShell#12054, is not resolved and is the actual fix. I assume the Microsoft recommendations https://learn.microsoft.com/en-us/powershell/scripting/dev-cross-plat/performance/module-authoring-considerations?view=powershell-7.5#guidelines still apply. Issue for the HQRM test dsccommunity/DscResource.Test#165. |
|
New issue in the PowerShell repo as per the bot instructions. PowerShell/PowerShell#25839 |
|
It says in the authoring consideration:
So if we remove it there are the same performance impact as setting it to |
|
Ok, got it and made the change. Thanks for the input and your time, @dan-hughes and @johlju! |
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
source/SqlServerDsc.psd1(1 hunks)
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/Public/*.ps1 : All public command names must have the noun prefixed with 'SqlDsc', e.g. {Verb}-SqlDsc{Noun}.
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/en-US/SqlServerDsc.strings.psd1 : For public commands and private functions, all localized strings should be added in source/en-US/SqlServerDsc.strings.psd1, and localized string key names should be prefixed with the function name using underscores.
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/Classes/*.ps1 : A derived DSC class-based resource should only inherit from SqlResourceBase if it needs to connect to a SQL Server Database Engine.
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/Public/*.ps1 : All public command names must have the noun prefixed with 'SqlDsc', e.g. {Verb}-SqlDsc{Noun}.
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/en-US/SqlServerDsc.strings.psd1 : For public commands and private functions, all localized strings should be added in source/en-US/SqlServerDsc.strings.psd1, and localized string key names should be prefixed with the function name using underscores.
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/{Public,Private,Classes}/*.ps1 : Use PascalCase for function names and parameters in public commands, private functions, and class-based resources.
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/{Public,Private}/*.ps1 : Public commands and private functions with no parameters should still have an empty parameter block param ().
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/{Public,Private}/*.ps1 : All public commands and private functions should always be advanced functions and have [CmdLetBinding()] attribute.
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/Public/*.ps1 : Public PowerShell commands should each have their own script file named after the command (with .ps1 extension) and be placed in the folder source/Public.
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/{Public,Private}/*.ps1 : All public command and private function names must use PowerShell approved verbs.
Applied to files:
source/SqlServerDsc.psd1
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: PSScriptAnalyzer
- GitHub Check: dsccommunity.SqlServerDsc (Build Package Module)
- GitHub Check: PSScriptAnalyzer
- GitHub Check: PSScriptAnalyzer
🔇 Additional comments (1)
source/SqlServerDsc.psd1 (1)
33-33: Fix unblocks class-based DSC resources in PSDesiredStateConfiguration 2.0.7 — approvedSetting CmdletsToExport to wildcard resolves the missing resources issue in 2.0.7. Looks good.
|
We need to fix QA test so this does not regress, but should be in another PR and preferably in DscResource.Test. |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
CHANGELOG.md(1 hunks)source/SqlServerDsc.psd1(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
CHANGELOG.md
📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)
The Unreleased section in CHANGELOG.md should always be updated when making changes to the codebase, using the keepachangelog format and providing concrete release notes.
Files:
CHANGELOG.md
**/*.md
📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)
**/*.md: Markdown files should wrap lines after a word when a line exceeds 80 characters.
Use 2 spaces for indentation in Markdown files.
Files:
CHANGELOG.md
🧠 Learnings (26)
📓 Common learnings
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/Public/*.ps1 : All public command names must have the noun prefixed with 'SqlDsc', e.g. {Verb}-SqlDsc{Noun}.
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/en-US/SqlServerDsc.strings.psd1 : For public commands and private functions, all localized strings should be added in source/en-US/SqlServerDsc.strings.psd1, and localized string key names should be prefixed with the function name using underscores.
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/Classes/*.ps1 : A derived DSC class-based resource should only inherit from SqlResourceBase if it needs to connect to a SQL Server Database Engine.
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/Public/*.ps1 : All public command names must have the noun prefixed with 'SqlDsc', e.g. {Verb}-SqlDsc{Noun}.
Applied to files:
source/SqlServerDsc.psd1CHANGELOG.md
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/en-US/SqlServerDsc.strings.psd1 : For public commands and private functions, all localized strings should be added in source/en-US/SqlServerDsc.strings.psd1, and localized string key names should be prefixed with the function name using underscores.
Applied to files:
source/SqlServerDsc.psd1CHANGELOG.md
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/{Public,Private,Classes}/*.ps1 : Use PascalCase for function names and parameters in public commands, private functions, and class-based resources.
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/{Public,Private}/*.ps1 : All public commands and private functions should always be advanced functions and have [CmdLetBinding()] attribute.
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/Classes/*.ps1 : A derived DSC class-based resource should only inherit from SqlResourceBase if it needs to connect to a SQL Server Database Engine.
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/{Public,Private}/*.ps1 : Public commands and private functions with no parameters should still have an empty parameter block param ().
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/Classes/*.ps1 : The derived DSC class-based resource should override the methods Get, Test, Set, GetCurrentState, Modify, AssertProperties, and NormalizeProperties.
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/Public/*.ps1 : Public PowerShell commands should each have their own script file named after the command (with .ps1 extension) and be placed in the folder source/Public.
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/{Public,Private}/*.ps1 : Every parameter in public commands and private functions should include the [Parameter()] attribute.
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to **/*.ps1 : Use '#' for single line comments in PowerShell code.
Applied to files:
source/SqlServerDsc.psd1CHANGELOG.md
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to **/*.ps1 : Use splatting for commands to reduce line length.
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to **/*.ps1 : Single quotes should always be used to delimit string literals wherever possible. Double quoted string literals may only be used when string literals contain ($) expressions that need to be evaluated.
Applied to files:
source/SqlServerDsc.psd1CHANGELOG.md
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to **/*.ps1 : Never use backtick as line continuation in code.
Applied to files:
source/SqlServerDsc.psd1CHANGELOG.md
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/{Public,Private,Classes}/*.ps1 : A comment-based help must have at least one example, but preferably more examples to showcase all possible parameter sets and different parameter combinations.
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to **/*.ps1 : Use camelCase for local variable names in PowerShell.
Applied to files:
source/SqlServerDsc.psd1CHANGELOG.md
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to **/*.ps1 : PowerShell reserved keywords should be in all lower case.
Applied to files:
source/SqlServerDsc.psd1CHANGELOG.md
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/{Public,Private,Classes}/*.ps1 : Comment-based help should always be before the function-statement for each public command and private function, and before the class-statement for each class-based resource. It should be in the format of a comment block and at least use the keywords: .SYNOPSIS, .DESCRIPTION, .PARAMETER, .EXAMPLE, and .NOTES.
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to azure-pipelines.yml : Integration test script files for public commands must be added to a group within the 'Integration_Test_Commands_SqlServer' stage in ./azure-pipelines.yml.
Applied to files:
source/SqlServerDsc.psd1CHANGELOG.md
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/{Public,Private}/*.ps1 : All public command and private function names must use PowerShell approved verbs.
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/{Public,Private}/*.ps1 : All public command and private function names must follow the standard PowerShell Verb-Noun format.
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/Private/*.ps1 : Private functions that are only used within a single public command should still be placed in source/Private as separate .ps1 files.
Applied to files:
source/SqlServerDsc.psd1
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to CHANGELOG.md : The Unreleased section in CHANGELOG.md should always be updated when making changes to the codebase, using the keepachangelog format and providing concrete release notes.
Applied to files:
CHANGELOG.md
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to **/*.ps1 : All PowerShell files must end with a new line.
Applied to files:
CHANGELOG.md
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/en-US/*.psd1 : Localized string key names should use underscores as word separators if the key name has more than one word.
Applied to files:
CHANGELOG.md
📚 Learning: 2025-08-03T09:50:27.001Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-03T09:50:27.001Z
Learning: Applies to source/{Public,Private,Classes}/*.ps1 : Each comment-based help keyword should be indented with 4 spaces and each keyword's text should be indented 8 spaces.
Applied to files:
CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: dsccommunity.SqlServerDsc (Build Package Module)
- GitHub Check: PSScriptAnalyzer
- GitHub Check: PSScriptAnalyzer
🔇 Additional comments (1)
source/SqlServerDsc.psd1 (1)
33-34: CmdletsToExport='*' to surface class-based resources under PSDSC 2.0.7 — LGTMMatches the agreed mitigation and keeps authoring guidance. The rationale comment is clear.
Pull Request (PR) description
This Pull Request (PR) fixes the following issues
Fixes #2109
Task list
file CHANGELOG.md. Entry should say what was changed and how that
affects users (if applicable), and reference the issue being resolved
(if applicable).
This change is