Public/Add-MSPBackupMySQLEntry.ps1

Function Add-MSPBackupMySQLEntry {
    <#
        .SYNOPSIS
            Create new MySQL server entry.
        .DESCRIPTION
            Create new MySQL server entry.
        .PARAMETER Name
            Name of the MySQL server entry, non-empty.
        .PARAMETER Password
            Password to use to connect to server.
        .PARAMETER ServerPort
            MySQL server port. (default 3306)
        .PARAMETER User
            Username to use to connect to server. (default is "root")
        .INPUTS
            None
        .OUTPUTS
            None
        .EXAMPLE
            Add-MSPBackupMySQLEntry -Name "Example entry" -User "Root" -Password "SecurePassword" -ServerPort 1234
        .LINK
            about_functions_advanced
        .LINK
            about_CommonParameters
    #>

    [CmdletBinding(
        SupportsShouldProcess = $true
    )]
    [OutputType('System.String')]
    Param(
        [Parameter(Mandatory = $true)]
        [String]$Name,
        [Parameter(Mandatory = $true)]
        [securestring]$Password,
        [Int]$ServerPort = 3306,
        [String]$User = "root"
    )
    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.mysqldb.add
    }
    End {
        Write-Verbose ('{0}:: Function ended' -f $MyInvocation.MyCommand)
        Return $Status
    }
}