Test-DevartDatabaseConnection

Synopsis

Verifies a specified connection.

Description

The cmdlet 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, an error occurs.

Syntax

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

Parameters

-Connection

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

-Connection <object>
Property Default value
Required True
Position 0
Default value -
Accept pipeline input True (ByValue, ByPropertyName)
Accept wildcard characters False

Common parameters

<CommonParameters>

This cmdlet supports these common parameters:

  • Verbose – Provides detailed output about the command operation.
  • Debug – Provides debugging information.
  • ErrorAction – Specifies how to respond to errors.
  • ErrorVariable – Stores error messages in a variable.
  • WarningAction – Specifies how to respond to warnings.
  • WarningVariable – Stores warning messages in a variable.
  • InformationAction – Specifies how informational messages are handled.
  • InformationVariable – Stores informational messages in a variable.
  • OutBuffer – Controls the number of objects buffered before output.
  • PipelineVariable – Stores the current pipeline object in a variable.
  • OutVariable – Stores output objects in a variable.

For more information, see About Common Parameters.

Input

System.Object

Output

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

System.Boolean returns:

  • true if the operation was successful.
  • false if the operation failed.

Examples

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