dsccommunity / dsccommunity/SqlServerDsc

`Set-SqlDscDatabaseDefaultFileGroup`: Add new command

Open
#2,328 1 comment 0 reactions 1 assignee View on GitHub

@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

Requested by @johlju

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.