Skip to content

chore: Add VS Code recommended extensions, settings, and build tasks #465

Description

@PlagueHO

Summary

The repository has no .vscode/ folder. Add the standard VS Code workspace configuration files used across DSC Community modules (aligned with SqlServerDsc) to provide a consistent developer experience for all contributors.


Files to create

.vscode/extensions.json

Recommended extensions for contributors:

{
    "recommendations": [
        "davidanson.vscode-markdownlint",
        "pspester.pester-test",
        "ms-vscode.powershell",
        "streetsidesoftware.code-spell-checker"
    ]
}

.vscode/tasks.json

Replace the minimal workspace tasks with a comprehensive set aligned to the build.yaml workflow tasks. All tasks should use ./build.ps1 (not &${cwd}/build.ps1) and target pwsh on Linux/macOS and powershell.exe on Windows.

Tasks to include:

Label Build group Command Notes
noop ./build.ps1 -Tasks noop Resolves and restores dependencies; run once per pwsh session before testing
build build (default) ./build.ps1 -AutoRestore -Tasks build Full module build
test test (default) ./build.ps1 -Tasks noop; Invoke-Pester -Path './tests/Unit' -Output Detailed Unit tests without coverage
test-with-coverage test ./build.ps1 -Tasks noop; Invoke-Pester -Path './tests/Unit' -Output Detailed with coverage enabled Unit tests with code coverage
hqrmtest ./build.ps1 -AutoRestore -Tasks hqrmtest -CodeCoverageThreshold 0 High Quality Resource Module (HQRM) QA tests

Each task should include:

  • A problemMatcher for surfacing Pester failures in the VS Code Problems panel
  • "panel": "new" for build; "panel": "dedicated" for test tasks
  • "focus": true and "reveal": "always" on presentation

Use the tasks.json from SqlServerDsc as the reference and adapt the test task commands for this module's test path structure (tests/Unit/DSCResources/ and tests/Unit/Classes/ instead of tests/Unit/Public/, tests/Unit/Private/, etc.).


.vscode/settings.json

Workspace settings to enforce consistent formatting and tooling. Base on the SqlServerDsc settings.json and adapt:

  • PowerShell code formattingopenBraceOnSameLine: false, newLineAfterOpenBrace: true, 4-space indent, preset: Custom etc.
  • PSScriptAnalyzerpowershell.scriptAnalysis.settingsPath pointing to .vscode/analyzersettings.psd1
  • Pester integrationpester.testFilePath patterns covering tests/Unit/**/*.Tests.ps1 and tests/QA/*.Tests.ps1; pester.pesterModulePath: ./output/RequiredModules/Pester; pester.runTestsInNewProcess: true; powershell.pester.useLegacyCodeLens: false
  • GitHub Copilotgithub.copilot.chat.codeGeneration.useInstructionFiles: true
  • Editorfiles.trimTrailingWhitespace: true, files.insertFinalNewline: true, files.trimFinalNewlines: true
  • cSpellcSpell.dictionaries: ["powershell"] with project-specific word list cleaned of SQL Server terms; add ComputerManagementDsc-relevant words
  • Markdownlintmarkdownlint.ignore: [".github/CODEOWNERS"]
  • Terminal profiles — default to pwsh on Linux/macOS/Windows for consistent behavior with Copilot agent terminal

Remove all SQL Server–specific cSpell.words and cSpell.ignoreRegExpList entries from the SqlServerDsc source.


.vscode/analyzersettings.psd1

PSScriptAnalyzer settings file for the PowerShell extension's inline analysis. Base on the SqlServerDsc analyzersettings.psd1 and adapt:

  • CustomRulePath — keep ./output/RequiredModules/DscResource.AnalyzerRules and ./output/RequiredModules/Indented.ScriptAnalyzerRules; remove the SqlServerDsc-specific ./tests/QA/AnalyzerRules/SqlServerDsc.AnalyzerRules.psm1 entry (or replace with the equivalent path if this repo has custom analyzer rules)
  • IncludeDefaultRules: $true
  • Keep the full IncludeRules list of DSC Community standard rules (both default PSScriptAnalyzer rules and DSC-specific rules)
  • Keep the Rules hashtable for PSUseConsistentWhitespace, PSPlaceOpenBrace, PSPlaceCloseBrace, PSAlignAssignmentStatement

Acceptance criteria

  • .vscode/extensions.json created with the four recommended extensions
  • .vscode/tasks.json created with noop, build, test, test-with-coverage, and hqrmtest tasks
  • .vscode/tasks.json test task paths reflect this repo's unit test folder layout (tests/Unit/DSCResources/, tests/Unit/Classes/)
  • .vscode/settings.json created with PowerShell formatting, Pester, cSpell, Copilot instruction files, and terminal profile settings
  • .vscode/settings.json contains no SQL Server–specific words or patterns
  • .vscode/analyzersettings.psd1 created with DSC Community analyzer rules; no SqlServerDsc-specific custom rule path

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions