File tree Expand file tree Collapse file tree 2 files changed +14
-13
lines changed
Modules/CippExtensions/Public Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,16 @@ function Set-HaloMapping {
99 Remove-AzDataTableEntity - Force @CIPPMapping - Entity $_
1010 }
1111 foreach ($Mapping in $Request.Body ) {
12- $AddObject = @ {
13- PartitionKey = ' HaloMapping'
14- RowKey = " $ ( $mapping.TenantId ) "
15- IntegrationId = " $ ( $mapping.IntegrationId ) "
16- IntegrationName = " $ ( $mapping.IntegrationName ) "
12+ if ($Mapping.TenantId ) {
13+ $AddObject = @ {
14+ PartitionKey = ' HaloMapping'
15+ RowKey = " $ ( $mapping.TenantId ) "
16+ IntegrationId = " $ ( $mapping.IntegrationId ) "
17+ IntegrationName = " $ ( $mapping.IntegrationName ) "
18+ }
1719 }
1820
1921 Add-CIPPAzDataTableEntity @CIPPMapping - Entity $AddObject - Force
20-
2122 Write-LogMessage - API $APINAME - headers $Request.Headers - message " Added mapping for $ ( $mapping.name ) ." - Sev ' Info'
2223 }
2324 $Result = [pscustomobject ]@ {' Results' = ' Successfully edited mapping table.' }
Original file line number Diff line number Diff line change @@ -10,15 +10,15 @@ function Set-NinjaOneOrgMapping {
1010 Remove-AzDataTableEntity - Force @CIPPMapping - Entity $_
1111 }
1212 foreach ($Mapping in $Request.Body ) {
13- $AddObject = @ {
14- PartitionKey = ' NinjaOneMapping'
15- RowKey = " $ ( $mapping.TenantId ) "
16- IntegrationId = " $ ( $mapping.IntegrationId ) "
17- IntegrationName = " $ ( $mapping.IntegrationName ) "
13+ if ($Mapping.TenantId ) {
14+ $AddObject = @ {
15+ PartitionKey = ' NinjaOneMapping'
16+ RowKey = " $ ( $mapping.TenantId ) "
17+ IntegrationId = " $ ( $mapping.IntegrationId ) "
18+ IntegrationName = " $ ( $mapping.IntegrationName ) "
19+ }
1820 }
19-
2021 Add-CIPPAzDataTableEntity @CIPPMapping - Entity $AddObject - Force
21-
2222 Write-LogMessage - API $APINAME - headers $Request.Headers - message " Added mapping for $ ( $mapping.name ) ." - Sev ' Info'
2323 }
2424 $Result = [pscustomobject ]@ {' Results' = ' Successfully edited mapping table.' }
You can’t perform that action at this time.
0 commit comments