< Back

Get-SqlConnectionString

Mon Jan 13, 2020 6:58 pm

NAME Get-SqlConnectionString



SYNOPSIS

Updates a connection strings to source SQL databases with new server and database names.





SYNTAX

Get-SqlConnectionString [-SourceSqlServer] <String> [-SourceSqlDatabase] <String> [-ExistingConnectionString]

<String> [<CommonParameters>]





DESCRIPTION

Helper function to help create valid connection strings to source SQL databases.





PARAMETERS

-SourceSqlServer <String>

Name of the SQL server, including instance and port if required.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SourceSqlDatabase <String>

Name of the source SQL database.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ExistingConnectionString <String>

The existing SQL connection string obtained from the cube definition or config file.



Required? true

Position? 3

Default value

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.String





NOTES





Written by (c) Dr. John Tunnicliffe, 2019 https://github.com/DrJohnT/DeployCube

This PowerShell script is released under the MIT license http://www.opensource.org/licenses/MIT



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-SqlConnectionString -SourceSqlServer myserver -SourceSqlDatabase mydatabase -ExistingConnectionString

'Provider=SQLNCLI11;Data Source=localhost;Initial Catalog=DatabaseToPublish;Integrated Security=SSPI;Persist

Security Info=false';



Returns

'Provider=SQLNCLI11;Data Source=myserver;Persist Security Info=False;Integrated Security=SSPI;Initial

Catalog=mydatabase'











RELATED LINKS

https://github.com/DrJohnT/DeployCube