Test-DevartDatabaseConnection

Synopsis

Tries to open a specified connection.

Description

Checks that the details in a DatabaseConnection object produced by the New-DevartSqlDatabaseConnection cmdlet can be used to connect to the specified database. If Test-DevartDatabaseConnection can’t connect to the database, it raises an error.

Syntax

Test-DevartDatabaseConnection [-Connection] <object> [<CommonParameters>]

Parameters

-Connection <object>

The DevartDatabaseConnectionInfo or connection string that identifies the connection to test.

Required? true

Position? 0

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false

<CommonParameters>

This cmdlet supports the following common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, InformationAction, InformationVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see About CommonParameters.

Inputs

System.Object

The DevartDatabaseConnectionInfo or connection string that identifies the connection to test.

Outputs

System.Boolean (returns true on success and false otherwise)

Examples

---------- EXAMPLE 1 ----------
$connection = New-DevartSqlDatabaseConnection -Server $serverName -Database $database -UserName $userName -password $password
Test-DevartDatabaseConnection -Connection $connection

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge DevOps Automation for SQL Server.
Request a demo

Request a demo

If you consider employing the DevOps Automation for your business, request a demo to see it in action.
Ready to start using dbForge DevOps Automation for SQL Server?