forked from Cephalowat/PSFalcon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Edit-CsIncident.psm1
42 lines (39 loc) · 1019 Bytes
/
Edit-CsIncident.psm1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
function Edit-CsIncident {
<#
.SYNOPSIS
Perform a set of actions on one or more incidents
.PARAMETER ID
Target Incident Ids
.PARAMETER ACTIONS
An array containing 'action' hashtables
#>
[CmdletBinding()]
[OutputType([psobject])]
param(
[Parameter(Mandatory = $true)]
[array]
$Id,
[Parameter(Mandatory = $true)]
[array]
$Actions
)
process{
$Param = @{
Uri = '/incidents/entities/incident-actions/v1'
Method = 'post'
Header = @{
accept = 'application/json'
'content-type' = 'application/json'
}
Body = @{
action_parameters = $Actions
ids = $Id
} | ConvertTo-Json -Depth 8
}
switch ($PSBoundParameters.Keys) {
'Verbose' { $Param['Verbose'] = $true }
'Debug' { $Param['Debug'] = $true }
}
Invoke-CsAPI @Param
}
}