Builds a connection object to a database.
The cmdlet returns the DevartDatabaseConnectionInfo object.
New-DevartSqlDatabaseConnection [-Server] <string> [-Database] <string> [[-UserName] <string>] [[-Password] <string>]
[[-WindowsAuthentication] <SwitchParameter>] [[-ConnectionTimeout] <int>] [<CommonParameters>]
Specifies the name or network address of the SQL Server instance where the destination database resides.
-Server <string>
| Property | Default value |
|---|---|
| Required | True |
| Position | 1 |
| Default value | - |
| Accept pipeline input | False |
| Accept wildcard characters | False |
Specifies the database you want to connect to.
-Database <string>
| Property | Default value |
|---|---|
| Required | True |
| Position | 2 |
| Default value | - |
| Accept pipeline input | False |
| Accept wildcard characters | False |
Specifies the username you use for the SQL Server account to connect to the database.
-UserName <string>
| Property | Default value |
|---|---|
| Required | False |
| Position | 3 |
| Default value | - |
| Accept pipeline input | False |
| Accept wildcard characters | False |
Specifies the password you use for the SQL Server account to connect to the database.
-Password <string>
| Property | Default value |
|---|---|
| Required | False |
| Position | 4 |
| Default value | - |
| Accept pipeline input | False |
| Accept wildcard characters | False |
Allows a user to connect to the server using a Windows user account.
-WindowsAuthentication <SwitchParameter>
| Property | Default value |
|---|---|
| Required | False |
| Position | 5 |
| Default value | False |
| Accept pipeline input | False |
| Accept wildcard characters | False |
Sets the timeout period (in seconds) for establishing a connection to the server.
-ConnectionTimeout <int>
| Property | Default value |
|---|---|
| Required | False |
| Position | 6 |
| Default value | 15 |
| Accept pipeline input | False |
| Accept wildcard characters | False |
<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.
Devart.DbForge.DevOpsAutomation.SqlServer.DevartDatabaseConnectionInfo
$connection = New-DevartSqlDatabaseConnection -Server $serverName -Database $database -UserName $userName -Password $password
For a list of default values for the parameters, see the web documentation.