Skip to content

Conversation

@johlju
Copy link
Member

@johlju johlju commented Nov 28, 2025

Pull Request (PR) description

  • Added public command Set-SqlDscDatabaseDefaultFullTextCatalog to set the default
    full-text catalog for a database in a SQL Server Database Engine instance. This
    command uses the SMO SetDefaultFullTextCatalog() method to configure the default
    catalog (issue #2330).

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (if applicable).
  • Resource documentation updated in the resource's README.md.
  • Resource parameter descriptions updated in schema.mof.
  • Comment-based help updated, including parameter descriptions.
  • Localization strings updated.
  • Examples updated.
  • Unit tests updated. See DSC Community Testing Guidelines.
  • Integration tests updated (where possible). See DSC Community Testing Guidelines.
  • Code changes adheres to DSC Community Style Guidelines.

This change is Reviewable

Function to set default full-text catalog for SQL Server databases
@johlju johlju requested a review from a team as a code owner November 28, 2025 18:27
@coderabbitai
Copy link

coderabbitai bot commented Nov 28, 2025

Walkthrough

Adds a new public PowerShell cmdlet, Set-SqlDscDatabaseDefaultFullTextCatalog, including localization strings, unit and integration tests, CI registration, and a CHANGELOG entry.

Changes

Cohort / File(s) Summary
Command Implementation
source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
New cmdlet with two parameter sets (ServerObjectSet, DatabaseObjectSet). Mandatory CatalogName; optional Refresh/Force/PassThru. Supports ShouldProcess, performs idempotency check, calls SetDefaultFullTextCatalog(), handles errors, refreshes DB, and optionally returns the updated Database object.
Localization Strings
source/en-US/SqlServerDsc.strings.psd1
Added localized keys for the new cmdlet: Updating, Updated, AlreadyCorrect, SetFailed, and ShouldProcess caption/verbose/warning strings.
Unit Tests
tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
New Pester unit tests covering parameter sets, normal operation, idempotency, Refresh and PassThru behaviors, error scenarios, WhatIf/Confirm support, and SMO-like mocks.
Integration Tests & README
tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1, tests/Integration/Commands/README.md
New integration test exercising ServerObject/DatabaseObject parameter sets, pipeline input, Refresh, PassThru, setup/teardown; README updated with run order and dependency.
CI & Changelog
azure-pipelines.yml, CHANGELOG.md
Integration test registered in pipeline group and CHANGELOG updated announcing the new public command.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PSCmd as Set-SqlDscDatabaseDefaultFullTextCatalog
    participant SMOSrv as SMO Server
    participant SMODb as SMO Database

    alt ServerObjectSet
        User->>PSCmd: Invoke(ServerObject, Name, CatalogName[, -Refresh])
        PSCmd->>SMOSrv: Resolve/Get Database (Refresh if requested)
        SMOSrv-->>PSCmd: Database object
    else DatabaseObjectSet
        User->>PSCmd: Invoke(DatabaseObject, CatalogName) / pipeline
        PSCmd->>SMODb: Receive Database object
    end

    PSCmd->>PSCmd: Compare DefaultFullTextCatalog vs CatalogName
    alt Already set
        PSCmd-->>User: No action (idempotent)
    else Needs update
        PSCmd->>User: ShouldProcess check (WhatIf/Confirm)
        alt Proceed
            PSCmd->>SMODb: Call SetDefaultFullTextCatalog(CatalogName)
            SMODb-->>PSCmd: Success or Exception
            alt Success
                PSCmd->>SMODb: Refresh/Alter as needed
                SMODb-->>PSCmd: Updated DB object
                PSCmd-->>User: Output DB object if -PassThru
            else Exception
                PSCmd-->>User: Throw terminating error (localized)
            end
        else Cancelled
            PSCmd-->>User: Operation cancelled
        end
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Focus review on:
    • Parameter-set handling and ShouldProcess/-Confirm integration.
    • Correct invocation and error handling around SetDefaultFullTextCatalog() and subsequent Refresh/Alter.
    • Unit/integration test setup and mock fidelity.
    • Localization key usage and message formatting.

Possibly related PRs

  • Set-SqlDscDatabaseProperty: Refactor command #2327 — Prior refactor recommending SMO-method-based setters be implemented as separate cmdlets; directly related.
  • linked issue #2330 — Defines the feature request and desired behavior implemented by this PR.

Pre-merge checks

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a new command Set-SqlDscDatabaseDefaultFullTextCatalog to the module.
Description check ✅ Passed The description is well-related to the changeset, explaining the new command's purpose, the SMO method it uses, and the issue it addresses.
Linked Issues check ✅ Passed The PR fully implements all coding requirements from issue #2330: adds the new command with both parameter sets (ServerObject+Name, DatabaseObject), supports ShouldProcess, includes proper error handling, and follows DSC Community guidelines.
Out of Scope Changes check ✅ Passed All changes are within scope: the new command implementation, integration/unit tests, localization strings, CHANGELOG entry, and azure-pipelines.yml update directly support the issue #2330 requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 41e6dd1 and e1e9ae8.

📒 Files selected for processing (2)
  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1 (1 hunks)
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1 (1 hunks)
🧰 Additional context used
📓 Path-based instructions (11)
**/*.ps1

📄 CodeRabbit inference engine (.github/instructions/SqlServerDsc-guidelines.instructions.md)

**/*.ps1: Format public commands as {Verb}-SqlDsc{Noun} following PowerShell naming conventions
Format private functions as {Verb}-{Noun} following PowerShell naming conventions

Files:

  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
source/**/*.ps1

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines-localization.instructions.md)

source/**/*.ps1: Localize all Write-Debug, Write-Verbose, Write-Error, Write-Warning and $PSCmdlet.ThrowTerminatingError() messages in PowerShell scripts
Use localized string keys from $script:localizedData, not hardcoded strings, in diagnostic messages
Reference localized strings using the syntax: Write-Verbose -Message ($script:localizedData.KeyName -f $value1)

Localize all strings using string keys; remove any orphaned string keys

Files:

  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1

⚙️ CodeRabbit configuration file

source/**/*.ps1: # Localization Guidelines

Requirements

  • Localize all Write-Debug, Write-Verbose, Write-Error, Write-Warning and $PSCmdlet.ThrowTerminatingError() messages
  • Use localized string keys, not hardcoded strings
  • Assume $script:localizedData is available

String Files

  • Commands/functions: source/en-US/{MyModuleName}.strings.psd1
  • Class resources: source/en-US/{ResourceClassName}.strings.psd1

Key Naming Patterns

  • Format: Verb_FunctionName_Action (underscore separators), e.g. Get_Database_ConnectingToDatabase

String Format

ConvertFrom-StringData @'
    KeyName = Message with {0} placeholder. (PREFIX0001)
'@

String IDs

  • Format: (PREFIX####)
  • PREFIX: First letter of each word in class or function name (SqlSetup → SS, Get-SqlDscDatabase → GSDD)
  • Number: Sequential from 0001

Usage

Write-Verbose -Message ($script:localizedData.KeyName -f $value1)

Files:

  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
**/*.{ps1,psm1,psd1}

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines-powershell.instructions.md)

**/*.{ps1,psm1,psd1}: Use descriptive names with 3+ characters and no abbreviations for functions, variables, and identifiers
Functions: Use PascalCase with Verb-Noun format using approved verbs
Parameters: Use PascalCase
Variables: Use camelCase
Keywords: Use lower-case
Classes: Use PascalCase
Include scope for script/global/environment variables: $script:, $global:, $env:
Use 4 spaces for indentation (no tabs)
Use one space around operators: $a = 1 + 2
Use one space between type and variable: [String] $name
Use one space between keyword and parenthesis: if ($condition)
No spaces on empty lines
Try to limit lines to 120 characters
Newline before opening brace (except variable assignments)
One newline after opening brace
Two newlines after closing brace (one if followed by another brace or continuation)
Use single quotes unless variable expansion is needed: 'text' vs "text $variable"
Single-line arrays: @('one', 'two', 'three'); multi-line: each element on separate line with proper indentation
Do not use the unary comma operator (,) in return statements to force an array
Empty hashtables: @{}; each property on separate line with proper indentation; use PascalCase for properties
Single-line comments: # Comment (capitalized, on own line); multi-line: <# Comment #> format with opening/closing brackets on own line
Do not include commented-out code
Always add comment-based help to all functions and scripts with SYNOPSIS, DESCRIPTION (40+ chars), PARAMETER, and EXAMPLE sections
Comment-based help indentation: keywords 4 spaces, text 8 spaces
Include examples in comment-based help for all parameter sets and combinations
INPUTS section in comment-based help: list each pipeline-accepted type (one per line) with 1-line description, repeat keyword for each input type
OUTPUTS section in comment-based help: list each return type (one per line) with 1-line description, repeat keyword for each output type; must match both [OutputType()] and actual ret...

Files:

  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
source/Public/*.ps1

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines.instructions.md)

Public commands should be located in source/Public/{CommandName}.ps1

Files:

  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
**

⚙️ CodeRabbit configuration file

**: # DSC Community Guidelines

Terminology

  • Command: Public command
  • Function: Private function
  • Resource: DSC class-based resource

Build & Test Workflow Requirements

  • Run PowerShell script files from repository root
  • Setup build and test environment (once per pwsh session): ./build.ps1 -Tasks noop
  • Build project before running tests: ./build.ps1 -Tasks build
  • Always run tests in new pwsh session: Invoke-Pester -Path @({test paths}) -Output Detailed

File Organization

  • Public commands: source/Public/{CommandName}.ps1
  • Private functions: source/Private/{FunctionName}.ps1
  • Classes: source/Classes/{DependencyGroupNumber}.{ClassName}.ps1
  • Enums: source/Enum/{DependencyGroupNumber}.{EnumName}.ps1
  • Unit tests: tests/Unit/{Classes|Public|Private}/{Name}.Tests.ps1
  • Integration tests: tests/Integration/Commands/{CommandName}.Integration.Tests.ps1

Requirements

  • Follow instructions over existing code patterns
  • Follow PowerShell style and test guideline instructions strictly
  • Always update CHANGELOG.md Unreleased section
  • Localize all strings using string keys; remove any orphaned string keys
  • Check DscResource.Common before creating private functions
  • Separate reusable logic into private functions
  • DSC resources should always be created as class-based resources
  • Add unit tests for all commands/functions/resources
  • Add integration tests for all public commands and resources

Files:

  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
{**/*.ps1,**/*.psm1,**/*.psd1}

⚙️ CodeRabbit configuration file

{**/*.ps1,**/*.psm1,**/*.psd1}: # PowerShell Guidelines

Naming

  • Use descriptive names (3+ characters, no abbreviations)
  • Functions: PascalCase with Verb-Noun format using approved verbs
  • Parameters: PascalCase
  • Variables: camelCase
  • Keywords: lower-case
  • Classes: PascalCase
  • Include scope for script/global/environment variables: $script:, $global:, $env:

File naming

  • Class files: ###.ClassName.ps1 format (e.g. 001.SqlReason.ps1, 004.StartupParameters.ps1)

Formatting

Indentation & Spacing

  • Use 4 spaces (no tabs)
  • One space around operators: $a = 1 + 2
  • One space between type and variable: [String] $name
  • One space between keyword and parenthesis: if ($condition)
  • No spaces on empty lines
  • Try to limit lines to 120 characters

Braces

  • Newline before opening brace (except variable assignments)
  • One newline after opening brace
  • Two newlines after closing brace (one if followed by another brace or continuation)

Quotes

  • Use single quotes unless variable expansion is needed: 'text' vs "text $variable"

Arrays

  • Single line: @('one', 'two', 'three')
  • Multi-line: each element on separate line with proper indentation
  • Do not use the unary comma operator (,) in return statements to force
    an array

Hashtables

  • Empty: @{}
  • Each property on separate line with proper indentation
  • Properties: Use PascalCase

Comments

  • Single line: # Comment (capitalized, on own line)
  • Multi-line: <# Comment #> format (opening and closing brackets on own line), and indent text
  • No commented-out code

Comment-based help

  • Always add comment-based help to all functions and scripts
  • Comment-based help: SYNOPSIS, DESCRIPTION (40+ chars), PARAMETER, EXAMPLE sections before function/class
  • Comment-based help indentation: keywords 4 spaces, text 8 spaces
  • Include examples for all parameter sets and combinations
  • INPUTS: List each pipeline‑accepted type (one per line) with a 1‑line description...

Files:

  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
**/tests/Integration/**/*.ps1

📄 CodeRabbit inference engine (.github/instructions/SqlServerDsc-guidelines.instructions.md)

Integration tests: use Connect-SqlDscDatabaseEngine for SQL Server DB session with correct CI credentials, and always follow with Disconnect-SqlDscDatabaseEngine

Files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
tests/Integration/Commands/*.Integration.Tests.ps1

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines-integration-tests.instructions.md)

Location for Commands integration tests: tests/Integration/Commands/{CommandName}.Integration.Tests.ps1

Integration tests for commands should be located in tests/Integration/Commands/{CommandName}.Integration.Tests.ps1

Files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
tests/Integration/**/*.Integration.Tests.ps1

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines-integration-tests.instructions.md)

tests/Integration/**/*.Integration.Tests.ps1: Integration tests must not use mocking - use real environment only
Integration tests must cover all scenarios and code paths
Use Get-ComputerName for computer names in CI environments
Avoid ExpectedMessage parameter for Should -Throw assertions in integration tests
Call commands with -Force parameter where applicable to avoid prompting
Use -ErrorAction 'Stop' on commands so failures surface immediately
Integration tests must include the required setup block with BeforeDiscovery that imports DscResource.Test module and BeforeAll that imports the module being tested

Files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
**/*.[Tt]ests.ps1

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines-pester.instructions.md)

**/*.[Tt]ests.ps1: All public commands, private functions and classes must have unit tests
All public commands and class-based resources must have integration tests
Use Pester v5 syntax only
Test code only inside Describe blocks
Assertions only in It blocks
Never test verbose messages, debug messages or parameter binding behavior
Pass all mandatory parameters to avoid prompts
Inside It blocks, assign unused return objects to $null (unless part of pipeline)
Tested entity must be called from within the It blocks
Keep results and assertions in same It block
Avoid try-catch-finally for cleanup, use AfterAll or AfterEach
Avoid unnecessary remove/recreate cycles
One Describe block per file matching the tested entity name
Context descriptions start with 'When'
It descriptions start with 'Should', must not contain 'when'
Mock variables prefix: 'mock'
Public commands: Never use InModuleScope (unless retrieving localized strings or creating an object using an internal class)
Private functions/class resources: Always use InModuleScope
Each class method = separate Context block
Each scenario = separate Context block
Use nested Context blocks for complex scenarios
Mocking in BeforeAll (BeforeEach only when required)
Setup/teardown in BeforeAll,BeforeEach/AfterAll,AfterEach close to usage
Spacing between blocks, arrange, act, and assert for readability
PascalCase: Describe, Context, It, Should, BeforeAll, BeforeEach, AfterAll, AfterEach
Use -BeTrue/-BeFalse never -Be $true/-Be $false
Never use Assert-MockCalled, use Should -Invoke instead
No Should -Not -Throw - invoke commands directly
Never add an empty -MockWith block
Omit -MockWith when returning $null
Set $PSDefaultParameterValues for Mock:ModuleName, Should:ModuleName, InModuleScope:ModuleName
Omit -ModuleName parameter on Pester commands
Never use Mock inside InModuleScope-block
Never use param() inside -MockWith scriptblock...

Files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1

⚙️ CodeRabbit configuration file

**/*.[Tt]ests.ps1: # Tests Guidelines

Core Requirements

  • All public commands, private functions and classes must have unit tests
  • All public commands and class-based resources must have integration tests
  • Use Pester v5 syntax only
  • Test code only inside Describe blocks
  • Assertions only in It blocks
  • Never test verbose messages, debug messages or parameter binding behavior
  • Pass all mandatory parameters to avoid prompts

Requirements

  • Inside It blocks, assign unused return objects to $null (unless part of pipeline)
  • Tested entity must be called from within the It blocks
  • Keep results and assertions in same It block
  • Avoid try-catch-finally for cleanup, use AfterAll or AfterEach
  • Avoid unnecessary remove/recreate cycles

Naming

  • One Describe block per file matching the tested entity name
  • Context descriptions start with 'When'
  • It descriptions start with 'Should', must not contain 'when'
  • Mock variables prefix: 'mock'

Structure & Scope

  • Public commands: Never use InModuleScope (unless retrieving localized strings or creating an object using an internal class)
  • Private functions/class resources: Always use InModuleScope
  • Each class method = separate Context block
  • Each scenario = separate Context block
  • Use nested Context blocks for complex scenarios
  • Mocking in BeforeAll (BeforeEach only when required)
  • Setup/teardown in BeforeAll,BeforeEach/AfterAll,AfterEach close to usage
  • Spacing between blocks, arrange, act, and assert for readability

Syntax Rules

  • PascalCase: Describe, Context, It, Should, BeforeAll, BeforeEach, AfterAll, AfterEach
  • Use -BeTrue/-BeFalse never -Be $true/-Be $false
  • Never use Assert-MockCalled, use Should -Invoke instead
  • No Should -Not -Throw - invoke commands directly
  • Never add an empty -MockWith block
  • Omit -MockWith when returning $null
  • Set $PSDefaultParameterValues for Mock:ModuleName, Should:ModuleName, `...

Files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
tests/[iI]ntegration/**/*.[iI]ntegration.[tT]ests.ps1

⚙️ CodeRabbit configuration file

tests/[iI]ntegration/**/*.[iI]ntegration.[tT]ests.ps1: # Integration Tests Guidelines

Requirements

  • Location Commands: tests/Integration/Commands/{CommandName}.Integration.Tests.ps1
  • Location Resources: tests/Integration/Resources/{ResourceName}.Integration.Tests.ps1
  • No mocking - real environment only
  • Cover all scenarios and code paths
  • Use Get-ComputerName for computer names in CI
  • Avoid ExpectedMessage for Should -Throw assertions
  • Only run integration tests in CI unless explicitly instructed.
  • Call commands with -Force parameter where applicable (avoids prompting).
  • Use -ErrorAction 'Stop' on commands so failures surface immediately

Required Setup Block

[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Justification = 'Suppressing this rule because Script Analyzer does not understand Pester syntax.')]
param ()

BeforeDiscovery {
    try
    {
        if (-not (Get-Module -Name 'DscResource.Test'))
        {
            # Assumes dependencies have been resolved, so if this module is not available, run 'noop' task.
            if (-not (Get-Module -Name 'DscResource.Test' -ListAvailable))
            {
                # Redirect all streams to $null, except the error stream (stream 2)
                & "$PSScriptRoot/../../../build.ps1" -Tasks 'noop' 3>&1 4>&1 5>&1 6>&1 > $null
            }

            # If the dependencies have not been resolved, this will throw an error.
            Import-Module -Name 'DscResource.Test' -Force -ErrorAction 'Stop'
        }
    }
    catch [System.IO.FileNotFoundException]
    {
        throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -ResolveDependency -Tasks noop" first.'
    }
}

BeforeAll {
    $script:moduleName = '{MyModuleName}'

    Import-Module -Name $script:moduleName -Force -ErrorAction 'Stop'
}

Files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
🧠 Learnings (17)
📓 Common learnings
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-mof-resources.instructions.md:0-0
Timestamp: 2025-11-27T17:59:01.498Z
Learning: Applies to source/DSCResources/**/*.psm1 : Create an `en-US` folder in each DSC resource directory for localized strings
Learnt from: dan-hughes
Repo: dsccommunity/UpdateServicesDsc PR: 85
File: source/en-US/UpdateServicesDsc.strings.psd1:1-2
Timestamp: 2025-10-04T21:33:23.022Z
Learning: In UpdateServicesDsc (and similar DSC modules), the module-level localization file (source/en-US/<ModuleName>.strings.psd1) can be empty when DSC resources have their own localization files in source/DSCResources/<ResourceName>/en-US/DSC_<ResourceName>.strings.psd1. Automated tests verify localization completeness for resources. Don't flag empty module-level localization files as issues when resources have separate localization.
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.401Z
Learning: Applies to **/*.ps1 : Format public commands as `{Verb}-SqlDsc{Noun}` following PowerShell naming conventions
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-mof-resources.instructions.md:0-0
Timestamp: 2025-11-27T17:59:01.498Z
Learning: Applies to source/DSCResources/**/*.psm1 : Import localized strings using `Get-LocalizedData` at the module top level
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-localization.instructions.md:0-0
Timestamp: 2025-11-27T17:58:42.320Z
Learning: Applies to source/en-US/*.strings.psd1 : Store command/function localized strings in source/en-US/{MyModuleName}.strings.psd1 files
Learnt from: johlju
Repo: dsccommunity/SqlServerDsc PR: 2136
File: source/suffix.ps1:24-24
Timestamp: 2025-08-17T10:48:15.384Z
Learning: In source/suffix.ps1, the Write-Verbose message in the catch block for Import-SqlDscPreferredModule does not need localization because the exception message from Import-SqlDscPreferredModule is already localized by that command, making it an edge case exception to the localization guidelines.
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.402Z
Learning: Applies to **/tests/Integration/**/*.ps1 : Integration tests: use `Connect-SqlDscDatabaseEngine` for SQL Server DB session with correct CI credentials, and always follow with `Disconnect-SqlDscDatabaseEngine`
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.402Z
Learning: Applies to **/tests/**/*.tests.ps1 : Add `$env:SqlServerDscCI = $true` in `BeforeAll` block and remove in `AfterAll` block of unit tests
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-mof-resources.instructions.md:0-0
Timestamp: 2025-11-27T17:59:01.498Z
Learning: Applies to source/DSCResources/**/*.psm1 : Use localized strings for all messages including Write-Verbose, Write-Error, and other messaging commands
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-mof-resources.instructions.md:0-0
Timestamp: 2025-11-27T17:59:01.498Z
Learning: Applies to source/DSCResources/**/*.psm1 : Use names returned from `Get-UICulture` for additional language folder names in DSC resources
📚 Learning: 2025-11-27T17:58:02.401Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.401Z
Learning: Applies to **/resources/**/*.ps1 : Add `InstanceName`, `ServerName`, and `Credential` to `$this.ExcludeDscProperties` in Database Engine resources

Applied to files:

  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
📚 Learning: 2025-11-27T17:58:02.402Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.402Z
Learning: Applies to **/tests/Integration/**/*.ps1 : Integration tests: use `Connect-SqlDscDatabaseEngine` for SQL Server DB session with correct CI credentials, and always follow with `Disconnect-SqlDscDatabaseEngine`

Applied to files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-11-27T17:59:27.192Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-pester.instructions.md:0-0
Timestamp: 2025-11-27T17:59:27.192Z
Learning: Applies to **/*.[Tt]ests.ps1 : All public commands and class-based resources must have integration tests

Applied to files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-11-27T17:58:31.900Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-integration-tests.instructions.md:0-0
Timestamp: 2025-11-27T17:58:31.900Z
Learning: Applies to tests/Integration/**/*.Integration.Tests.ps1 : Integration tests must cover all scenarios and code paths

Applied to files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-11-27T18:00:35.054Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T18:00:35.054Z
Learning: Applies to tests/Integration/Commands/*.Integration.Tests.ps1 : Integration tests for commands should be located in `tests/Integration/Commands/{CommandName}.Integration.Tests.ps1`

Applied to files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-11-27T17:58:31.900Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-integration-tests.instructions.md:0-0
Timestamp: 2025-11-27T17:58:31.900Z
Learning: Applies to tests/Integration/**/*.Integration.Tests.ps1 : Call commands with `-Force` parameter where applicable to avoid prompting

Applied to files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-11-27T17:58:31.900Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-integration-tests.instructions.md:0-0
Timestamp: 2025-11-27T17:58:31.900Z
Learning: Applies to tests/Integration/**/*.Integration.Tests.ps1 : Integration tests must include the required setup block with BeforeDiscovery that imports DscResource.Test module and BeforeAll that imports the module being tested

Applied to files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-11-27T17:58:31.900Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-integration-tests.instructions.md:0-0
Timestamp: 2025-11-27T17:58:31.900Z
Learning: Applies to tests/Integration/Commands/*.Integration.Tests.ps1 : Location for Commands integration tests: `tests/Integration/Commands/{CommandName}.Integration.Tests.ps1`

Applied to files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-11-27T17:58:02.402Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.402Z
Learning: Applies to **/tests/**/*.tests.ps1 : Add `$env:SqlServerDscCI = $true` in `BeforeAll` block and remove in `AfterAll` block of unit tests

Applied to files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-11-27T17:59:27.192Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-pester.instructions.md:0-0
Timestamp: 2025-11-27T17:59:27.192Z
Learning: Applies to **/*.[Tt]ests.ps1 : Cover all scenarios and code paths

Applied to files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-11-27T17:58:02.402Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.402Z
Learning: Applies to **/tests/**/*.tests.ps1 : When unit tests test classes or commands containing SMO types like `[Microsoft.SqlServer.Management.Smo.*]`, ensure they are properly stubbed in SMO.cs

Applied to files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-11-27T18:56:46.724Z
Learnt from: johlju
Repo: dsccommunity/SqlServerDsc PR: 1622
File: tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1:1-30
Timestamp: 2025-11-27T18:56:46.724Z
Learning: Integration tests for MOF-based DSC resources (located in source/DSCResources/**) should use the Initialize-TestEnvironment pattern with -ResourceType 'Mof', not the BeforeDiscovery/BeforeAll pattern. The BeforeDiscovery/BeforeAll pattern is for class-based resources only.

Applied to files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-11-27T18:00:20.925Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-unit-tests.instructions.md:0-0
Timestamp: 2025-11-27T18:00:20.925Z
Learning: Applies to tests/[Uu]nit/**/*.[Tt]ests.ps1 : Use the exact setup block with BeforeDiscovery, BeforeAll, and AfterAll blocks including DscResource.Test module import and PSDefaultParameterValues configuration

Applied to files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-08-18T13:50:53.789Z
Learnt from: johlju
Repo: dsccommunity/SqlServerDsc PR: 2132
File: tests/Unit/Public/New-SqlDscLogin.Tests.ps1:0-0
Timestamp: 2025-08-18T13:50:53.789Z
Learning: In SqlServerDsc unit tests, SMO stub objects can be used to verify method calls like Create() on Login objects by adding mock verifications with Should -Invoke, providing more robust testing than just checking for no exceptions.

Applied to files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-10-12T12:10:48.625Z
Learnt from: johlju
Repo: dsccommunity/SqlServerDsc PR: 2303
File: tests/Integration/Commands/PostInstallationConfiguration.Integration.Tests.ps1:127-143
Timestamp: 2025-10-12T12:10:48.625Z
Learning: For the SqlServerDsc module integration tests, ForceEncryption should not be enabled on the SQL Server instance (DSCSQLTEST) because the module needs to test both encrypted and non-encrypted connection scenarios in CI.

Applied to files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-08-17T10:13:30.079Z
Learnt from: johlju
Repo: dsccommunity/SqlServerDsc PR: 2136
File: source/Public/Remove-SqlDscLogin.ps1:104-108
Timestamp: 2025-08-17T10:13:30.079Z
Learning: In SqlServerDsc unit tests, SMO object stubs (like Login objects) should have properly mocked Parent properties with correct Server stub types and valid InstanceName values, rather than handling null Parent scenarios in production code.

Applied to files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
⏰ 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 (8)
tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1 (3)

1-30: LGTM! Required setup block is correctly implemented.

The BeforeDiscovery and BeforeAll blocks follow the required pattern for integration tests, including proper module imports and error handling.


32-77: LGTM! Test setup and teardown are well-structured.

The setup correctly uses Get-ComputerName, Connect-SqlDscDatabaseEngine, creates necessary test resources, and properly cleans up with Disconnect-SqlDscDatabaseEngine in the AfterAll block.


79-161: LGTM! Comprehensive test coverage.

The test scenarios cover all parameter sets, pipeline input, error conditions, idempotency, and optional parameters (Refresh, PassThru). All tests properly use -Force and -ErrorAction 'Stop' per integration test guidelines.

source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1 (5)

1-72: LGTM! Comment-based help is comprehensive.

The help documentation includes all required sections with detailed descriptions, multiple examples covering all parameter sets, and properly documented inputs/outputs matching the function's behavior.


73-110: LGTM! Function signature and parameters are well-defined.

The function correctly implements two parameter sets, supports pipeline input, includes proper parameter validation, and follows all PowerShell style guidelines for parameter declaration.


112-118: LGTM! Force parameter pattern correctly implemented.

The begin block properly implements the Force parameter pattern to bypass confirmation when specified.


122-140: LGTM! Parameter set handling is correct.

The code properly handles both parameter sets. The ErrorActionPreference manipulation pattern on lines 127-133 follows the coding guidelines exactly, ensuring errors are properly surfaced when retrieving the database object.


142-186: LGTM! ShouldProcess pattern and main logic are well-implemented.

The implementation correctly:

  • Uses the required ShouldProcess pattern with localized messages
  • Implements idempotency by checking current state before modification
  • Handles errors with ThrowTerminatingError and proper error context
  • Returns refreshed database object when PassThru is specified
  • Avoids Write-Verbose inside the ShouldProcess block per guidelines

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1 (1)

127-133: Consider simplifying ErrorActionPreference handling.

The pattern of saving and restoring $ErrorActionPreference around a single command with -ErrorAction 'Stop' is typically unnecessary when the command already has -ErrorAction 'Stop' specified. The -ErrorAction parameter overrides the preference variable for that specific command.

However, this pattern is used elsewhere in the codebase, so this is a minor observation rather than a required change.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed34b01 and 7a10c78.

📒 Files selected for processing (7)
  • CHANGELOG.md (1 hunks)
  • azure-pipelines.yml (1 hunks)
  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1 (1 hunks)
  • source/en-US/SqlServerDsc.strings.psd1 (1 hunks)
  • tests/Integration/Commands/README.md (1 hunks)
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1 (1 hunks)
  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1 (1 hunks)
🧰 Additional context used
📓 Path-based instructions (19)
azure-pipelines.yml

📄 CodeRabbit inference engine (.github/instructions/SqlServerDsc-guidelines.instructions.md)

Integration test script files must be added to a group within the test stage in ./azure-pipelines.yml based on required dependencies

Files:

  • azure-pipelines.yml
**

⚙️ CodeRabbit configuration file

**: # DSC Community Guidelines

Terminology

  • Command: Public command
  • Function: Private function
  • Resource: DSC class-based resource

Build & Test Workflow Requirements

  • Run PowerShell script files from repository root
  • Setup build and test environment (once per pwsh session): ./build.ps1 -Tasks noop
  • Build project before running tests: ./build.ps1 -Tasks build
  • Always run tests in new pwsh session: Invoke-Pester -Path @({test paths}) -Output Detailed

File Organization

  • Public commands: source/Public/{CommandName}.ps1
  • Private functions: source/Private/{FunctionName}.ps1
  • Classes: source/Classes/{DependencyGroupNumber}.{ClassName}.ps1
  • Enums: source/Enum/{DependencyGroupNumber}.{EnumName}.ps1
  • Unit tests: tests/Unit/{Classes|Public|Private}/{Name}.Tests.ps1
  • Integration tests: tests/Integration/Commands/{CommandName}.Integration.Tests.ps1

Requirements

  • Follow instructions over existing code patterns
  • Follow PowerShell style and test guideline instructions strictly
  • Always update CHANGELOG.md Unreleased section
  • Localize all strings using string keys; remove any orphaned string keys
  • Check DscResource.Common before creating private functions
  • Separate reusable logic into private functions
  • DSC resources should always be created as class-based resources
  • Add unit tests for all commands/functions/resources
  • Add integration tests for all public commands and resources

Files:

  • azure-pipelines.yml
  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
  • source/en-US/SqlServerDsc.strings.psd1
  • CHANGELOG.md
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
  • tests/Integration/Commands/README.md
**/*.ps1

📄 CodeRabbit inference engine (.github/instructions/SqlServerDsc-guidelines.instructions.md)

**/*.ps1: Format public commands as {Verb}-SqlDsc{Noun} following PowerShell naming conventions
Format private functions as {Verb}-{Noun} following PowerShell naming conventions

Files:

  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
**/*.[Tt]ests.ps1

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines-pester.instructions.md)

**/*.[Tt]ests.ps1: All public commands, private functions and classes must have unit tests
All public commands and class-based resources must have integration tests
Use Pester v5 syntax only
Test code only inside Describe blocks
Assertions only in It blocks
Never test verbose messages, debug messages or parameter binding behavior
Pass all mandatory parameters to avoid prompts
Inside It blocks, assign unused return objects to $null (unless part of pipeline)
Tested entity must be called from within the It blocks
Keep results and assertions in same It block
Avoid try-catch-finally for cleanup, use AfterAll or AfterEach
Avoid unnecessary remove/recreate cycles
One Describe block per file matching the tested entity name
Context descriptions start with 'When'
It descriptions start with 'Should', must not contain 'when'
Mock variables prefix: 'mock'
Public commands: Never use InModuleScope (unless retrieving localized strings or creating an object using an internal class)
Private functions/class resources: Always use InModuleScope
Each class method = separate Context block
Each scenario = separate Context block
Use nested Context blocks for complex scenarios
Mocking in BeforeAll (BeforeEach only when required)
Setup/teardown in BeforeAll,BeforeEach/AfterAll,AfterEach close to usage
Spacing between blocks, arrange, act, and assert for readability
PascalCase: Describe, Context, It, Should, BeforeAll, BeforeEach, AfterAll, AfterEach
Use -BeTrue/-BeFalse never -Be $true/-Be $false
Never use Assert-MockCalled, use Should -Invoke instead
No Should -Not -Throw - invoke commands directly
Never add an empty -MockWith block
Omit -MockWith when returning $null
Set $PSDefaultParameterValues for Mock:ModuleName, Should:ModuleName, InModuleScope:ModuleName
Omit -ModuleName parameter on Pester commands
Never use Mock inside InModuleScope-block
Never use param() inside -MockWith scriptblock...

Files:

  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1

⚙️ CodeRabbit configuration file

**/*.[Tt]ests.ps1: # Tests Guidelines

Core Requirements

  • All public commands, private functions and classes must have unit tests
  • All public commands and class-based resources must have integration tests
  • Use Pester v5 syntax only
  • Test code only inside Describe blocks
  • Assertions only in It blocks
  • Never test verbose messages, debug messages or parameter binding behavior
  • Pass all mandatory parameters to avoid prompts

Requirements

  • Inside It blocks, assign unused return objects to $null (unless part of pipeline)
  • Tested entity must be called from within the It blocks
  • Keep results and assertions in same It block
  • Avoid try-catch-finally for cleanup, use AfterAll or AfterEach
  • Avoid unnecessary remove/recreate cycles

Naming

  • One Describe block per file matching the tested entity name
  • Context descriptions start with 'When'
  • It descriptions start with 'Should', must not contain 'when'
  • Mock variables prefix: 'mock'

Structure & Scope

  • Public commands: Never use InModuleScope (unless retrieving localized strings or creating an object using an internal class)
  • Private functions/class resources: Always use InModuleScope
  • Each class method = separate Context block
  • Each scenario = separate Context block
  • Use nested Context blocks for complex scenarios
  • Mocking in BeforeAll (BeforeEach only when required)
  • Setup/teardown in BeforeAll,BeforeEach/AfterAll,AfterEach close to usage
  • Spacing between blocks, arrange, act, and assert for readability

Syntax Rules

  • PascalCase: Describe, Context, It, Should, BeforeAll, BeforeEach, AfterAll, AfterEach
  • Use -BeTrue/-BeFalse never -Be $true/-Be $false
  • Never use Assert-MockCalled, use Should -Invoke instead
  • No Should -Not -Throw - invoke commands directly
  • Never add an empty -MockWith block
  • Omit -MockWith when returning $null
  • Set $PSDefaultParameterValues for Mock:ModuleName, Should:ModuleName, `...

Files:

  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
tests/Unit/Public/*.[Tt]ests.ps1

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines-pester.instructions.md)

Public commands: tests/Unit/Public/{Name}.Tests.ps1

Files:

  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
**/*.{ps1,psm1,psd1}

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines-powershell.instructions.md)

**/*.{ps1,psm1,psd1}: Use descriptive names with 3+ characters and no abbreviations for functions, variables, and identifiers
Functions: Use PascalCase with Verb-Noun format using approved verbs
Parameters: Use PascalCase
Variables: Use camelCase
Keywords: Use lower-case
Classes: Use PascalCase
Include scope for script/global/environment variables: $script:, $global:, $env:
Use 4 spaces for indentation (no tabs)
Use one space around operators: $a = 1 + 2
Use one space between type and variable: [String] $name
Use one space between keyword and parenthesis: if ($condition)
No spaces on empty lines
Try to limit lines to 120 characters
Newline before opening brace (except variable assignments)
One newline after opening brace
Two newlines after closing brace (one if followed by another brace or continuation)
Use single quotes unless variable expansion is needed: 'text' vs "text $variable"
Single-line arrays: @('one', 'two', 'three'); multi-line: each element on separate line with proper indentation
Do not use the unary comma operator (,) in return statements to force an array
Empty hashtables: @{}; each property on separate line with proper indentation; use PascalCase for properties
Single-line comments: # Comment (capitalized, on own line); multi-line: <# Comment #> format with opening/closing brackets on own line
Do not include commented-out code
Always add comment-based help to all functions and scripts with SYNOPSIS, DESCRIPTION (40+ chars), PARAMETER, and EXAMPLE sections
Comment-based help indentation: keywords 4 spaces, text 8 spaces
Include examples in comment-based help for all parameter sets and combinations
INPUTS section in comment-based help: list each pipeline-accepted type (one per line) with 1-line description, repeat keyword for each input type
OUTPUTS section in comment-based help: list each return type (one per line) with 1-line description, repeat keyword for each output type; must match both [OutputType()] and actual ret...

Files:

  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
  • source/en-US/SqlServerDsc.strings.psd1
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
tests/[Uu]nit/**/*.[Tt]ests.ps1

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines-unit-tests.instructions.md)

tests/[Uu]nit/**/*.[Tt]ests.ps1: Test with localized strings using InModuleScope -ScriptBlock { $script:localizedData.Key }
Mock files using the $TestDrive variable (path to the test drive)
All public commands require parameter set validation tests
Use the exact setup block with BeforeDiscovery, BeforeAll, and AfterAll blocks including DscResource.Test module import and PSDefaultParameterValues configuration
Parameter set validation tests should use Get-Command with Where-Object filtering and Should assertions to verify ParameterSetName and ParameterListAsString
Parameter property tests should verify mandatory parameter attributes using Get-Command Parameters and Should -BeTrue assertions

Files:

  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1

⚙️ CodeRabbit configuration file

tests/[Uu]nit/**/*.[Tt]ests.ps1: # Unit Tests Guidelines

  • Test with localized strings: Use InModuleScope -ScriptBlock { $script:localizedData.Key }
  • Mock files: Use $TestDrive variable (path to the test drive)
  • All public commands require parameter set validation tests
  • After modifying classes, always run tests in new session (for changes to take effect)

Test Setup Requirements

Use this exact setup block before Describe:

[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Justification = 'Suppressing this rule because Script Analyzer does not understand Pester syntax.')]
param ()

BeforeDiscovery {
    try
    {
        if (-not (Get-Module -Name 'DscResource.Test'))
        {
            # Assumes dependencies have been resolved, so if this module is not available, run 'noop' task.
            if (-not (Get-Module -Name 'DscResource.Test' -ListAvailable))
            {
                # Redirect all streams to $null, except the error stream (stream 2)
                & "$PSScriptRoot/../../../build.ps1" -Tasks 'noop' 3>&1 4>&1 5>&1 6>&1 > $null
            }

            # If the dependencies have not been resolved, this will throw an error.
            Import-Module -Name 'DscResource.Test' -Force -ErrorAction 'Stop'
        }
    }
    catch [System.IO.FileNotFoundException]
    {
        throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -ResolveDependency -Tasks noop" first.'
    }
}

BeforeAll {
    $script:moduleName = '{MyModuleName}'

    Import-Module -Name $script:moduleName -Force -ErrorAction 'Stop'

    $PSDefaultParameterValues['InModuleScope:ModuleName'] = $script:moduleName
    $PSDefaultParameterValues['Mock:ModuleName'] = $script:moduleName
    $PSDefaultParameterValues['Should:ModuleName'] = $script:moduleName
}

AfterAll {
    $PSDefaultParameterValues.Remove('InModuleScope:ModuleName')
    $PSDefaultParameterValues.Remove('Mock:ModuleNam...

Files:

  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
tests/Unit/**/*.Tests.ps1

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines.instructions.md)

Unit tests should be located in tests/Unit/{Classes|Public|Private}/{Name}.Tests.ps1

Files:

  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
{**/*.ps1,**/*.psm1,**/*.psd1}

⚙️ CodeRabbit configuration file

{**/*.ps1,**/*.psm1,**/*.psd1}: # PowerShell Guidelines

Naming

  • Use descriptive names (3+ characters, no abbreviations)
  • Functions: PascalCase with Verb-Noun format using approved verbs
  • Parameters: PascalCase
  • Variables: camelCase
  • Keywords: lower-case
  • Classes: PascalCase
  • Include scope for script/global/environment variables: $script:, $global:, $env:

File naming

  • Class files: ###.ClassName.ps1 format (e.g. 001.SqlReason.ps1, 004.StartupParameters.ps1)

Formatting

Indentation & Spacing

  • Use 4 spaces (no tabs)
  • One space around operators: $a = 1 + 2
  • One space between type and variable: [String] $name
  • One space between keyword and parenthesis: if ($condition)
  • No spaces on empty lines
  • Try to limit lines to 120 characters

Braces

  • Newline before opening brace (except variable assignments)
  • One newline after opening brace
  • Two newlines after closing brace (one if followed by another brace or continuation)

Quotes

  • Use single quotes unless variable expansion is needed: 'text' vs "text $variable"

Arrays

  • Single line: @('one', 'two', 'three')
  • Multi-line: each element on separate line with proper indentation
  • Do not use the unary comma operator (,) in return statements to force
    an array

Hashtables

  • Empty: @{}
  • Each property on separate line with proper indentation
  • Properties: Use PascalCase

Comments

  • Single line: # Comment (capitalized, on own line)
  • Multi-line: <# Comment #> format (opening and closing brackets on own line), and indent text
  • No commented-out code

Comment-based help

  • Always add comment-based help to all functions and scripts
  • Comment-based help: SYNOPSIS, DESCRIPTION (40+ chars), PARAMETER, EXAMPLE sections before function/class
  • Comment-based help indentation: keywords 4 spaces, text 8 spaces
  • Include examples for all parameter sets and combinations
  • INPUTS: List each pipeline‑accepted type (one per line) with a 1‑line description...

Files:

  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
  • source/en-US/SqlServerDsc.strings.psd1
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
source/en-US/*.strings.psd1

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines-localization.instructions.md)

source/en-US/*.strings.psd1: Store command/function localized strings in source/en-US/{MyModuleName}.strings.psd1 files
Store class resource localized strings in source/en-US/{ResourceClassName}.strings.psd1 files
Use Key Naming Pattern format: Verb_FunctionName_Action with underscore separators (e.g., Get_Database_ConnectingToDatabase)
Format localized strings using ConvertFrom-StringData with placeholder syntax: KeyName = Message with {0} placeholder. (PREFIX0001)
Prefix string IDs with an acronym derived from the first letter of each word in the class or function name (e.g., SqlSetup → SS, Get-SqlDscDatabase → GSDD), followed by sequential numbers starting from 0001

Files:

  • source/en-US/SqlServerDsc.strings.psd1
**/*.psd1

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines-powershell.instructions.md)

Don't use NestedModules for shared commands without RootModule in module manifest

Files:

  • source/en-US/SqlServerDsc.strings.psd1
CHANGELOG.md

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines-changelog.instructions.md)

CHANGELOG.md: Always update the Unreleased section in CHANGELOG.md
Use Keep a Changelog format in CHANGELOG.md
Describe notable changes briefly in CHANGELOG.md, ≤2 items per change type
Reference issues using format issue #<issue_number> in CHANGELOG.md
No empty lines between list items in same section of CHANGELOG.md
Skip adding entry if same change already exists in Unreleased section of CHANGELOG.md
No duplicate sections or items in Unreleased section of CHANGELOG.md

Always update CHANGELOG.md Unreleased section

Files:

  • CHANGELOG.md

⚙️ CodeRabbit configuration file

CHANGELOG.md: # Changelog Guidelines

  • Always update the Unreleased section in CHANGELOG.md
  • Use Keep a Changelog format
  • Describe notable changes briefly, ≤2 items per change type
  • Reference issues using format issue #<issue_number>
  • No empty lines between list items in same section
  • Skip adding entry if same change already exists in Unreleased section
  • No duplicate sections or items in Unreleased section

Files:

  • CHANGELOG.md
**/*.md

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines-markdown.instructions.md)

**/*.md: Wrap lines at word boundaries when over 80 characters (except tables/code blocks)
Use 2 spaces for indentation in Markdown files
Use '1.' for all items in ordered lists (1/1/1 numbering style)
Disable MD013 rule by adding a comment for tables/code blocks exceeding 80 characters
Empty lines required before/after code blocks and headings (except before line 1)
Escape backslashes in file paths only (not in code blocks)
Code blocks must specify language identifiers
Format parameters using bold in Markdown documentation
Format values and literals using inline code in Markdown documentation
Format resource/module/product names using italic in Markdown documentation
Format commands/files/paths using inline code in Markdown documentation

Files:

  • CHANGELOG.md
  • tests/Integration/Commands/README.md

⚙️ CodeRabbit configuration file

**/*.md: # Markdown Style Guidelines

  • Wrap lines at word boundaries when over 80 characters (except tables/code blocks)
  • Use 2 spaces for indentation
  • Use '1.' for all items in ordered lists (1/1/1 numbering style)
  • Disable MD013 rule by adding a comment for tables/code blocks exceeding 80 characters
  • Empty lines required before/after code blocks and headings (except before line 1)
  • Escape backslashes in file paths only (not in code blocks)
  • Code blocks must specify language identifiers

Text Formatting

  • Parameters: bold
  • Values/literals: inline code
  • Resource/module/product names: italic
  • Commands/files/paths: inline code

Files:

  • CHANGELOG.md
  • tests/Integration/Commands/README.md
**/tests/Integration/**/*.ps1

📄 CodeRabbit inference engine (.github/instructions/SqlServerDsc-guidelines.instructions.md)

Integration tests: use Connect-SqlDscDatabaseEngine for SQL Server DB session with correct CI credentials, and always follow with Disconnect-SqlDscDatabaseEngine

Files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
tests/Integration/Commands/*.Integration.Tests.ps1

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines-integration-tests.instructions.md)

Location for Commands integration tests: tests/Integration/Commands/{CommandName}.Integration.Tests.ps1

Integration tests for commands should be located in tests/Integration/Commands/{CommandName}.Integration.Tests.ps1

Files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
tests/Integration/**/*.Integration.Tests.ps1

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines-integration-tests.instructions.md)

tests/Integration/**/*.Integration.Tests.ps1: Integration tests must not use mocking - use real environment only
Integration tests must cover all scenarios and code paths
Use Get-ComputerName for computer names in CI environments
Avoid ExpectedMessage parameter for Should -Throw assertions in integration tests
Call commands with -Force parameter where applicable to avoid prompting
Use -ErrorAction 'Stop' on commands so failures surface immediately
Integration tests must include the required setup block with BeforeDiscovery that imports DscResource.Test module and BeforeAll that imports the module being tested

Files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
tests/[iI]ntegration/**/*.[iI]ntegration.[tT]ests.ps1

⚙️ CodeRabbit configuration file

tests/[iI]ntegration/**/*.[iI]ntegration.[tT]ests.ps1: # Integration Tests Guidelines

Requirements

  • Location Commands: tests/Integration/Commands/{CommandName}.Integration.Tests.ps1
  • Location Resources: tests/Integration/Resources/{ResourceName}.Integration.Tests.ps1
  • No mocking - real environment only
  • Cover all scenarios and code paths
  • Use Get-ComputerName for computer names in CI
  • Avoid ExpectedMessage for Should -Throw assertions
  • Only run integration tests in CI unless explicitly instructed.
  • Call commands with -Force parameter where applicable (avoids prompting).
  • Use -ErrorAction 'Stop' on commands so failures surface immediately

Required Setup Block

[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Justification = 'Suppressing this rule because Script Analyzer does not understand Pester syntax.')]
param ()

BeforeDiscovery {
    try
    {
        if (-not (Get-Module -Name 'DscResource.Test'))
        {
            # Assumes dependencies have been resolved, so if this module is not available, run 'noop' task.
            if (-not (Get-Module -Name 'DscResource.Test' -ListAvailable))
            {
                # Redirect all streams to $null, except the error stream (stream 2)
                & "$PSScriptRoot/../../../build.ps1" -Tasks 'noop' 3>&1 4>&1 5>&1 6>&1 > $null
            }

            # If the dependencies have not been resolved, this will throw an error.
            Import-Module -Name 'DscResource.Test' -Force -ErrorAction 'Stop'
        }
    }
    catch [System.IO.FileNotFoundException]
    {
        throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -ResolveDependency -Tasks noop" first.'
    }
}

BeforeAll {
    $script:moduleName = '{MyModuleName}'

    Import-Module -Name $script:moduleName -Force -ErrorAction 'Stop'
}

Files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
source/**/*.ps1

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines-localization.instructions.md)

source/**/*.ps1: Localize all Write-Debug, Write-Verbose, Write-Error, Write-Warning and $PSCmdlet.ThrowTerminatingError() messages in PowerShell scripts
Use localized string keys from $script:localizedData, not hardcoded strings, in diagnostic messages
Reference localized strings using the syntax: Write-Verbose -Message ($script:localizedData.KeyName -f $value1)

Localize all strings using string keys; remove any orphaned string keys

Files:

  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1

⚙️ CodeRabbit configuration file

source/**/*.ps1: # Localization Guidelines

Requirements

  • Localize all Write-Debug, Write-Verbose, Write-Error, Write-Warning and $PSCmdlet.ThrowTerminatingError() messages
  • Use localized string keys, not hardcoded strings
  • Assume $script:localizedData is available

String Files

  • Commands/functions: source/en-US/{MyModuleName}.strings.psd1
  • Class resources: source/en-US/{ResourceClassName}.strings.psd1

Key Naming Patterns

  • Format: Verb_FunctionName_Action (underscore separators), e.g. Get_Database_ConnectingToDatabase

String Format

ConvertFrom-StringData @'
    KeyName = Message with {0} placeholder. (PREFIX0001)
'@

String IDs

  • Format: (PREFIX####)
  • PREFIX: First letter of each word in class or function name (SqlSetup → SS, Get-SqlDscDatabase → GSDD)
  • Number: Sequential from 0001

Usage

Write-Verbose -Message ($script:localizedData.KeyName -f $value1)

Files:

  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
source/Public/*.ps1

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines.instructions.md)

Public commands should be located in source/Public/{CommandName}.ps1

Files:

  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
🧠 Learnings (45)
📓 Common learnings
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.402Z
Learning: Applies to **/tests/Integration/**/*.ps1 : Integration tests: use `Connect-SqlDscDatabaseEngine` for SQL Server DB session with correct CI credentials, and always follow with `Disconnect-SqlDscDatabaseEngine`
Learnt from: dan-hughes
Repo: dsccommunity/UpdateServicesDsc PR: 85
File: source/en-US/UpdateServicesDsc.strings.psd1:1-2
Timestamp: 2025-10-04T21:33:23.022Z
Learning: In UpdateServicesDsc (and similar DSC modules), the module-level localization file (source/en-US/<ModuleName>.strings.psd1) can be empty when DSC resources have their own localization files in source/DSCResources/<ResourceName>/en-US/DSC_<ResourceName>.strings.psd1. Automated tests verify localization completeness for resources. Don't flag empty module-level localization files as issues when resources have separate localization.
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.401Z
Learning: Applies to **/*.ps1 : Format public commands as `{Verb}-SqlDsc{Noun}` following PowerShell naming conventions
📚 Learning: 2025-11-27T17:58:02.402Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.402Z
Learning: Applies to azure-pipelines.yml : Integration test script files must be added to a group within the test stage in ./azure-pipelines.yml based on required dependencies

Applied to files:

  • azure-pipelines.yml
📚 Learning: 2025-11-27T17:58:02.402Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.402Z
Learning: Applies to **/tests/Integration/**/*.ps1 : Integration tests: use `Connect-SqlDscDatabaseEngine` for SQL Server DB session with correct CI credentials, and always follow with `Disconnect-SqlDscDatabaseEngine`

Applied to files:

  • azure-pipelines.yml
  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
  • tests/Integration/Commands/README.md
📚 Learning: 2025-11-27T17:58:31.900Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-integration-tests.instructions.md:0-0
Timestamp: 2025-11-27T17:58:31.900Z
Learning: Applies to tests/Integration/Commands/*.Integration.Tests.ps1 : Location for Commands integration tests: `tests/Integration/Commands/{CommandName}.Integration.Tests.ps1`

Applied to files:

  • azure-pipelines.yml
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
  • tests/Integration/Commands/README.md
📚 Learning: 2025-11-27T17:58:02.402Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.402Z
Learning: Applies to **/tests/**/*.tests.ps1 : Add `$env:SqlServerDscCI = $true` in `BeforeAll` block and remove in `AfterAll` block of unit tests

Applied to files:

  • azure-pipelines.yml
  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
  • tests/Integration/Commands/README.md
📚 Learning: 2025-11-27T17:59:27.192Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-pester.instructions.md:0-0
Timestamp: 2025-11-27T17:59:27.192Z
Learning: Applies to **/*.[Tt]ests.ps1 : All public commands and class-based resources must have integration tests

Applied to files:

  • azure-pipelines.yml
  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
  • tests/Integration/Commands/README.md
📚 Learning: 2025-11-27T18:00:35.054Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T18:00:35.054Z
Learning: Applies to tests/Integration/Commands/*.Integration.Tests.ps1 : Integration tests for commands should be located in `tests/Integration/Commands/{CommandName}.Integration.Tests.ps1`

Applied to files:

  • azure-pipelines.yml
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
  • tests/Integration/Commands/README.md
📚 Learning: 2025-11-27T17:58:31.900Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-integration-tests.instructions.md:0-0
Timestamp: 2025-11-27T17:58:31.900Z
Learning: Applies to tests/Integration/**/*.Integration.Tests.ps1 : Call commands with `-Force` parameter where applicable to avoid prompting

Applied to files:

  • azure-pipelines.yml
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
  • tests/Integration/Commands/README.md
📚 Learning: 2025-11-27T17:58:31.900Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-integration-tests.instructions.md:0-0
Timestamp: 2025-11-27T17:58:31.900Z
Learning: Applies to tests/Integration/**/*.Integration.Tests.ps1 : Integration tests must cover all scenarios and code paths

Applied to files:

  • azure-pipelines.yml
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
  • tests/Integration/Commands/README.md
📚 Learning: 2025-11-27T17:58:31.900Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-integration-tests.instructions.md:0-0
Timestamp: 2025-11-27T17:58:31.900Z
Learning: Applies to tests/Integration/**/*.Integration.Tests.ps1 : Integration tests must include the required setup block with BeforeDiscovery that imports DscResource.Test module and BeforeAll that imports the module being tested

Applied to files:

  • azure-pipelines.yml
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
  • tests/Integration/Commands/README.md
📚 Learning: 2025-11-27T17:58:31.900Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-integration-tests.instructions.md:0-0
Timestamp: 2025-11-27T17:58:31.900Z
Learning: Applies to tests/Integration/Resources/*.Integration.Tests.ps1 : Location for Resources integration tests: `tests/Integration/Resources/{ResourceName}.Integration.Tests.ps1`

Applied to files:

  • azure-pipelines.yml
📚 Learning: 2025-11-27T17:59:27.192Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-pester.instructions.md:0-0
Timestamp: 2025-11-27T17:59:27.192Z
Learning: Applies to tests/Unit/Public/*.[Tt]ests.ps1 : Public commands: `tests/Unit/Public/{Name}.Tests.ps1`

Applied to files:

  • azure-pipelines.yml
📚 Learning: 2025-11-27T17:59:27.192Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-pester.instructions.md:0-0
Timestamp: 2025-11-27T17:59:27.192Z
Learning: Applies to **/*.[Tt]ests.ps1 : All public commands, private functions and classes must have unit tests

Applied to files:

  • azure-pipelines.yml
  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
📚 Learning: 2025-11-27T17:59:27.192Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-pester.instructions.md:0-0
Timestamp: 2025-11-27T17:59:27.192Z
Learning: Applies to **/*.[Tt]ests.ps1 : Cover all scenarios and code paths

Applied to files:

  • azure-pipelines.yml
  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-11-27T17:58:02.402Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.402Z
Learning: Applies to **/tests/**/*.tests.ps1 : When unit tests test classes or commands containing SMO types like `[Microsoft.SqlServer.Management.Smo.*]`, ensure they are properly stubbed in SMO.cs

Applied to files:

  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-11-27T18:00:20.925Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-unit-tests.instructions.md:0-0
Timestamp: 2025-11-27T18:00:20.925Z
Learning: Applies to tests/[Uu]nit/**/*.[Tt]ests.ps1 : Use the exact setup block with BeforeDiscovery, BeforeAll, and AfterAll blocks including DscResource.Test module import and PSDefaultParameterValues configuration

Applied to files:

  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-11-27T18:00:20.925Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-unit-tests.instructions.md:0-0
Timestamp: 2025-11-27T18:00:20.925Z
Learning: Applies to tests/[Uu]nit/**/*.[Tt]ests.ps1 : All public commands require parameter set validation tests

Applied to files:

  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
📚 Learning: 2025-11-27T17:58:02.402Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.402Z
Learning: Applies to **/tests/**/*.tests.ps1 : In unit tests: use SMO stub types from SMO.cs, never mock SMO types

Applied to files:

  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
📚 Learning: 2025-11-27T17:59:27.192Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-pester.instructions.md:0-0
Timestamp: 2025-11-27T17:59:27.192Z
Learning: Applies to **/*.[Tt]ests.ps1 : Set `$PSDefaultParameterValues` for `Mock:ModuleName`, `Should:ModuleName`, `InModuleScope:ModuleName`

Applied to files:

  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
📚 Learning: 2025-11-27T18:00:20.925Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-unit-tests.instructions.md:0-0
Timestamp: 2025-11-27T18:00:20.925Z
Learning: Applies to tests/[Uu]nit/**/*.[Tt]ests.ps1 : Parameter set validation tests should use Get-Command with Where-Object filtering and Should assertions to verify ParameterSetName and ParameterListAsString

Applied to files:

  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
📚 Learning: 2025-11-27T18:00:20.925Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-unit-tests.instructions.md:0-0
Timestamp: 2025-11-27T18:00:20.925Z
Learning: Applies to tests/[Uu]nit/**/*.[Tt]ests.ps1 : Parameter property tests should verify mandatory parameter attributes using Get-Command Parameters and Should -BeTrue assertions

Applied to files:

  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
📚 Learning: 2025-08-17T10:15:48.194Z
Learnt from: johlju
Repo: dsccommunity/SqlServerDsc PR: 2136
File: tests/Unit/Public/Remove-SqlDscLogin.Tests.ps1:36-39
Timestamp: 2025-08-17T10:15:48.194Z
Learning: Public command unit tests guideline: Never use InModuleScope unless accessing localized strings from $script:localizedData. PSDefaultParameterValues for InModuleScope should be kept in public command tests to support localized string retrieval when necessary.

Applied to files:

  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
📚 Learning: 2025-08-18T13:50:53.789Z
Learnt from: johlju
Repo: dsccommunity/SqlServerDsc PR: 2132
File: tests/Unit/Public/New-SqlDscLogin.Tests.ps1:0-0
Timestamp: 2025-08-18T13:50:53.789Z
Learning: In SqlServerDsc unit tests, SMO stub objects can be used to verify method calls like Create() on Login objects by adding mock verifications with Should -Invoke, providing more robust testing than just checking for no exceptions.

Applied to files:

  • tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1
  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-10-04T21:33:23.022Z
Learnt from: dan-hughes
Repo: dsccommunity/UpdateServicesDsc PR: 85
File: source/en-US/UpdateServicesDsc.strings.psd1:1-2
Timestamp: 2025-10-04T21:33:23.022Z
Learning: In UpdateServicesDsc (and similar DSC modules), the module-level localization file (source/en-US/<ModuleName>.strings.psd1) can be empty when DSC resources have their own localization files in source/DSCResources/<ResourceName>/en-US/DSC_<ResourceName>.strings.psd1. Automated tests verify localization completeness for resources. Don't flag empty module-level localization files as issues when resources have separate localization.

Applied to files:

  • source/en-US/SqlServerDsc.strings.psd1
📚 Learning: 2025-11-27T17:58:42.320Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-localization.instructions.md:0-0
Timestamp: 2025-11-27T17:58:42.320Z
Learning: Applies to source/**/*.ps1 : Use localized string keys from $script:localizedData, not hardcoded strings, in diagnostic messages

Applied to files:

  • source/en-US/SqlServerDsc.strings.psd1
📚 Learning: 2025-11-27T17:59:01.498Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-mof-resources.instructions.md:0-0
Timestamp: 2025-11-27T17:59:01.498Z
Learning: Applies to source/DSCResources/**/*.psm1 : Use localized strings for all messages including Write-Verbose, Write-Error, and other messaging commands

Applied to files:

  • source/en-US/SqlServerDsc.strings.psd1
📚 Learning: 2025-08-17T10:48:15.384Z
Learnt from: johlju
Repo: dsccommunity/SqlServerDsc PR: 2136
File: source/suffix.ps1:24-24
Timestamp: 2025-08-17T10:48:15.384Z
Learning: In source/suffix.ps1, the Write-Verbose message in the catch block for Import-SqlDscPreferredModule does not need localization because the exception message from Import-SqlDscPreferredModule is already localized by that command, making it an edge case exception to the localization guidelines.

Applied to files:

  • source/en-US/SqlServerDsc.strings.psd1
📚 Learning: 2025-11-27T17:59:01.498Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-mof-resources.instructions.md:0-0
Timestamp: 2025-11-27T17:59:01.498Z
Learning: Applies to source/DSCResources/**/*.psm1 : Import localized strings using `Get-LocalizedData` at the module top level

Applied to files:

  • source/en-US/SqlServerDsc.strings.psd1
📚 Learning: 2025-11-27T17:59:01.498Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-mof-resources.instructions.md:0-0
Timestamp: 2025-11-27T17:59:01.498Z
Learning: Applies to source/DSCResources/**/en-US/DSC_*.strings.psd1 : In `.strings.psd1` files, use underscores as word separators in localized string key names for multi-word keys

Applied to files:

  • source/en-US/SqlServerDsc.strings.psd1
📚 Learning: 2025-11-27T17:59:01.498Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-mof-resources.instructions.md:0-0
Timestamp: 2025-11-27T17:59:01.498Z
Learning: Applies to source/DSCResources/**/en-US/DSC_*.strings.psd1 : Name localized strings file as `DSC_<ResourceName>.strings.psd1` in the `en-US` folder

Applied to files:

  • source/en-US/SqlServerDsc.strings.psd1
📚 Learning: 2025-11-27T17:58:42.320Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-localization.instructions.md:0-0
Timestamp: 2025-11-27T17:58:42.320Z
Learning: Applies to source/en-US/*.strings.psd1 : Prefix string IDs with an acronym derived from the first letter of each word in the class or function name (e.g., SqlSetup → SS, Get-SqlDscDatabase → GSDD), followed by sequential numbers starting from 0001

Applied to files:

  • source/en-US/SqlServerDsc.strings.psd1
📚 Learning: 2025-11-27T17:59:01.498Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-mof-resources.instructions.md:0-0
Timestamp: 2025-11-27T17:59:01.498Z
Learning: Applies to source/DSCResources/**/*.psm1 : Use names returned from `Get-UICulture` for additional language folder names in DSC resources

Applied to files:

  • source/en-US/SqlServerDsc.strings.psd1
📚 Learning: 2025-11-27T17:59:01.498Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-mof-resources.instructions.md:0-0
Timestamp: 2025-11-27T17:59:01.498Z
Learning: Applies to source/DSCResources/**/*.psm1 : Create an `en-US` folder in each DSC resource directory for localized strings

Applied to files:

  • source/en-US/SqlServerDsc.strings.psd1
📚 Learning: 2025-11-27T17:59:01.498Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-mof-resources.instructions.md:0-0
Timestamp: 2025-11-27T17:59:01.498Z
Learning: Applies to source/DSCResources/**/*.psm1 : `Set-TargetResource` verbose messages must start with "Setting the desired state of..."

Applied to files:

  • source/en-US/SqlServerDsc.strings.psd1
📚 Learning: 2025-11-27T18:00:11.915Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-powershell.instructions.md:0-0
Timestamp: 2025-11-27T18:00:11.915Z
Learning: Applies to **/*.{ps1,psm1,psd1} : `$PSCmdlet.ShouldProcess` must use required pattern: localized messages for description, confirmation, and caption

Applied to files:

  • source/en-US/SqlServerDsc.strings.psd1
📚 Learning: 2025-11-27T17:58:02.401Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.401Z
Learning: Applies to **/*.ps1 : Format public commands as `{Verb}-SqlDsc{Noun}` following PowerShell naming conventions

Applied to files:

  • source/en-US/SqlServerDsc.strings.psd1
  • CHANGELOG.md
📚 Learning: 2025-11-27T17:58:42.320Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-localization.instructions.md:0-0
Timestamp: 2025-11-27T17:58:42.320Z
Learning: Applies to source/en-US/*.strings.psd1 : Use Key Naming Pattern format: Verb_FunctionName_Action with underscore separators (e.g., Get_Database_ConnectingToDatabase)

Applied to files:

  • source/en-US/SqlServerDsc.strings.psd1
📚 Learning: 2025-11-27T17:58:02.401Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.401Z
Learning: Applies to **/resources/**/*.ps1 : Add `InstanceName`, `ServerName`, and `Credential` to `$this.ExcludeDscProperties` in Database Engine resources

Applied to files:

  • CHANGELOG.md
  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
  • tests/Integration/Commands/README.md
📚 Learning: 2025-11-27T18:56:46.724Z
Learnt from: johlju
Repo: dsccommunity/SqlServerDsc PR: 1622
File: tests/Integration/DSC_SqlDatabase.Integration.Tests.ps1:1-30
Timestamp: 2025-11-27T18:56:46.724Z
Learning: Integration tests for MOF-based DSC resources (located in source/DSCResources/**) should use the Initialize-TestEnvironment pattern with -ResourceType 'Mof', not the BeforeDiscovery/BeforeAll pattern. The BeforeDiscovery/BeforeAll pattern is for class-based resources only.

Applied to files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-10-12T12:10:48.625Z
Learnt from: johlju
Repo: dsccommunity/SqlServerDsc PR: 2303
File: tests/Integration/Commands/PostInstallationConfiguration.Integration.Tests.ps1:127-143
Timestamp: 2025-10-12T12:10:48.625Z
Learning: For the SqlServerDsc module integration tests, ForceEncryption should not be enabled on the SQL Server instance (DSCSQLTEST) because the module needs to test both encrypted and non-encrypted connection scenarios in CI.

Applied to files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-08-17T10:13:30.079Z
Learnt from: johlju
Repo: dsccommunity/SqlServerDsc PR: 2136
File: source/Public/Remove-SqlDscLogin.ps1:104-108
Timestamp: 2025-08-17T10:13:30.079Z
Learning: In SqlServerDsc unit tests, SMO object stubs (like Login objects) should have properly mocked Parent properties with correct Server stub types and valid InstanceName values, rather than handling null Parent scenarios in production code.

Applied to files:

  • tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1
📚 Learning: 2025-11-27T18:00:35.054Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T18:00:35.054Z
Learning: Add integration tests for all public commands and resources

Applied to files:

  • tests/Integration/Commands/README.md
📚 Learning: 2025-11-27T17:58:20.390Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-class-resource.instructions.md:0-0
Timestamp: 2025-11-27T17:58:20.390Z
Learning: Applies to source/[cC]lasses/**/*.ps1 : DSC class-based resources must implement required methods: `Get()`, `Test()`, `Set()`, `GetCurrentState()`, and `Modify()` following the specified pattern

Applied to files:

  • tests/Integration/Commands/README.md
📚 Learning: 2025-08-28T15:44:12.628Z
Learnt from: johlju
Repo: dsccommunity/SqlServerDsc PR: 2150
File: .github/instructions/dsc-community-style-guidelines-pester.instructions.md:35-35
Timestamp: 2025-08-28T15:44:12.628Z
Learning: The SqlServerDsc repository uses RequiredModules.psd1 to specify Pester with Version = 'latest' and AllowPrerelease = $true, ensuring the latest Pester version (well beyond 5.4) is available, which supports Should -Invoke syntax and other modern Pester features.

Applied to files:

  • tests/Integration/Commands/README.md
📚 Learning: 2025-11-27T17:57:47.608Z
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T17:57:47.608Z
Learning: SqlServerDsc-specific guidelines and requirements override general project guidelines and requirements

Applied to files:

  • tests/Integration/Commands/README.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 (15)
CHANGELOG.md (1)

39-42: Changelog entry looks correct.

Follows Keep a Changelog style, correct command naming, and proper issue link formatting. Good to go.

azure-pipelines.yml (1)

347-347: Pipeline path and placement conform to guidelines; file existence and test conventions require developer verification.

The test path tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1 matches the documented naming standard. However, I cannot verify that the file exists or that it follows integration test conventions (using Connect-SqlDscDatabaseEngine/Disconnect-SqlDscDatabaseEngine and -Force parameters) due to repository access limitations. Run the provided verification script to confirm file existence and that it uses the required database connection management and force parameters.

tests/Integration/Commands/README.md (1)

98-98: LGTM!

The integration test entry follows the existing table format correctly, with appropriate run order and dependencies.

tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1 (3)

1-31: LGTM!

The setup block follows the required integration test pattern with BeforeDiscovery importing DscResource.Test and BeforeAll importing the module.


32-77: LGTM!

The test setup properly uses Connect-SqlDscDatabaseEngine and Disconnect-SqlDscDatabaseEngine as per the repository guidelines, creates isolated test resources, and cleans them up appropriately.


79-161: LGTM!

The test contexts cover both parameter sets, idempotency, error scenarios, pipeline input, Refresh, and PassThru behavior. Commands appropriately use -Force and -ErrorAction 'Stop' per guidelines.

source/en-US/SqlServerDsc.strings.psd1 (1)

425-433: LGTM!

The localization strings follow the established naming conventions, use appropriate placeholders, and include proper string IDs (SSDDF prefix). The caption correctly omits the trailing period.

tests/Unit/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.Tests.ps1 (4)

34-58: LGTM!

The setup correctly sets $env:SqlServerDscCI = $true in BeforeAll and removes it in AfterAll, loads SMO stubs, and configures $PSDefaultParameterValues as required by the testing guidelines.


60-170: LGTM!

The tests effectively use script-scoped variables to track SMO method invocations, covering both parameter sets with proper mock object setup.


172-247: LGTM!

The idempotency test correctly verifies SetDefaultFullTextCatalog is not called when the catalog already matches, and error scenarios properly test both SMO failures and missing database conditions.


249-324: LGTM!

Parameter validation tests follow the required pattern using Get-Command with Where-Object filtering, and properly verify both parameter sets, mandatory parameters, and ShouldProcess support.

source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1 (4)

1-72: LGTM!

The comment-based help is comprehensive with proper sections for SYNOPSIS, DESCRIPTION, PARAMETER, EXAMPLE, INPUTS, and OUTPUTS. The examples cover all parameter sets and common usage patterns.


73-110: LGTM!

The function declaration correctly implements [OutputType()] for both return scenarios, uses full type names for parameters, and properly defines two parameter sets with appropriate validation attributes.


112-118: LGTM!

The Force parameter pattern is correctly implemented as per the coding guidelines.


142-194: LGTM!

The ShouldProcess implementation follows the required pattern with three localized messages. The use of Write-Debug inside the block is appropriate, and the error handling uses ThrowTerminatingError with a properly constructed ErrorRecord.

@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94%. Comparing base (ed34b01) to head (e1e9ae8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@         Coverage Diff          @@
##           main   #2352   +/-   ##
====================================
  Coverage    94%     94%           
====================================
  Files       164     165    +1     
  Lines      9560    9583   +23     
====================================
+ Hits       9067    9090   +23     
  Misses      493     493           
Flag Coverage Δ
unit 94% <100%> (+<1%) ⬆️
Files with missing lines Coverage Δ
...ublic/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1 100% <100%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1 (2)

68-72: Tighten .OUTPUTS help to match documented pattern

Current .OUTPUTS text is accurate but does not strictly follow the “one type per OUTPUTS block” pattern from the guidelines. Consider restructuring like this for clarity and toolability:

    .OUTPUTS
        None

        No objects are returned by default.

    .OUTPUTS
        Microsoft.SqlServer.Management.Smo.Database

        Returned when PassThru is specified.

As per coding guidelines, .OUTPUTS should repeat the keyword for each return type.


136-139: Optional: clarify/ensure refresh semantics for pipeline DatabaseObject

For the DatabaseObjectSet parameter set, callers might expect the input [Microsoft.SqlServer.Management.Smo.Database] instance to reflect the updated DefaultFullTextCatalog after the call. Today you explicitly call .Refresh() only when -PassThru is used.

If you want to guarantee that the in-memory DatabaseObject is up‑to‑date when used via the pipeline (even without -PassThru), consider explicitly refreshing it after a successful change, e.g.:

            if ($sqlDatabaseObject.DefaultFullTextCatalog -eq $CatalogName)
            {
                Write-Debug -Message ($script:localizedData.DatabaseDefaultFullTextCatalog_AlreadyCorrect -f $sqlDatabaseObject.Name, $CatalogName)
            }
            else
            {
                Write-Debug -Message ($script:localizedData.DatabaseDefaultFullTextCatalog_Updating -f $sqlDatabaseObject.Name, $CatalogName)

                try
                {
                    $sqlDatabaseObject.SetDefaultFullTextCatalog($CatalogName)
                }
                catch
                {
                    # unchanged...
                }

                if ($PSCmdlet.ParameterSetName -eq 'DatabaseObjectSet' -and -not $PassThru.IsPresent)
                {
                    $sqlDatabaseObject.Refresh()
                }

                Write-Debug -Message ($script:localizedData.DatabaseDefaultFullTextCatalog_Updated -f $sqlDatabaseObject.Name, $CatalogName)
            }

This keeps existing -PassThru behavior while making the pipeline scenario explicit. If SMO already updates the in‑memory object fully here, you may instead just document that behavior.

Also applies to: 148-176, 178-184

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb9c63a and 41e6dd1.

📒 Files selected for processing (1)
  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1 (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.ps1

📄 CodeRabbit inference engine (.github/instructions/SqlServerDsc-guidelines.instructions.md)

**/*.ps1: Format public commands as {Verb}-SqlDsc{Noun} following PowerShell naming conventions
Format private functions as {Verb}-{Noun} following PowerShell naming conventions

Files:

  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
source/**/*.ps1

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines-localization.instructions.md)

source/**/*.ps1: Localize all Write-Debug, Write-Verbose, Write-Error, Write-Warning and $PSCmdlet.ThrowTerminatingError() messages in PowerShell scripts
Use localized string keys from $script:localizedData, not hardcoded strings, in diagnostic messages
Reference localized strings using the syntax: Write-Verbose -Message ($script:localizedData.KeyName -f $value1)

Localize all strings using string keys; remove any orphaned string keys

Files:

  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1

⚙️ CodeRabbit configuration file

source/**/*.ps1: # Localization Guidelines

Requirements

  • Localize all Write-Debug, Write-Verbose, Write-Error, Write-Warning and $PSCmdlet.ThrowTerminatingError() messages
  • Use localized string keys, not hardcoded strings
  • Assume $script:localizedData is available

String Files

  • Commands/functions: source/en-US/{MyModuleName}.strings.psd1
  • Class resources: source/en-US/{ResourceClassName}.strings.psd1

Key Naming Patterns

  • Format: Verb_FunctionName_Action (underscore separators), e.g. Get_Database_ConnectingToDatabase

String Format

ConvertFrom-StringData @'
    KeyName = Message with {0} placeholder. (PREFIX0001)
'@

String IDs

  • Format: (PREFIX####)
  • PREFIX: First letter of each word in class or function name (SqlSetup → SS, Get-SqlDscDatabase → GSDD)
  • Number: Sequential from 0001

Usage

Write-Verbose -Message ($script:localizedData.KeyName -f $value1)

Files:

  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
**/*.{ps1,psm1,psd1}

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines-powershell.instructions.md)

**/*.{ps1,psm1,psd1}: Use descriptive names with 3+ characters and no abbreviations for functions, variables, and identifiers
Functions: Use PascalCase with Verb-Noun format using approved verbs
Parameters: Use PascalCase
Variables: Use camelCase
Keywords: Use lower-case
Classes: Use PascalCase
Include scope for script/global/environment variables: $script:, $global:, $env:
Use 4 spaces for indentation (no tabs)
Use one space around operators: $a = 1 + 2
Use one space between type and variable: [String] $name
Use one space between keyword and parenthesis: if ($condition)
No spaces on empty lines
Try to limit lines to 120 characters
Newline before opening brace (except variable assignments)
One newline after opening brace
Two newlines after closing brace (one if followed by another brace or continuation)
Use single quotes unless variable expansion is needed: 'text' vs "text $variable"
Single-line arrays: @('one', 'two', 'three'); multi-line: each element on separate line with proper indentation
Do not use the unary comma operator (,) in return statements to force an array
Empty hashtables: @{}; each property on separate line with proper indentation; use PascalCase for properties
Single-line comments: # Comment (capitalized, on own line); multi-line: <# Comment #> format with opening/closing brackets on own line
Do not include commented-out code
Always add comment-based help to all functions and scripts with SYNOPSIS, DESCRIPTION (40+ chars), PARAMETER, and EXAMPLE sections
Comment-based help indentation: keywords 4 spaces, text 8 spaces
Include examples in comment-based help for all parameter sets and combinations
INPUTS section in comment-based help: list each pipeline-accepted type (one per line) with 1-line description, repeat keyword for each input type
OUTPUTS section in comment-based help: list each return type (one per line) with 1-line description, repeat keyword for each output type; must match both [OutputType()] and actual ret...

Files:

  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
source/Public/*.ps1

📄 CodeRabbit inference engine (.github/instructions/dsc-community-style-guidelines.instructions.md)

Public commands should be located in source/Public/{CommandName}.ps1

Files:

  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
**

⚙️ CodeRabbit configuration file

**: # DSC Community Guidelines

Terminology

  • Command: Public command
  • Function: Private function
  • Resource: DSC class-based resource

Build & Test Workflow Requirements

  • Run PowerShell script files from repository root
  • Setup build and test environment (once per pwsh session): ./build.ps1 -Tasks noop
  • Build project before running tests: ./build.ps1 -Tasks build
  • Always run tests in new pwsh session: Invoke-Pester -Path @({test paths}) -Output Detailed

File Organization

  • Public commands: source/Public/{CommandName}.ps1
  • Private functions: source/Private/{FunctionName}.ps1
  • Classes: source/Classes/{DependencyGroupNumber}.{ClassName}.ps1
  • Enums: source/Enum/{DependencyGroupNumber}.{EnumName}.ps1
  • Unit tests: tests/Unit/{Classes|Public|Private}/{Name}.Tests.ps1
  • Integration tests: tests/Integration/Commands/{CommandName}.Integration.Tests.ps1

Requirements

  • Follow instructions over existing code patterns
  • Follow PowerShell style and test guideline instructions strictly
  • Always update CHANGELOG.md Unreleased section
  • Localize all strings using string keys; remove any orphaned string keys
  • Check DscResource.Common before creating private functions
  • Separate reusable logic into private functions
  • DSC resources should always be created as class-based resources
  • Add unit tests for all commands/functions/resources
  • Add integration tests for all public commands and resources

Files:

  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
{**/*.ps1,**/*.psm1,**/*.psd1}

⚙️ CodeRabbit configuration file

{**/*.ps1,**/*.psm1,**/*.psd1}: # PowerShell Guidelines

Naming

  • Use descriptive names (3+ characters, no abbreviations)
  • Functions: PascalCase with Verb-Noun format using approved verbs
  • Parameters: PascalCase
  • Variables: camelCase
  • Keywords: lower-case
  • Classes: PascalCase
  • Include scope for script/global/environment variables: $script:, $global:, $env:

File naming

  • Class files: ###.ClassName.ps1 format (e.g. 001.SqlReason.ps1, 004.StartupParameters.ps1)

Formatting

Indentation & Spacing

  • Use 4 spaces (no tabs)
  • One space around operators: $a = 1 + 2
  • One space between type and variable: [String] $name
  • One space between keyword and parenthesis: if ($condition)
  • No spaces on empty lines
  • Try to limit lines to 120 characters

Braces

  • Newline before opening brace (except variable assignments)
  • One newline after opening brace
  • Two newlines after closing brace (one if followed by another brace or continuation)

Quotes

  • Use single quotes unless variable expansion is needed: 'text' vs "text $variable"

Arrays

  • Single line: @('one', 'two', 'three')
  • Multi-line: each element on separate line with proper indentation
  • Do not use the unary comma operator (,) in return statements to force
    an array

Hashtables

  • Empty: @{}
  • Each property on separate line with proper indentation
  • Properties: Use PascalCase

Comments

  • Single line: # Comment (capitalized, on own line)
  • Multi-line: <# Comment #> format (opening and closing brackets on own line), and indent text
  • No commented-out code

Comment-based help

  • Always add comment-based help to all functions and scripts
  • Comment-based help: SYNOPSIS, DESCRIPTION (40+ chars), PARAMETER, EXAMPLE sections before function/class
  • Comment-based help indentation: keywords 4 spaces, text 8 spaces
  • Include examples for all parameter sets and combinations
  • INPUTS: List each pipeline‑accepted type (one per line) with a 1‑line description...

Files:

  • source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1
🧠 Learnings (1)
📓 Common learnings
Learnt from: dan-hughes
Repo: dsccommunity/UpdateServicesDsc PR: 85
File: source/en-US/UpdateServicesDsc.strings.psd1:1-2
Timestamp: 2025-10-04T21:33:23.022Z
Learning: In UpdateServicesDsc (and similar DSC modules), the module-level localization file (source/en-US/<ModuleName>.strings.psd1) can be empty when DSC resources have their own localization files in source/DSCResources/<ResourceName>/en-US/DSC_<ResourceName>.strings.psd1. Automated tests verify localization completeness for resources. Don't flag empty module-level localization files as issues when resources have separate localization.
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.402Z
Learning: Applies to **/tests/Integration/**/*.ps1 : Integration tests: use `Connect-SqlDscDatabaseEngine` for SQL Server DB session with correct CI credentials, and always follow with `Disconnect-SqlDscDatabaseEngine`
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-mof-resources.instructions.md:0-0
Timestamp: 2025-11-27T17:59:01.498Z
Learning: Applies to source/DSCResources/**/*.psm1 : Create an `en-US` folder in each DSC resource directory for localized strings
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.402Z
Learning: Applies to **/tests/**/*.tests.ps1 : Add `$env:SqlServerDscCI = $true` in `BeforeAll` block and remove in `AfterAll` block of unit tests
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-mof-resources.instructions.md:0-0
Timestamp: 2025-11-27T17:59:01.498Z
Learning: Applies to source/DSCResources/**/*.psm1 : Import localized strings using `Get-LocalizedData` at the module top level
Learnt from: johlju
Repo: dsccommunity/SqlServerDsc PR: 2136
File: source/suffix.ps1:24-24
Timestamp: 2025-08-17T10:48:15.384Z
Learning: In source/suffix.ps1, the Write-Verbose message in the catch block for Import-SqlDscPreferredModule does not need localization because the exception message from Import-SqlDscPreferredModule is already localized by that command, making it an edge case exception to the localization guidelines.
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-localization.instructions.md:0-0
Timestamp: 2025-11-27T17:58:42.320Z
Learning: Applies to source/en-US/*.strings.psd1 : Store command/function localized strings in source/en-US/{MyModuleName}.strings.psd1 files
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/SqlServerDsc-guidelines.instructions.md:0-0
Timestamp: 2025-11-27T17:58:02.401Z
Learning: Applies to **/*.ps1 : Format public commands as `{Verb}-SqlDsc{Noun}` following PowerShell naming conventions
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-mof-resources.instructions.md:0-0
Timestamp: 2025-11-27T17:59:01.498Z
Learning: Applies to source/DSCResources/**/*.psm1 : Use names returned from `Get-UICulture` for additional language folder names in DSC resources
Learnt from: CR
Repo: dsccommunity/SqlServerDsc PR: 0
File: .github/instructions/dsc-community-style-guidelines-mof-resources.instructions.md:0-0
Timestamp: 2025-11-27T17:59:01.498Z
Learning: Applies to source/DSCResources/**/*.psm1 : Use localized strings for all messages including Write-Verbose, Write-Error, and other messaging commands
⏰ 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). (2)
  • GitHub Check: dsccommunity.SqlServerDsc (Build Package Module)
  • GitHub Check: PSScriptAnalyzer
🔇 Additional comments (1)
source/Public/Set-SqlDscDatabaseDefaultFullTextCatalog.ps1 (1)

73-186: Overall cmdlet implementation looks solid and aligned with module guidelines

The parameter sets, ShouldProcess/Force pattern, idempotence check, localized diagnostics, and error handling around SetDefaultFullTextCatalog() all look correct and consistent with SqlServerDsc/DSC Community guidance. No blocking issues from a correctness or style perspective.

@johlju
Copy link
Member Author

johlju commented Nov 29, 2025

For some reason the fulltext catalog is not being persistent, it seem to set in the first assertion, but then fails when retreving the database again. I'm at loss what's missing...

First assertion (PASSES):

https://github.com/johlju/SqlServerDsc/blob/41e6dd1d905426330c598bcfed20bed5a9777672/tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1#L81-L82

This calls the method

Second assertion (FAILED):

https://github.com/johlju/SqlServerDsc/blob/41e6dd1d905426330c598bcfed20bed5a9777672/tests/Integration/Commands/Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1#L84-L86

Running tests from 'D:\a\1\s\tests\Integration\Commands\Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1'
VERBOSE: Impersonate credential 'SqlAdmin' with login type 'WindowsUser'. (SQLCOMMON0056)
VERBOSE: Connected to SQL instance 'runnervmz4wi3\DSCSQLTEST'. (SQLCOMMON0018)
VERBOSE: Original default full-text catalog of database 'SqlDscTestSetFTCatalog_707944013' is ''.
Describing Set-SqlDscDatabaseDefaultFullTextCatalog
 Context When setting default full-text catalog using ServerObject parameter set
##[error]    [-] Should set default catalog successfully 137ms (133ms|4ms)
##[error]     Expected strings to be the same, but they were different.
##[error]     Expected length: 24
##[error]     Actual length:   0
##[error]     Strings differ at index 0.
##[error]     Expected: 'TestFTCatalog1_664379267'
##[error]     But was:  ''
##[error]                ^
##[error]     at $resultDb.DefaultFullTextCatalog | Should -Be $script:testCatalogName1, D:\a\1\s\tests\Integration\Commands\Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1:82
##[error]     at Invoke-Assertion, D:\a\1\s\output\RequiredModules\Pester\6.0.0\Pester.psm1:11391
##[error]     at Should<End>, D:\a\1\s\output\RequiredModules\Pester\6.0.0\Pester.psm1:11330
##[error]     at <ScriptBlock>, D:\a\1\s\tests\Integration\Commands\Set-SqlDscDatabaseDefaultFullTextCatalog.Integration.Tests.ps1:82

@johlju johlju added help wanted The issue is up for grabs for anyone in the community. needs review The pull request needs a code review. labels Nov 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted The issue is up for grabs for anyone in the community. needs review The pull request needs a code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set-SqlDscDatabaseDefaultFullTextCatalog: New command proposal

1 participant