Public/Get-MSPBackupNetworkShare.ps1

Function Get-MSPBackupNetworkShare {
    <#
        .SYNOPSIS
            List existing Network share entries.
        .DESCRIPTION
            List existing Network share entries. Produces a table with columns in this order:
                PATH Unique path to network share
                DOMAIN Login domain
                USER Login username
                PASSWD Login password
 
            Entry name (first column) could further be used to modify or remove that specific entry.
        .INPUTS
            None
        .OUTPUTS
            None
        .EXAMPLE
            Get-MSPBackupNetworkShare
        .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)
        $NetworkShareList = & $Script:CmdPath -machine-readable control.networkshare.list -no-header -delimiter ';'
        If ($null -ne $NetworkShareList) {
            $NetworkShareList = $NetworkShareList.Split(";")
            [array]$Hash += $(New-CustomPSObject "Path", "Domain", "User", "Password" "$($NetworkShareList[0])", "$($NetworkShareList[1])", "$($NetworkShareList[2])", "$($NetworkShareList[3])")
        } Else {
            $Hash = $null
        }
    }
    End {
        Write-Verbose ('{0}:: Function ended' -f $MyInvocation.MyCommand)
        Return $Hash
    }
}