diff --git a/CHANGELOG.md b/CHANGELOG.md index c726f876f..8d9373321 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,7 +51,8 @@ - ReadOnlyRoutingList now gets updated without throwing an error on the first run ([issue #518](https://github.com/PowerShell/SqlServerDsc/issues/518)). - Changes to SqlRs - - [issue #864](https://github.com/PowerShell/SqlServerDsc/issues/864) SqlRs can now initialise SSRS 2017 instances + - [issue #864](https://github.com/PowerShell/SqlServerDsc/issues/864) SqlRs + can now initialise SSRS 2017 instances ## 12.3.0.0 diff --git a/DSCResources/MSFT_SqlRS/MSFT_SqlRS.psm1 b/DSCResources/MSFT_SqlRS/MSFT_SqlRS.psm1 index 7f69a6aa7..7ce8a8d62 100644 --- a/DSCResources/MSFT_SqlRS/MSFT_SqlRS.psm1 +++ b/DSCResources/MSFT_SqlRS/MSFT_SqlRS.psm1 @@ -840,9 +840,10 @@ function Get-ReportingServicesData { $instanceId = (Get-ItemProperty -Path $instanceNamesRegistryKey -Name $InstanceName).$InstanceName - $sqlVersion = if(Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\$instanceId\MSSQLServer\CurrentVersion") { + if( Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\$instanceId\MSSQLServer\CurrentVersion" ) + { # SQL Server 2017 SSRS stores current SQL Server version to a different Registry path. - [int]((Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\$InstanceId\MSSQLServer\CurrentVersion" -Name "CurrentVersion").CurrentVersion).Split(".")[0] + $sqlVersion = [int]((Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\$InstanceId\MSSQLServer\CurrentVersion" -Name "CurrentVersion").CurrentVersion).Split(".")[0] } else { [int]((Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\$instanceId\Setup" -Name "Version").Version).Split(".")[0] @@ -911,7 +912,7 @@ function Invoke-RsCimMethod ErrorAction = 'Stop' } - if ($PSBoundParameters.ContainsKey('Arguments')) + if ( $PSBoundParameters.ContainsKey('Arguments') ) { $invokeCimMethodParameters['Arguments'] = $Arguments } @@ -922,9 +923,9 @@ function Invoke-RsCimMethod If an general error occur in the Invoke-CimMethod, like calling a method that does not exist, returns $null in $invokeCimMethodResult. #> - if ($invokeCimMethodResult -and $invokeCimMethodResult.HRESULT -ne 0) + if ( $invokeCimMethodResult -and $invokeCimMethodResult.HRESULT -ne 0 ) { - if ($invokeCimMethodResult | Get-Member -Name 'ExtendedErrors') + if ( $invokeCimMethodResult | Get-Member -Name 'ExtendedErrors' ) { <# The returned object property ExtendedErrors is an array