From 56d716a32a0007d3963e1414ce8a27ff656b4ac3 Mon Sep 17 00:00:00 2001 From: Tom Rees <26275759+tominyorks@users.noreply.github.com> Date: Sat, 13 Jan 2024 16:10:35 +0000 Subject: [PATCH] Update Set-DbaDbQueryStoreOption.ps1 (#9205) --- public/Set-DbaDbQueryStoreOption.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/Set-DbaDbQueryStoreOption.ps1 b/public/Set-DbaDbQueryStoreOption.ps1 index 5f2f0739b4..5e4d40e144 100644 --- a/public/Set-DbaDbQueryStoreOption.ps1 +++ b/public/Set-DbaDbQueryStoreOption.ps1 @@ -170,7 +170,7 @@ function Set-DbaDbQueryStoreOption { } # We have to exclude all the system databases since they cannot have the Query Store feature enabled - $dbs = Get-DbaDatabase -SqlInstance $server -ExcludeDatabase $ExcludeDatabase -Database $Database | Where-Object IsAccessible + $dbs = Get-DbaDatabase -SqlInstance $server -ExcludeDatabase $ExcludeDatabase -Database $Database | Where-Object { $_.IsAccessible -and !$_.IsDatabaseSnapshot } foreach ($db in $dbs) { Write-Message -Level Verbose -Message "Processing $($db.name) on $instance"