File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -174,11 +174,13 @@ function Get-SqlDscRSSetupConfiguration
174174 $reportServerCurrentVersion = [System.Version ] $returnObject.CurrentVersion
175175
176176 # Get values from MSReportServer_Instance
177- $msReportServerInstance = Get-CimInstance - Namespace (' root\Microsoft\SqlServer\ReportServer\RS_{0}\v{1}' -f $instance.InstanceName , $reportServerCurrentVersion.Major ) - ClassName ' MSReportServer_Instance' - ErrorAction ' SilentlyContinue'
178- $msReportServerInstance = $msReportServerInstance | Where-Object - FilterScript {
179- $_.InstanceId -eq $returnObject.InstanceId
177+ $getCimInstanceParameters = @ {
178+ Filter = " InstanceId='{0}'" -f $returnObject.InstanceId
179+ Namespace = ' root\Microsoft\SqlServer\ReportServer\RS_{0}\v{1}' -f $instance.InstanceName , $reportServerCurrentVersion.Major
180+ ClassName = ' MSReportServer_Instance'
181+ ErrorAction = ' SilentlyContinue'
180182 }
181-
183+ $msReportServerInstance = Get-CimInstance @getCimInstanceParameters
182184 if ($msReportServerInstance )
183185 {
184186 $returnObject.EditionID = $msReportServerInstance.EditionID
You can’t perform that action at this time.
0 commit comments