Public/Edit-bConnectJob.ps1

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
Function Edit-bConnectJob() {
    <#
        .Synopsis
            Updates a existing job.
        .Parameter Job
            Job object (hashtable).
        .Outputs
            Job (see bConnect documentation for more details).
    #>



    Param (
        [Parameter(Mandatory=$true)][PSCustomObject]$Job,
        [boolean]$IgnoreAssignments = $false

    )

    $_connectVersion = Get-bConnectVersion
    If($_connectVersion -ge "1.0") {
        If(Test-Guid $Job.Id) {
            $_Job = ConvertTo-Hashtable $Job
            return Invoke-bConnectPatch -Controller "Jobs" -Version $_connectVersion -objectGuid $_Job.Id -Data $_Job -IgnoreAssignments $IgnoreAssignments
        } else {
            return $false
        }
    } else {
        return $false
    }
}