Skip to content

Commit

Permalink
[dsccommunity#864] Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bozho committed May 6, 2019
1 parent 15aef99 commit b8dcf2a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@
when the backup file path was changed, and the path was ending with
a backslash ([issue #1307](https://github.com/PowerShell/SqlServerDsc/issues/1307)).
- 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

Expand Down
11 changes: 6 additions & 5 deletions DSCResources/MSFT_SqlRS/MSFT_SqlRS.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -899,9 +899,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]
Expand Down Expand Up @@ -970,7 +971,7 @@ function Invoke-RsCimMethod
ErrorAction = 'Stop'
}

if ($PSBoundParameters.ContainsKey('Arguments'))
if ( $PSBoundParameters.ContainsKey('Arguments') )
{
$invokeCimMethodParameters['Arguments'] = $Arguments
}
Expand All @@ -981,9 +982,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
Expand Down

0 comments on commit b8dcf2a

Please sign in to comment.