Functions/Connection/New-CdsContext.ps1
<#
.SYNOPSIS Initialize new object that represent a Xrm Context. #> function New-CdsContext { [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["UserName"] = [Guid]::Empty; $hash["UserPassword"] = [String]::Empty; $hash["AuthType"] = [String]::Empty; $hash["Region"] = [String]::Empty; $hash["Url"] = [String]::Empty; $hash["Credentials"] = [System.Management.Automation.PSCredential]::Empty; $hash["ConnectionStringParameters"] = [String]::Empty; $hash["IsAdmin"] = $false; $hash["AdminApiUrl"] = [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-CdsContext -Alias *; |