Skip to content

Commit 3e6d1ba

Browse files
allow array
1 parent 3748387 commit 3e6d1ba

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Settings/Invoke-ExecAddTrustedIP.ps1

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using namespace System.Net
22

3-
Function Invoke-ExecAddTrustedIP {
3+
function Invoke-ExecAddTrustedIP {
44
<#
55
.FUNCTIONALITY
66
Entrypoint
@@ -11,12 +11,13 @@ Function Invoke-ExecAddTrustedIP {
1111
param($Request, $TriggerMetadata)
1212

1313
$Table = Get-CippTable -tablename 'trustedIps'
14-
Add-CIPPAzDataTableEntity @Table -Entity @{
15-
PartitionKey = $Request.Body.tenantfilter
16-
RowKey = $Request.Body.IP
17-
state = $Request.Body.State
18-
} -Force
19-
14+
foreach ($IP in $Request.body.IP) {
15+
Add-CIPPAzDataTableEntity @Table -Entity @{
16+
PartitionKey = $Request.Body.tenantfilter
17+
RowKey = $IP
18+
state = $Request.Body.State
19+
} -Force
20+
}
2021
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
2122
StatusCode = [HttpStatusCode]::OK
2223
Body = @{ results = "Added $($Request.Body.IP) to database with state $($Request.Body.State) for $($Request.Body.tenantfilter)" }

0 commit comments

Comments
 (0)