Public/Add-MSPBackupNetworkShare.ps1

Function Add-MSPBackupNetworkShare {
    <#
        .SYNOPSIS
            Create new network share entry.
        .DESCRIPTION
            Create new network share entry.
        .PARAMETER Domain
            Domain to use to connect to network share.
        .PARAMETER Path
            Path to network share, non-empty.
        .PARAMETER User
            Username to use to connect to network share.
        .PARAMETER Password
            Password to use to connect to network share.
        .INPUTS
            None
        .OUTPUTS
            None
        .EXAMPLE
            Add-MSPBackupNetworkShare
        .LINK
            about_functions_advanced
        .LINK
            about_CommonParameters
    #>

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