Public/Clear-MSPBackupSelection.ps1

Function Clear-MSPBackupSelection {
    <#
        .SYNOPSIS
            Clear backup selections. Currently selected files data on disk not affected in any way. If no datasource is
            specified, selections for all datasources are cleared.
        .DESCRIPTION
            Clear backup selections. Currently selected files data on disk not affected in any way. If no datasource is
            specified, selections for all datasources are cleared.
        .PARAMETER Datasource
            Datasource to clear selection for. Possible values are Exchange, FileSystem, MySql, NetworkShares, Oracle,
            SystemState, VMware, VssHyperV, VssMsSql or VssSharePoint.
        .INPUTS
            None
        .OUTPUTS
            None
        .EXAMPLE
            Clear-MSPBackupSelection
        .LINK
            about_functions_advanced
        .LINK
            about_CommonParameters
    #>

    [CmdletBinding(SupportsShouldProcess = $true)]
    [OutputType('System.String')]
    Param(
        [ValidateSet('Exchange', 'FileSystem', 'MySql', 'NetworkShares', 'Oracle', 'SystemState', 'VMware', 'VssHyperV', 'VssMsSql', 'VssSharePoint')]
        [String]$Datasource
    )
    Begin {
        Write-Verbose ('{0}:: Function started' -f $MyInvocation.MyCommand)
        $stdOutTempFile = [System.IO.Path]::GetTempFileName()
        $stdErrTempFile = [System.IO.Path]::GetTempFileName()
    }
    Process {
        Write-Verbose ('{0}:: Getting status' -f $MyInvocation.MyCommand)
        $Status = & $Script:CmdPath -machine-readable control.selection.clear
    }
    End {
        Write-Verbose ('{0}:: Function ended' -f $MyInvocation.MyCommand)
        Return $Status
    }
}