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
Description
Add a new command
Set-SqlDscDatabaseDefaultFileGroupto set the default filegroup and default FILESTREAM filegroup for a SQL Server database using the SMOSetDefaultFileGroup()method.Context
This command is needed to handle database filegroup settings that require SMO method calls rather than simple property assignments. The
SetDefaultFileGroup()andSetDefaultFileStreamFileGroup()method should be used to configure:Proposed Solution
Create a new public command
Set-SqlDscDatabaseDefaultFileGroupthat:SetDefaultFileGroup()method to apply changesRelated
Set-SqlDscDatabase: Add parameters to command #2177Set-SqlDscDatabaseProperty: Refactor command #2327Set-SqlDscDatabaseProperty: Refactor command #2327Requested by @johlju