--- title: "Test-RelativityConnection" slug: "scripting-test-relativityconnection" updated: 2024-09-23T12:11:50Z published: 2024-09-23T12:11:50Z canonical: "help.agilityblue.com/scripting-test-relativityconnection" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.agilityblue.com/llms.txt > Use this file to discover all available pages before exploring further. # Test-RelativityConnection > [!NOTE] > Relativity Integration Required > > This cmdlet requires a valid Relativity integration in order to work. See the [Relativity integration](/v1/docs/relativity-integration) documentation to learn how to set up the integration. ## Summary Tests a Relativity integration and returns `true` or `false` if the test succeeds or not. ```powershell Test-RelativityConnection    -IntegrationId    -ThrowException ``` Returns a boolean value. ## Parameters | Parameter | Type | Required? | Notes | | --- | --- | --- | --- | | IntegrationId | Int32 | Yes | The integration id. | | ThrowException | Switch | No, defaults to `false` | If set to `true`, the cmdlet will throw an exception instead of returning `false` for a failed connection test. | ## Examples ### Test the connection to Relativity ```powershell # Your Relativity base URL relativityUrl = "https://my-company.relativity.one" # Retrieve the Relativity integration based on the Relativity URL to get the integration id needed $integrations = Get-Integrations `    -Filter "Name eq 'Relativity' and startswith(Identifier,'$relativityUrl')" $relativityIntegration = $integrations.Collection | Select-Object -First 1 if ($null -eq $relativityIntegration) {    Write-Error "Unable to find a Relativity integration with the identifier `"$relativityIdentifier`""    exit } # Test the Relativity connection. The `Test-RelativityConnection` cmdlet returns true # or false depending on if the connection is successful or not. $relativityConnectionTestSuccessful = Test-RelativityConnection `    -IntegrationId $relativityIntegration.IntegrationId if (-not $relativityConnectionTestSuccessful) {    Write-Error "Unable to connect to Relativity instance $relativityUrl"    exit } Write-Output "Successfully tested the connection to Relativity instance $relativityUrl" ``` Output of this script: ```plaintext Successfully tested the connection to Relativity instance https://my-company.relativity.one ```