functions/Set-CourseProperty.ps1

function Set-CourseProperty
{
    <#
    .SYNOPSIS
    Given a course determined by ID update the provided properties. This method is a work in progress, be sure to use the -whatif param liberally. So far it only supports updating those items that are explicitally put in params.
    .DESCRIPTION
    Given a course determined by ID update the provided properties. This method is a work in progress, be sure to use the -whatif param liberally. So far it only supports updating those items that are explicitally put in params.
    .EXAMPLE
    Set-CourseProperty -CourseID '' -whatif
    #>

    [CmdletBinding(SupportsShouldProcess)]
    [Alias()]
    Param
    (
        [string]$courseId,
        [string]$termId
    )

    Begin
    {

    }
    Process
    {
        $Body = @{
            termId = $termId
        }
        if($(!$courseId -eq "") -and $(!$termId -eq "")){

            Invoke-BBRestMethod -API "/learn/api/public/v3/courses/$courseId" `
                -Method Patch `
                -ContentType application/json `
                -Body $Body
        }

    }
    End
    {
    }
}