< Back

New-OledbConnection

Sat Jan 18, 2020 5:47 pm

NAME New-OledbConnection



SYNOPSIS

Returns a new System.Data.OleDb.OleDbConnection object.





SYNTAX

New-OledbConnection [-ConnectionString] <String> [-File <String>] [<CommonParameters>]



New-OledbConnection [-List] [-File <String>] [<CommonParameters>]





DESCRIPTION

Returns a new System.Data.OleDb.OleDbConnection object given a connection

string or alias found in a file. Defaults to Module_Root\\SQLConnections.txt.

Queries the user for input when a connection string has parameters specified

between percent signs are found, %Example Parameter%.





PARAMETERS

-ConnectionString <String>

Any valid OleDB connection string. Prompts a user for input if a paramter

specified between percent signs is found, %Example Parameter%.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-List [<SwitchParameter>]

List the alias names and their connection string values found in the

connection file.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-File <String>

File used for resolving aliases to the full connection string.

Defaults to SQLConnections.txt.



Required? false

Position? named

Default value (Join-Path $PSScriptRoot SQLConnections.txt)

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

System.Data.OleDb.OleDbConnection





NOTES





SEE ALSO

about_OledbSql





RELATED LINKS