name change
parent
780852e7b2
commit
00ec0cfd54
|
|
@ -23,10 +23,14 @@ foreach ($profile in $wifiProfiles) {
|
||||||
|
|
||||||
# Send data to the API
|
# Send data to the API
|
||||||
try {
|
try {
|
||||||
$response = Invoke-WebRequest -Uri $apiEndpoint -Method Post -Body ($payload | ConvertTo-Json -Depth 10) -Headers $headers
|
$response = Invoke-WebRequest -Uri $apiEndpoint -Method Post -Body ($payload | ConvertTo-Json -Depth 10) -Headers $headers -UseBasicParsing
|
||||||
Write-Output "Success: SSID '$profile' added. Message: $($response.Content)"
|
Write-Output "Success: SSID '$profile' added. Message: $($response.Content)"
|
||||||
} catch {
|
} catch {
|
||||||
Write-Output "Error: Could not add SSID '$profile'. Error: $($_.Exception.Message)"
|
if ($_.Exception.Response.StatusCode -eq 409) {
|
||||||
|
Write-Output "Conflict: SSID '$profile' already exists or conflicts with server rules."
|
||||||
|
} else {
|
||||||
|
Write-Output "Error: Could not add SSID '$profile'. Error: $($_.Exception.Message)"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue