dsccommunity / dsccommunity/SqlServerDsc
`Set-SqlDscDatabaseDefaultFileGroup`: Add new command
Open
@johlju is already working on this.
Since Oct 27, 2025.
enhancement
in progress
- Dominant language
- PowerShell
- Stars
- 385
- Forks
- 224
- PR merge metrics
- No merged PRs in 30d
Description
Description
Add a new command Set-SqlDscDatabaseDefaultFileGroup to set the default filegroup and default FILESTREAM filegroup for a SQL Server database using the SMO SetDefaultFileGroup() method.
Context
This command is needed to handle database filegroup settings that require SMO method calls rather than simple property assignments. The SetDefaultFileGroup() and SetDefaultFileStreamFileGroup() method should be used to configure:
- DefaultFileGroup
- DefaultFileStreamFileGroup
Proposed Solution
Create a new public command Set-SqlDscDatabaseDefaultFileGroup that:
- Accepts either ServerObject + Name or DatabaseObject parameter sets (following the pattern established in Set-SqlDscDatabaseOwner)
- Uses the SMO
SetDefaultFileGroup()method to apply changes - Supports ShouldProcess, Force, and PassThru parameters
- Includes appropriate parameter validation and error handling
Related
- Original issue: #2177
- Implementation PR: #2327
- Comment: https://github.com/dsccommunity/SqlServerDsc/pull/2327
Requested by @johlju
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.