dbatools is a free PowerShell module with over 200 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


Get-DbaDbQueryStoreOptions

Retrieves and returns the Query Store configuration for every database that has the Query Store feature enabled.

Screenshots

dbatools-Get-DbaDbQueryStoreOptions

Examples

Returns Query Store configuration settings for every database on the ServerA\sql instance.

Get-DbaDbQueryStoreOptions -SqlInstance ServerA\sql

Returns the Query Store configuration for all databases on ServerA\sql where the Query Store feature is in Read/Write mode.

Get-DbaDbQueryStoreOptions -SqlInstance ServerA\sql | Where-Object {$_.ActualState -eq “ReadWrite”}

Returns Query Store configuration settings for every database on the ServerA\sql instance inside a table format.

Get-DbaDbQueryStoreOptions -SqlInstance localhost | format-table -AutoSize -Wrap

Author

This command was created by Enrico van de Laar. You can find Enrico on Twitter.

This command was created by Klaas Vandenberghe. You can find Klaas on Twitter.

Get-Help

From PowerShell, execute Get-Help Get-DbaDbQueryStoreOptions -Detailed for more information on this function.

Source Code

Want to see the source code? View Get-DbaDbQueryStoreOptions.ps1 on GitHub
 

Related commands