Functions/Types/New-CdsConnection.ps1

<#
    .SYNOPSIS
    Initialize new object that represent a CDS Connection.
#>

function New-CdsConnection {
    [CmdletBinding()]
    [OutputType([PsObject])]
    param
    (
    )
    begin {  
        $StopWatch = [System.Diagnostics.Stopwatch]::StartNew(); 
        Trace-CdsFunction -Name $MyInvocation.MyCommand.Name -Stage Start -Parameters ($MyInvocation.MyCommand.Parameters); 
    }    
    process {

        $hash = @{ };
        $hash["Name"] = [String]::Empty;
        $hash["UserName"] = [Guid]::Empty;
        $hash["UserPassword"] = [String]::Empty;
        $hash["AuthType"] = [String]::Empty;
        $hash["Region"] = [String]::Empty;
        $hash["ConnectionStringParameters"] = [String]::Empty;
        $hash["Instances"] = $null;
        $hash["DevOpsSettings"] = New-CdsDevOpsSettings;
        $hash["FilePath"] = [String]::Empty;
        
        $object = New-Object PsObject -Property $hash;
        $object;
    }
    end {
        $StopWatch.Stop();
        Trace-CdsFunction -Name $MyInvocation.MyCommand.Name -Stage Stop -StopWatch $StopWatch;
    }
}

Export-ModuleMember -Function New-CdsConnection -Alias *;