{"id":14063825,"url":"https://github.com/DBTrenches/SQLChecks","last_synced_at":"2025-07-29T16:34:08.792Z","repository":{"id":44069112,"uuid":"242831174","full_name":"DBTrenches/SQLChecks","owner":"DBTrenches","description":"Helper functions and tests for SQL Server","archived":false,"fork":false,"pushed_at":"2023-12-22T12:03:43.000Z","size":533,"stargazers_count":3,"open_issues_count":4,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-13T07:05:33.276Z","etag":null,"topics":["sqlserver"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DBTrenches.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-02-24T20:02:26.000Z","updated_at":"2023-07-26T19:29:37.000Z","dependencies_parsed_at":"2023-12-22T12:15:55.101Z","dependency_job_id":"5dad261d-b7c8-4e5d-b414-2449998c1d2c","html_url":"https://github.com/DBTrenches/SQLChecks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DBTrenches%2FSQLChecks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DBTrenches%2FSQLChecks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DBTrenches%2FSQLChecks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DBTrenches%2FSQLChecks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DBTrenches","download_url":"https://codeload.github.com/DBTrenches/SQLChecks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228032909,"owners_count":17858913,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["sqlserver"],"created_at":"2024-08-13T07:03:31.629Z","updated_at":"2024-12-04T02:30:28.280Z","avatar_url":"https://github.com/DBTrenches.png","language":"PowerShell","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"readme":"# SQLChecks\n[![Build Status](https://img.shields.io/appveyor/ci/taddison/SQLChecks.svg)](https://ci.appveyor.com/project/taddison/sqlchecks)\n[![Test Status](https://img.shields.io/appveyor/tests/taddison/SQLChecks.svg)](https://ci.appveyor.com/project/taddison/sqlchecks/build/tests)\n\nHelper functions and tests for SQL Server.\n\nRequires the `SqlServer`, `Pester`, and `OMSIngestionAPI` modules.\n\nFor more information refer to [the documentation](./docs/Readme.md).\n\n## Example Usage\nFirst of all import the module.\n\n```powershell\nImport-Module .\\src\\SQLChecks -Force\n```\n\nAnd then pass a configuration file to `Invoke-SqlChecks`.\n\n```powershell\nInvoke-SqlChecks -ConfigPath .\\examples\\simple\\localhost.config.json\n```\n\nYou can also test a single item based on its tag.\n\n```powershell\nInvoke-SqlChecks -ConfigPath .\\examples\\simple\\localhost.config.json -Tag CheckForOversizedIndexes\n```\n\nOr loop through a set of configuration files (`Invoke-SqlChecks` accepts paths on the pipeline, as well as objects from `Get-ChildItem`).\n\n```powershell\nGet-ChildItem -Filter *.config.json -Path .\\examples\\simple | Invoke-SqlChecks\n```\n\nIt is also possible to pass configurations to `Invoke-SqlChecks`.\n\n```powershell\n$config = Read-SqlChecksConfig .\\examples\\simple\\localhost.config.json\nInvoke-SqlChecks -Config $config\n```\n\nYou can find some example configuration files in the `examples` folder.\n\n## Database Specific Checks\nSome checks target a database (e.g. checking for oversized indexes).  By default these checks will skip:\n\n- Databases that are not ONLINE\n- Databases that are secondaries in an availability group\n\nSome checks also exclude system databases by default - for more detail consult the test definitions in the `src/SQLChecks/Tests` folder.\n\n## Availability Group Support\nA config file can specify that databases for a specific availability group should be checked.  This is set with the `DatabasesToCheck` configuration value and the `AvailabilityGroup` value.\n\nTo only run database-specific checks on databases that belong to the `AG1` availability group, your config might look like this:\n\n```json\n{\n    \"ServerInstance\": \"localhost\",\n    \"DatabasesToCheck\": \"AGOnly\",\n    \"AvailabilityGroup\": \"AG1\"\n    ...\n}\n```\n\nYou can also specify a value of `LocalOnly` for `DatabasesToCheck`, which will cause database-specific checks to skip any database that belongs to an availability group.\n\nIf you do not specify a value, then every database (except for default exclusions) is checked.\n\n## PowerShell Core Support\nSQLChecks :heart: PSCore!  Tested and working with `PSCore 6.2.1rc` and `SqlServer 21.1.18095preview`.\n\nAll other dependencies (Pester, OMSIngestionApi) work on Core as of 6.1.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDBTrenches%2FSQLChecks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDBTrenches%2FSQLChecks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDBTrenches%2FSQLChecks/lists"}