File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
Modules/CippExtensions/Public/Sherweb Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,8 @@ function Get-SherwebMapping {
7
7
$ExtensionMappings = Get-ExtensionMapping - Extension ' Sherweb'
8
8
9
9
$Tenants = Get-Tenants - IncludeErrors
10
-
11
10
$Mappings = foreach ($Mapping in $ExtensionMappings ) {
12
- $Tenant = $Tenants | Where-Object { $_.defaultDomainName -eq $Mapping.RowKey }
11
+ $Tenant = $Tenants | Where-Object { $_.customerId -eq $Mapping.RowKey }
13
12
if ($Tenant ) {
14
13
[PSCustomObject ]@ {
15
14
TenantId = $Tenant.customerId
@@ -20,10 +19,13 @@ function Get-SherwebMapping {
20
19
}
21
20
}
22
21
}
23
- $Tenants = Get-Tenants - IncludeErrors
24
22
try {
25
- $SherwebCustomers = Get-SherwebCustomers
26
-
23
+ $SherwebCustomers = Get-SherwebCustomers | ForEach-Object {
24
+ [PSCustomObject ]@ {
25
+ name = $_.displayName
26
+ value = " $ ( $_.id ) "
27
+ }
28
+ }
27
29
} catch {
28
30
$Message = if ($_.ErrorDetails.Message ) {
29
31
Get-NormalizedError - Message $_.ErrorDetails.Message
@@ -34,12 +36,7 @@ function Get-SherwebMapping {
34
36
Write-LogMessage - Message " Could not get Sherweb Companies, error: $Message " - Level Error - tenant ' CIPP' - API ' SherwebMapping'
35
37
$SherwebCustomers = @ (@ {name = " Could not get Sherweb Companies, error: $Message " ; value = ' -1' })
36
38
}
37
- $SherwebCustomers = $SherwebCustomers | ForEach-Object {
38
- [PSCustomObject ]@ {
39
- name = $_.displayName
40
- value = " $ ( $_.id ) "
41
- }
42
- }
39
+
43
40
$MappingObj = [PSCustomObject ]@ {
44
41
Companies = @ ($SherwebCustomers )
45
42
Mappings = @ ($Mappings )
You can’t perform that action at this time.
0 commit comments