microsoft / microsoft/sql-server-samples
Default Checks Included when using -configuration flag in get/invoke-sqlassessment
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 11.2k
- Forks
- 9.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 14
Description
When running the following command I get checks that are not included in 'databaseConfig.json'
$databases = Get-SqlDatabase -ServerInstance 'localhost'
$checks = Get-SqlAssessmentItem $databases -Configuration "C:\SQL-Assessment-API\databaseConfig.json" | Select Id, Description -Unique
$checks
The same is true when I use the invoke-sqlassessment cmdlet.
Is this expected behavior? How would I pass only the checks associated with my config file? The only way I've found so far is to pupulate my $checks in conjunction with out-gridview -passthough, to filter out what I don't want.
Output from my command:

Content of my config.json:

Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Get-SqlAssessmentItem and invoke-sqlassessment commands with the supplied databaseConfig.json, then compare the returned check IDs with the configuration. Done means determining whether default checks are incorrectly included and, if so, returning only the checks associated with the configuration; otherwise, document the expected filtering behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100