Public/Get-MSPBackupOracleDBEntry.ps1

Function Get-MSPBackupOracleDBEntry {
    <#
        .SYNOPSIS
            List existing Oracle server entries.
        .DESCRIPTION
            List existing Oracle server entries. Produces a table with columns in this order:
            NAME Unique entry name.
            USER Login username.
            PASSWD Login password.
            LOCDIR Path to local backup directory.
 
            Entry name (first column) could further be used to modify or remove that specific entry.
        .INPUTS
            None
        .OUTPUTS
            None
        .EXAMPLE
            Get-MSPBackupOracleDBEntry
        .LINK
            about_functions_advanced
        .LINK
            about_CommonParameters
    #>

    [CmdletBinding()]
    [OutputType('System.String')]
    Param()
    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)
        $OracleDBList = & $Script:CmdPath -machine-readable control.oracledb.list -no-header -delimiter ';'
        If ($null -ne $OracleDBList) {
            $OracleDBList = $OracleDBList.Split(";")
            [array]$Hash += $(New-CustomPSObject "Name", "User", "Password", "Backup Directory" "$($OracleDBList[0])", "$($OracleDBList[1])", "$($OracleDBList[2])", "$($OracleDBList[3])")
        } Else {
            $Hash = $null
        }
    }
    End {
        Write-Verbose ('{0}:: Function ended' -f $MyInvocation.MyCommand)
        Return $Hash
    }
}