
            {
                throw $Strings.InvalidParameters
            }
            else
            {
                if (IsLocalComputer $RemoteComputerName)
                {
                   throw ([string]::Format($Strings.NotARemoteComputer, $RemoteComputerName))
                }
                
                $errorvariabe = $null         
                $cimSession = New-CimSession -ComputerName $RemoteComputerName
                if ($cimSession -eq $null)
                {
                    throw ([string]::Format($Strings.FailedToCreateCimSession, $ComputerName))
                }
                try
                {
                    $remoteTest = TestRemoteComputer $RemoteComputerName $cimSession
                }
                finally
                {
                    Remove-CimSession -CimSession $cimSession
                }
            }        
        }
        else
        {
            if ([string]::IsNullOrEmpty($RemoteComputerName))
            {
                if (IsLocalComputer $LocalComputerName)
                {
                   $localTest = TestLocalComputer $LocalComputerName
                }
                else
                {
                   throw ([string]::Format($Strings.InvalidLocalComputer, $LocalComputerName))
                }
            }
            else
            {
                if ((IsLocalComputer $LocalComputerName) -eq $false)
                {
                   throw ([string]::Format($Strings.InvalidLocalComputer, $LocalComputerName))
                }
                    
                $DefaultResourceManagerPort = 3002
                $remoteComputerTestable = $false
                $localToRemotePinging = $false
                $remoteToLocalPinging = $false
                $localComputerTestable = $false
                $port = $DefaultResourceManagerPort

                $localComputerTestable = TestLocalComputer $LocalComputerName

                if (IsLocalComputer $RemoteComputerName)
                {
                   throw ([string]::Format($Strings.NotARemoteComputer, $RemoteComputerName))
                }                
                
                $errorvariabe = $null         
                $cimSession = New-CimSession -ComputerName $RemoteComputerName
                if ($cimSession -eq $null)
                {
                    throw ([string]::Format($Strings.FailedToCreateCimSession, $RemoteComputerName))
                }

                try
                {
                    $remoteComputerTestable = TestRemoteComputer $RemoteComputerName $cimSession

                    $localToRemotePinging = DoPingTest $LocalComputerName $RemoteComputerName
                    $remoteToLocalPinging = DoPingTest $RemoteComputerName $LocalComputerName 
                    $localDtc = FindDtc $LocalComputerName $null
                    $remoteDtc = FindDtc $RemoteComputerName $cimSession
                    CompareCids $localDtc $remoteDtc
                    
                    if (($localComputerTestable -and $remoteComputerTestable -and $localToRemotePinging -and $remoteToLocalPinging) -eq $false)
                    {
                        throw $Strings.NeedDtcSecurityFix
                    }                    

                    $diagnosticTestPrompt = ([string]::Format($Strings.DiagnosticTestPrompt, $LocalComputerName, $RemoteComputerName))
                    $portDescription = $null
                    if ($ResourceManagerPort -eq $null)
                    {
                        $portDescription =  ([string]::Format($Strings.DefaultPortDescription, $port))
                    }
                    else
                    {
                        $port = $ResourceManagerPort
                        $portDescription = ([string]::Format($Strings.PortDescription, $port))
                    }

                    $firewallRequest = ([string]::Format($Strings.FirewallRequest, $port))
                    $completePrompt = ([string]::Format("{0} {1} {2}", $diagnosticTestPrompt, $portDescription, $firewallRequest))
                    
                    if ($pscmdlet.ShouldProcess($completePrompt, $Strings.QueryText, $completePrompt)) 
                    {
                        CheckIfDefaultDtcConfigured $LocalComputerName $null
                        CheckIfDefaultDtcConfigured $RemoteComputerName $cimSession
                        TestTransactionsPropagation $LocalComputerName $RemoteComputerName $port
                    }


                }
                finally
                {
                    Remove-CimSession -CimSession $cimSession
                }
                
            }
        } 
    }
    END {
    }
}