Public/Get-MSPBackupStatus.ps1

Function Get-MSPBackupStatus {
    <#
    .SYNOPSIS
        Print current program status.
    .DESCRIPTION
        Print current program status.
    .PARAMETER Path
        Full path to config.ini file.
    .EXAMPLE
        Get-MSPBackupStatus
 
        Get the current status of the MSP Backup
    .INPUTS
        None
    #>

    [CmdletBinding()]
    [OutputType('System.String')]
    Param(
        [string]$Path
    )
    Begin {
        Write-Verbose ('{0}:: Function started' -f $MyInvocation.MyCommand)
        Write-Verbose ('{0}:: Setting location for clienttool.exe' -f $MyInvocation.MyCommand)
        $BMPath = [Environment]::GetFolderPath('ProgramFiles') + "\Backup Manager"
        $CmdPath = $BMPath + "\ClientTool.exe"
    }
    Process {
        Write-Verbose ('{0}:: Getting status' -f $MyInvocation.MyCommand)
        $Status = & $CmdPath -machine-readable control.status.get
    }
    End {
        Write-Verbose ('{0}:: Function ended' -f $MyInvocation.MyCommand)
        Return $Status
    }
}