@@ -238,12 +238,10 @@ function Get-TargetResource
238
238
Report Manager/Report Web App virtual directory name. Optional.
239
239
240
240
. PARAMETER ReportServerReservedUrl
241
- Report Server URL reservations. Optional. If not specified,
242
- 'http://+:80' URL reservation will be used.
241
+ Report Server URL reservations. Optional.
243
242
244
243
. PARAMETER ReportsReservedUrl
245
- Report Manager/Report Web App URL reservations. Optional.
246
- If not specified, 'http://+:80' URL reservation will be used.
244
+ Report Manager/Report Web App URL reservations.
247
245
248
246
. PARAMETER HttpsCertificateThumbprint
249
247
The thumbprint of the certificate used to secure SSL communication.
@@ -361,11 +359,11 @@ function Set-TargetResource
361
359
362
360
[Parameter ()]
363
361
[System.String []]
364
- $ReportServerReservedUrl = @ ( ' http://+:80 ' ) ,
362
+ $ReportServerReservedUrl ,
365
363
366
364
[Parameter ()]
367
365
[System.String []]
368
- $ReportsReservedUrl = @ ( ' http://+:80 ' ) ,
366
+ $ReportsReservedUrl ,
369
367
370
368
[Parameter ()]
371
369
[System.String ]
@@ -798,97 +796,103 @@ function Set-TargetResource
798
796
# endregion Virtual Directories
799
797
800
798
# region Reserved URLs
801
- $compareParameters = @ {
802
- ReferenceObject = $currentConfig.ReportServerReservedUrl
803
- DifferenceObject = $ReportServerReservedUrl
804
- }
805
-
806
- if ( ($null -ne $ReportServerReservedUrl ) -and ($null -ne (Compare-Object @compareParameters )) )
799
+ if ( $PSBoundParameters.ContainsKey (' EncryptionKeyBackupPath' ) )
807
800
{
808
- $restartReportingService = $true
801
+ $compareParameters = @ {
802
+ ReferenceObject = $currentConfig.ReportServerReservedUrl
803
+ DifferenceObject = $ReportServerReservedUrl
804
+ }
809
805
810
- $currentConfig.ReportServerReservedUrl | ForEach-Object - Process {
811
- $invokeRsCimMethodParameters = @ {
812
- CimInstance = $reportingServicesData.Configuration
813
- MethodName = ' RemoveURL'
814
- Arguments = @ {
815
- Application = ' ReportServerWebService'
816
- UrlString = $_
817
- Lcid = $language
806
+ if ( ($null -ne $ReportServerReservedUrl ) -and ($null -ne (Compare-Object @compareParameters )) )
807
+ {
808
+ $restartReportingService = $true
809
+
810
+ $currentConfig.ReportServerReservedUrl | ForEach-Object - Process {
811
+ $invokeRsCimMethodParameters = @ {
812
+ CimInstance = $reportingServicesData.Configuration
813
+ MethodName = ' RemoveURL'
814
+ Arguments = @ {
815
+ Application = ' ReportServerWebService'
816
+ UrlString = $_
817
+ Lcid = $language
818
+ }
818
819
}
819
- }
820
820
821
- Invoke-RsCimMethod @invokeRsCimMethodParameters
822
- }
821
+ Invoke-RsCimMethod @invokeRsCimMethodParameters
822
+ }
823
823
824
- $ReportServerReservedUrl | ForEach-Object - Process {
825
- Write-Verbose - Message " Adding report server URL reservation on $DatabaseServerName \$DatabaseInstanceName `: $_ ."
826
- $invokeRsCimMethodParameters = @ {
827
- CimInstance = $reportingServicesData.Configuration
828
- MethodName = ' ReserveUrl'
829
- Arguments = @ {
830
- Application = ' ReportServerWebService'
831
- UrlString = $_
832
- Lcid = $language
824
+ $ReportServerReservedUrl | ForEach-Object - Process {
825
+ Write-Verbose - Message " Adding report server URL reservation on $DatabaseServerName \$DatabaseInstanceName `: $_ ."
826
+ $invokeRsCimMethodParameters = @ {
827
+ CimInstance = $reportingServicesData.Configuration
828
+ MethodName = ' ReserveUrl'
829
+ Arguments = @ {
830
+ Application = ' ReportServerWebService'
831
+ UrlString = $_
832
+ Lcid = $language
833
+ }
833
834
}
835
+
836
+ Invoke-RsCimMethod @invokeRsCimMethodParameters
834
837
}
835
838
836
- Invoke-RsCimMethod @invokeRsCimMethodParameters
839
+ # Get the current configuration
840
+ $currentConfig = Get-TargetResource @getTargetResourceParameters
841
+ Write-Verbose - Message ( $script :localizedData.ReportingServicesIsInitialized -f $DatabaseServerName , $DatabaseInstanceName , $currentConfig.IsInitialized ) - Verbose
837
842
}
838
-
839
- # Get the current configuration
840
- $currentConfig = Get-TargetResource @getTargetResourceParameters
841
- Write-Verbose - Message ( $script :localizedData.ReportingServicesIsInitialized -f $DatabaseServerName , $DatabaseInstanceName , $currentConfig.IsInitialized ) - Verbose
842
843
}
843
844
844
- $compareParameters = @ {
845
- ReferenceObject = $currentConfig.ReportsReservedUrl
846
- DifferenceObject = $ReportsReservedUrl
847
- }
848
-
849
- if ( ($null -ne $ReportsReservedUrl ) -and ($null -ne (Compare-Object @compareParameters )) )
845
+ if ( $PSBoundParameters.ContainsKey (' ReportsReservedUrl' ) )
850
846
{
851
- $restartReportingService = $true
847
+ $compareParameters = @ {
848
+ ReferenceObject = $currentConfig.ReportsReservedUrl
849
+ DifferenceObject = $ReportsReservedUrl
850
+ }
852
851
853
- $currentConfig.ReportsReservedUrl | ForEach-Object - Process {
854
- $invokeRsCimMethodParameters = @ {
855
- CimInstance = $reportingServicesData.Configuration
856
- MethodName = ' RemoveURL'
857
- Arguments = @ {
858
- Application = $reportingServicesData.ReportsApplicationName
859
- UrlString = $_
860
- Lcid = $language
852
+ if ( ($null -ne $ReportsReservedUrl ) -and ($null -ne (Compare-Object @compareParameters )) )
853
+ {
854
+ $restartReportingService = $true
855
+
856
+ $currentConfig.ReportsReservedUrl | ForEach-Object - Process {
857
+ $invokeRsCimMethodParameters = @ {
858
+ CimInstance = $reportingServicesData.Configuration
859
+ MethodName = ' RemoveURL'
860
+ Arguments = @ {
861
+ Application = $reportingServicesData.ReportsApplicationName
862
+ UrlString = $_
863
+ Lcid = $language
864
+ }
861
865
}
862
- }
863
866
864
- Invoke-RsCimMethod @invokeRsCimMethodParameters
865
- }
867
+ Invoke-RsCimMethod @invokeRsCimMethodParameters
868
+ }
866
869
867
- $ReportsReservedUrl | ForEach-Object - Process {
868
- Write-Verbose - Message (
869
- $script :localizedData.AddReportsUrlReservation -f @ (
870
- $DatabaseServerName
871
- $DatabaseInstanceName
872
- $_
870
+ $ReportsReservedUrl | ForEach-Object - Process {
871
+ Write-Verbose - Message (
872
+ $script :localizedData.AddReportsUrlReservation -f @ (
873
+ $DatabaseServerName
874
+ $DatabaseInstanceName
875
+ $_
876
+ )
873
877
)
874
- )
875
878
876
- $invokeRsCimMethodParameters = @ {
877
- CimInstance = $reportingServicesData.Configuration
878
- MethodName = ' ReserveUrl'
879
- Arguments = @ {
880
- Application = $reportingServicesData.ReportsApplicationName
881
- UrlString = $_
882
- Lcid = $language
879
+ $invokeRsCimMethodParameters = @ {
880
+ CimInstance = $reportingServicesData.Configuration
881
+ MethodName = ' ReserveUrl'
882
+ Arguments = @ {
883
+ Application = $reportingServicesData.ReportsApplicationName
884
+ UrlString = $_
885
+ Lcid = $language
886
+ }
883
887
}
888
+
889
+ Invoke-RsCimMethod @invokeRsCimMethodParameters
884
890
}
885
891
886
- Invoke-RsCimMethod @invokeRsCimMethodParameters
892
+ # Get the current configuration
893
+ $currentConfig = Get-TargetResource @getTargetResourceParameters
894
+ Write-Verbose - Message ( $script :localizedData.ReportingServicesIsInitialized -f $DatabaseServerName , $DatabaseInstanceName , $currentConfig.IsInitialized ) - Verbose
887
895
}
888
-
889
- # Get the current configuration
890
- $currentConfig = Get-TargetResource @getTargetResourceParameters
891
- Write-Verbose - Message ( $script :localizedData.ReportingServicesIsInitialized -f $DatabaseServerName , $DatabaseInstanceName , $currentConfig.IsInitialized ) - Verbose
892
896
}
893
897
# endregion Reserved URLs
894
898
@@ -1198,12 +1202,10 @@ function Set-TargetResource
1198
1202
Report Manager/Report Web App virtual directory name. Optional.
1199
1203
1200
1204
. PARAMETER ReportServerReservedUrl
1201
- Report Server URL reservations. Optional. If not specified,
1202
- 'http://+:80' URL reservation will be used.
1205
+ Report Server URL reservations. Optional.
1203
1206
1204
1207
. PARAMETER ReportsReservedUrl
1205
1208
Report Manager/Report Web App URL reservations. Optional.
1206
- If not specified, 'http://+:80' URL reservation will be used.
1207
1209
1208
1210
. PARAMETER HttpsCertificateThumbprint
1209
1211
The thumbprint of the certificate used to secure SSL communication.
@@ -1285,11 +1287,11 @@ function Test-TargetResource
1285
1287
1286
1288
[Parameter ()]
1287
1289
[System.String []]
1288
- $ReportServerReservedUrl = @ ( ' http://+:80 ' ) ,
1290
+ $ReportServerReservedUrl ,
1289
1291
1290
1292
[Parameter ()]
1291
1293
[System.String []]
1292
- $ReportsReservedUrl = @ ( ' http://+:80 ' ) ,
1294
+ $ReportsReservedUrl ,
1293
1295
1294
1296
[Parameter ()]
1295
1297
[System.String ]
@@ -1382,50 +1384,56 @@ function Test-TargetResource
1382
1384
$result = $false
1383
1385
}
1384
1386
1385
- if ( $null -eq $currentConfig.ReportServerReservedUrl )
1386
- {
1387
- Write-Verbose - Message (
1388
- $script :localizedData.ReportServerReservedUrlNotInDesiredState -f $DatabaseServerName , $DatabaseInstanceName , ' ' , ( $ReportServerReservedUrl -join ' , ' )
1389
- ) - Verbose
1390
- $result = $false
1391
- }
1392
- else
1387
+ if ( $PSBoundParameters.ContainsKey (' ReportServerReservedUrl' ) )
1393
1388
{
1394
- $compareParameters = @ {
1395
- ReferenceObject = $currentConfig.ReportServerReservedUrl
1396
- DifferenceObject = $ReportServerReservedUrl
1397
- }
1398
-
1399
- if ( $null -ne ( Compare-Object @compareParameters ) )
1389
+ if ( $null -eq $currentConfig.ReportServerReservedUrl )
1400
1390
{
1401
1391
Write-Verbose - Message (
1402
- $script :localizedData.ReportServerReservedUrlNotInDesiredState -f $DatabaseServerName , $DatabaseInstanceName , $ ( $currentConfig .ReportServerReservedUrl -join ' , ' ) , ( $ReportServerReservedUrl -join ' , ' )
1392
+ $script :localizedData.ReportServerReservedUrlNotInDesiredState -f $DatabaseServerName , $DatabaseInstanceName , ' ' , ( $ReportServerReservedUrl -join ' , ' )
1403
1393
) - Verbose
1404
1394
$result = $false
1405
1395
}
1406
- }
1396
+ else
1397
+ {
1398
+ $compareParameters = @ {
1399
+ ReferenceObject = $currentConfig.ReportServerReservedUrl
1400
+ DifferenceObject = $ReportServerReservedUrl
1401
+ }
1407
1402
1408
- if ( $null -eq $currentConfig.ReportsReservedUrl )
1409
- {
1410
- Write-Verbose - Message (
1411
- $script :localizedData.ReportsReservedUrlNotInDesiredState -f $DatabaseServerName , $DatabaseInstanceName , ' ' , ( $ReportsReservedUrl -join ' , ' )
1412
- ) - Verbose
1413
- $result = $false
1414
- }
1415
- else
1416
- {
1417
- $compareParameters = @ {
1418
- ReferenceObject = $currentConfig.ReportsReservedUrl
1419
- DifferenceObject = $ReportsReservedUrl
1403
+ if ( $null -ne ( Compare-Object @compareParameters ) )
1404
+ {
1405
+ Write-Verbose - Message (
1406
+ $script :localizedData.ReportServerReservedUrlNotInDesiredState -f $DatabaseServerName , $DatabaseInstanceName , $ ($currentConfig.ReportServerReservedUrl -join ' , ' ), ( $ReportServerReservedUrl -join ' , ' )
1407
+ ) - Verbose
1408
+ $result = $false
1409
+ }
1420
1410
}
1411
+ }
1421
1412
1422
- if ( $null -ne ( Compare-Object @compareParameters ) )
1413
+ if ( $PSBoundParameters.ContainsKey (' ReportsReservedUrl' ) )
1414
+ {
1415
+ if ( $null -eq $currentConfig.ReportsReservedUrl )
1423
1416
{
1424
1417
Write-Verbose - Message (
1425
- $script :localizedData.ReportsReservedUrlNotInDesiredState -f $DatabaseServerName , $DatabaseInstanceName , ( $currentConfig .ReportsReservedUrl -join ' , ' ) , ( $ReportsReservedUrl -join ' , ' )
1418
+ $script :localizedData.ReportsReservedUrlNotInDesiredState -f $DatabaseServerName , $DatabaseInstanceName , ' ' , ( $ReportsReservedUrl -join ' , ' )
1426
1419
) - Verbose
1427
1420
$result = $false
1428
1421
}
1422
+ else
1423
+ {
1424
+ $compareParameters = @ {
1425
+ ReferenceObject = $currentConfig.ReportsReservedUrl
1426
+ DifferenceObject = $ReportsReservedUrl
1427
+ }
1428
+
1429
+ if ( $null -ne ( Compare-Object @compareParameters ) )
1430
+ {
1431
+ Write-Verbose - Message (
1432
+ $script :localizedData.ReportsReservedUrlNotInDesiredState -f $DatabaseServerName , $DatabaseInstanceName , ( $currentConfig.ReportsReservedUrl -join ' , ' ), ( $ReportsReservedUrl -join ' , ' )
1433
+ ) - Verbose
1434
+ $result = $false
1435
+ }
1436
+ }
1429
1437
}
1430
1438
1431
1439
if ($PSBoundParameters.ContainsKey (' UseSsl' ) -and $UseSsl -ne $currentConfig.UseSsl )
0 commit comments