Skip to content

Commit ea67b4c

Browse files
Merge pull request KelvinTegelaar#1188 from Ren-Roros-Digital/deviceaction
fix: fix device wipe action
2 parents e34fd45 + 1c94421 commit ea67b4c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Endpoint/MEM/Invoke-ExecDeviceAction.ps1

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,19 @@ Function Invoke-ExecDeviceAction {
2020
if ($Request.Query.Action -eq 'setDeviceName') {
2121
$ActionBody = @{ deviceName = $Request.Body.input } | ConvertTo-Json -Compress
2222
}
23-
$ActionResult = New-CIPPDeviceAction -Action $Request.Query.Action -ActionBody $ActionBody -DeviceFilter $Request.Query.GUID -TenantFilter $Request.Query.TenantFilter -ExecutingUser $request.headers.'x-ms-client-principal' -APINAME $APINAME
23+
else {
24+
$ActionBody = $Request.Body | ConvertTo-Json -Compress
25+
}
26+
27+
$cmdparams = @{
28+
Action = $Request.Query.Action
29+
ActionBody = $ActionBody
30+
DeviceFilter = $Request.Query.GUID
31+
TenantFilter = $Request.Query.TenantFilter
32+
ExecutingUser = $request.headers.'x-ms-client-principal'
33+
APINAME = $APINAME
34+
}
35+
$ActionResult = New-CIPPDeviceAction @cmdparams
2436
$body = [pscustomobject]@{'Results' = "$ActionResult" }
2537

2638
} catch {

0 commit comments

Comments
 (0)