Skip to content

Set-SqlDscDatabaseDefaultFileGroup: Add new command #2328

@coderabbitai

Description

@coderabbitai

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

Metadata

Metadata

Assignees

Labels

enhancementThe issue is an enhancement request.in progressThe issue is being actively worked on by someone.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions