forked from Cephalowat/PSFalcon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Set-CsControlPrecedence.psm1
45 lines (42 loc) · 1.37 KB
/
Set-CsControlPrecedence.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
43
44
45
function Set-CsControlPrecedence {
<#
.SYNOPSIS
Sets the precedence of Device Control policies based on the order of IDs specified in the request. The
first ID specified will have the highest precedence and the last ID specified will have the lowest.
You must specify all non-Default Policies for a platform when updating precedence.
.PARAMETER PLATFORM
The operating system platform the Device Control policies are assigned to
.PARAMETER ID
An array of one or more Device Control policy IDs
#>
[CmdletBinding()]
[OutputType([psobject])]
param(
[Parameter(Mandatory = $true)]
[ValidateSet('Android', 'iOS', 'Linux', 'Mac', 'Windows')]
[string]
$Platform,
[Parameter(Mandatory = $true)]
[array]
$Id
)
process{
$Param = @{
Uri = '/policy/entities/device-control-precedence/v1'
Method = 'post'
Header = @{
accept = 'application/json'
'content-type' = 'application/json'
}
Body = @{
ids = $Id
platform_name = $Platform
} | ConvertTo-Json
}
switch ($PSBoundParameters.Keys) {
'Verbose' { $Param['Verbose'] = $true }
'Debug' { $Param['Debug'] = $true }
}
Invoke-CsAPI @Param
}
}