Public/ps1/Job/Stop-ApprxrJobs.ps1

<#
    .SYNOPSIS
    Stops all running Apprxr jobs.
 
    .DESCRIPTION
    This function finds all running jobs whose names contain 'Apprxr' and stops and removes them. Used for cleanup and job management.
 
    .EXAMPLE
    Stop-ApprxrJobs
 
    .NOTES
    Useful for halting all Apprxr-related background processes.
#>

function Stop-ApprxrJobs{

    # Get all running jobs
    $runningProcesses = get-job
    # Stop and remove jobs whose names contain 'Apprxr'
    $runningProcesses | %{
        if ($_.Name.Contains("Apprxr")) {
            Log ("Stopping job :" + $_.Name)
            Stop-Job $_.Name
            Remove-Job $_.Name
        }
    }
}