@@ -254,10 +254,12 @@ function Get-TargetResource
254
254
Report Manager/Report Web App virtual directory name. Optional.
255
255
256
256
. PARAMETER ReportServerReservedUrl
257
- Report Server URL reservations. Optional.
257
+ Report Server URL reservations. Optional. If not specified,
258
+ 'http://+:80' URL reservation will be used.
258
259
259
260
. PARAMETER ReportsReservedUrl
260
- Report Manager/Report Web App URL reservations.
261
+ Report Manager/Report Web App URL reservations. Optional.
262
+ If not specified, 'http://+:80' URL reservation will be used.
261
263
262
264
. PARAMETER HttpsCertificateThumbprint
263
265
The thumbprint of the certificate used to secure SSL communication.
@@ -384,11 +386,11 @@ function Set-TargetResource
384
386
385
387
[Parameter ()]
386
388
[System.String []]
387
- $ReportServerReservedUrl ,
389
+ $ReportServerReservedUrl = @ ( ' http://+:80 ' ) ,
388
390
389
391
[Parameter ()]
390
392
[System.String []]
391
- $ReportsReservedUrl ,
393
+ $ReportsReservedUrl = @ ( ' http://+:80 ' ) ,
392
394
393
395
[Parameter ()]
394
396
[System.String ]
@@ -848,103 +850,97 @@ function Set-TargetResource
848
850
# endregion Virtual Directories
849
851
850
852
# region Reserved URLs
851
- if ( $PSBoundParameters.ContainsKey (' EncryptionKeyBackupPath' ) )
852
- {
853
- $compareParameters = @ {
854
- ReferenceObject = $currentConfig.ReportServerReservedUrl
855
- DifferenceObject = $ReportServerReservedUrl
856
- }
853
+ $compareParameters = @ {
854
+ ReferenceObject = $currentConfig.ReportServerReservedUrl
855
+ DifferenceObject = $ReportServerReservedUrl
856
+ }
857
857
858
- if ( ($null -ne $ReportServerReservedUrl ) -and ($null -ne (Compare-Object @compareParameters )) )
859
- {
860
- $restartReportingService = $true
858
+ if ( ($null -ne $ReportServerReservedUrl ) -and ($null -ne (Compare-Object @compareParameters )) )
859
+ {
860
+ $restartReportingService = $true
861
861
862
- $currentConfig.ReportServerReservedUrl | ForEach-Object - Process {
863
- $invokeRsCimMethodParameters = @ {
864
- CimInstance = $reportingServicesData.Configuration
865
- MethodName = ' RemoveURL'
866
- Arguments = @ {
867
- Application = ' ReportServerWebService'
868
- UrlString = $_
869
- Lcid = $language
870
- }
862
+ $currentConfig.ReportServerReservedUrl | ForEach-Object - Process {
863
+ $invokeRsCimMethodParameters = @ {
864
+ CimInstance = $reportingServicesData.Configuration
865
+ MethodName = ' RemoveURL'
866
+ Arguments = @ {
867
+ Application = ' ReportServerWebService'
868
+ UrlString = $_
869
+ Lcid = $language
871
870
}
872
-
873
- Invoke-RsCimMethod @invokeRsCimMethodParameters
874
871
}
875
872
876
- $ReportServerReservedUrl | ForEach-Object - Process {
877
- Write-Verbose - Message " Adding report server URL reservation on $DatabaseServerName \$DatabaseInstanceName `: $_ ."
878
- $invokeRsCimMethodParameters = @ {
879
- CimInstance = $reportingServicesData.Configuration
880
- MethodName = ' ReserveUrl'
881
- Arguments = @ {
882
- Application = ' ReportServerWebService'
883
- UrlString = $_
884
- Lcid = $language
885
- }
886
- }
873
+ Invoke-RsCimMethod @invokeRsCimMethodParameters
874
+ }
887
875
888
- Invoke-RsCimMethod @invokeRsCimMethodParameters
876
+ $ReportServerReservedUrl | ForEach-Object - Process {
877
+ Write-Verbose - Message " Adding report server URL reservation on $DatabaseServerName \$DatabaseInstanceName `: $_ ."
878
+ $invokeRsCimMethodParameters = @ {
879
+ CimInstance = $reportingServicesData.Configuration
880
+ MethodName = ' ReserveUrl'
881
+ Arguments = @ {
882
+ Application = ' ReportServerWebService'
883
+ UrlString = $_
884
+ Lcid = $language
885
+ }
889
886
}
890
887
891
- # Get the current configuration
892
- $currentConfig = Get-TargetResource @getTargetResourceParameters
893
- Write-Verbose - Message ( $script :localizedData.ReportingServicesIsInitialized -f $DatabaseServerName , $DatabaseInstanceName , $currentConfig.IsInitialized ) - Verbose
888
+ Invoke-RsCimMethod @invokeRsCimMethodParameters
894
889
}
890
+
891
+ # Get the current configuration
892
+ $currentConfig = Get-TargetResource @getTargetResourceParameters
893
+ Write-Verbose - Message ( $script :localizedData.ReportingServicesIsInitialized -f $DatabaseServerName , $DatabaseInstanceName , $currentConfig.IsInitialized ) - Verbose
895
894
}
896
895
897
- if ( $PSBoundParameters.ContainsKey (' ReportsReservedUrl' ) )
898
- {
899
- $compareParameters = @ {
900
- ReferenceObject = $currentConfig.ReportsReservedUrl
901
- DifferenceObject = $ReportsReservedUrl
902
- }
896
+ $compareParameters = @ {
897
+ ReferenceObject = $currentConfig.ReportsReservedUrl
898
+ DifferenceObject = $ReportsReservedUrl
899
+ }
903
900
904
- if ( ($null -ne $ReportsReservedUrl ) -and ($null -ne (Compare-Object @compareParameters )) )
905
- {
906
- $restartReportingService = $true
901
+ if ( ($null -ne $ReportsReservedUrl ) -and ($null -ne (Compare-Object @compareParameters )) )
902
+ {
903
+ $restartReportingService = $true
907
904
908
- $currentConfig.ReportsReservedUrl | ForEach-Object - Process {
909
- $invokeRsCimMethodParameters = @ {
910
- CimInstance = $reportingServicesData.Configuration
911
- MethodName = ' RemoveURL'
912
- Arguments = @ {
913
- Application = $reportingServicesData.ReportsApplicationName
914
- UrlString = $_
915
- Lcid = $language
916
- }
905
+ $currentConfig.ReportsReservedUrl | ForEach-Object - Process {
906
+ $invokeRsCimMethodParameters = @ {
907
+ CimInstance = $reportingServicesData.Configuration
908
+ MethodName = ' RemoveURL'
909
+ Arguments = @ {
910
+ Application = $reportingServicesData.ReportsApplicationName
911
+ UrlString = $_
912
+ Lcid = $language
917
913
}
918
-
919
- Invoke-RsCimMethod @invokeRsCimMethodParameters
920
914
}
921
915
922
- $ReportsReservedUrl | ForEach-Object - Process {
923
- Write-Verbose - Message (
924
- $script :localizedData.AddReportsUrlReservation -f @ (
925
- $DatabaseServerName
926
- $DatabaseInstanceName
927
- $_
928
- )
916
+ Invoke-RsCimMethod @invokeRsCimMethodParameters
917
+ }
918
+
919
+ $ReportsReservedUrl | ForEach-Object - Process {
920
+ Write-Verbose - Message (
921
+ $script :localizedData.AddReportsUrlReservation -f @ (
922
+ $DatabaseServerName
923
+ $DatabaseInstanceName
924
+ $_
929
925
)
926
+ )
930
927
931
- $invokeRsCimMethodParameters = @ {
932
- CimInstance = $reportingServicesData.Configuration
933
- MethodName = ' ReserveUrl'
934
- Arguments = @ {
935
- Application = $reportingServicesData.ReportsApplicationName
936
- UrlString = $_
937
- Lcid = $language
938
- }
928
+ $invokeRsCimMethodParameters = @ {
929
+ CimInstance = $reportingServicesData.Configuration
930
+ MethodName = ' ReserveUrl'
931
+ Arguments = @ {
932
+ Application = $reportingServicesData.ReportsApplicationName
933
+ UrlString = $_
934
+ Lcid = $language
939
935
}
940
-
941
- Invoke-RsCimMethod @invokeRsCimMethodParameters
942
936
}
943
937
944
- # Get the current configuration
945
- $currentConfig = Get-TargetResource @getTargetResourceParameters
946
- Write-Verbose - Message ( $script :localizedData.ReportingServicesIsInitialized -f $DatabaseServerName , $DatabaseInstanceName , $currentConfig.IsInitialized ) - Verbose
938
+ Invoke-RsCimMethod @invokeRsCimMethodParameters
947
939
}
940
+
941
+ # Get the current configuration
942
+ $currentConfig = Get-TargetResource @getTargetResourceParameters
943
+ Write-Verbose - Message ( $script :localizedData.ReportingServicesIsInitialized -f $DatabaseServerName , $DatabaseInstanceName , $currentConfig.IsInitialized ) - Verbose
948
944
}
949
945
# endregion Reserved URLs
950
946
@@ -1254,10 +1250,12 @@ function Set-TargetResource
1254
1250
Report Manager/Report Web App virtual directory name. Optional.
1255
1251
1256
1252
. PARAMETER ReportServerReservedUrl
1257
- Report Server URL reservations. Optional.
1253
+ Report Server URL reservations. Optional. If not specified,
1254
+ 'http://+:80' URL reservation will be used.
1258
1255
1259
1256
. PARAMETER ReportsReservedUrl
1260
1257
Report Manager/Report Web App URL reservations. Optional.
1258
+ If not specified, 'http://+:80' URL reservation will be used.
1261
1259
1262
1260
. PARAMETER HttpsCertificateThumbprint
1263
1261
The thumbprint of the certificate used to secure SSL communication.
@@ -1348,11 +1346,11 @@ function Test-TargetResource
1348
1346
1349
1347
[Parameter ()]
1350
1348
[System.String []]
1351
- $ReportServerReservedUrl ,
1349
+ $ReportServerReservedUrl = @ ( ' http://+:80 ' ) ,
1352
1350
1353
1351
[Parameter ()]
1354
1352
[System.String []]
1355
- $ReportsReservedUrl ,
1353
+ $ReportsReservedUrl = @ ( ' http://+:80 ' ) ,
1356
1354
1357
1355
[Parameter ()]
1358
1356
[System.String ]
@@ -1528,30 +1526,27 @@ function Test-TargetResource
1528
1526
}
1529
1527
}
1530
1528
1531
- if ( $PSBoundParameters.ContainsKey (' ReportsReservedUrl' ) )
1529
+ if ( $null -eq $currentConfig.ReportsReservedUrl )
1530
+ {
1531
+ Write-Verbose - Message (
1532
+ $script :localizedData.ReportsReservedUrlNotInDesiredState -f $DatabaseServerName , $DatabaseInstanceName , ' ' , ( $ReportsReservedUrl -join ' , ' )
1533
+ ) - Verbose
1534
+ $result = $false
1535
+ }
1536
+ else
1532
1537
{
1533
- if ( $null -eq $currentConfig.ReportsReservedUrl )
1538
+ $compareParameters = @ {
1539
+ ReferenceObject = $currentConfig.ReportsReservedUrl
1540
+ DifferenceObject = $ReportsReservedUrl
1541
+ }
1542
+
1543
+ if ( $null -ne ( Compare-Object @compareParameters ) )
1534
1544
{
1535
1545
Write-Verbose - Message (
1536
- $script :localizedData.ReportsReservedUrlNotInDesiredState -f $DatabaseServerName , $DatabaseInstanceName , ' ' , ( $ReportsReservedUrl -join ' , ' )
1546
+ $script :localizedData.ReportsReservedUrlNotInDesiredState -f $DatabaseServerName , $DatabaseInstanceName , ( $currentConfig .ReportsReservedUrl -join ' , ' ) , ( $ReportsReservedUrl -join ' , ' )
1537
1547
) - Verbose
1538
1548
$result = $false
1539
1549
}
1540
- else
1541
- {
1542
- $compareParameters = @ {
1543
- ReferenceObject = $currentConfig.ReportsReservedUrl
1544
- DifferenceObject = $ReportsReservedUrl
1545
- }
1546
-
1547
- if ( $null -ne ( Compare-Object @compareParameters ) )
1548
- {
1549
- Write-Verbose - Message (
1550
- $script :localizedData.ReportsReservedUrlNotInDesiredState -f $DatabaseServerName , $DatabaseInstanceName , ( $currentConfig.ReportsReservedUrl -join ' , ' ), ( $ReportsReservedUrl -join ' , ' )
1551
- ) - Verbose
1552
- $result = $false
1553
- }
1554
- }
1555
1550
}
1556
1551
1557
1552
if ($PSBoundParameters.ContainsKey (' UseSsl' ) -and $UseSsl -ne $currentConfig.UseSsl )
0 commit comments