Functions/Monitoring/Resume-PASPSMSession.ps1

# .ExternalHelp psPAS-help.xml
function Resume-PASPSMSession {
    [CmdletBinding(SupportsShouldProcess)]
    param(
        [parameter(
            Mandatory = $true,
            ValueFromPipelinebyPropertyName = $true
        )]
        [ValidateNotNullOrEmpty()]
        [Alias('SessionGuid')]
        [string]$LiveSessionId
    )

    BEGIN {
        Assert-VersionRequirement -RequiredVersion 10.2
    }#begin

    PROCESS {

        #Create URL for Request
        $URI = "$($psPASSession.BaseURI)/api/LiveSessions/$($LiveSessionId | Get-EscapedString)/Resume"

        if ($PSCmdlet.ShouldProcess($LiveSessionId, 'Resume PSM Session')) {

            #send request to PAS web service
            Invoke-PASRestMethod -Uri $URI -Method POST

        }

    } #process

    END { }#end

}