< Back

Get-LocalDbConnectionString

Sat Jan 11, 2020 3:46 am

NAME Get-LocalDbConnectionString



SYNOPSIS

Gets the connection string from of the LocalDB instance





SYNTAX

Get-LocalDbConnectionString [[-InstanceName] <Object>] [<CommonParameters>]





DESCRIPTION

The Get-LocalDbConnectionString returns the connection string to connect to a local Db instance. It defaults

retrieves the connection string from the instance mssqllocaldb. If the instance is not running the function will

starts the instance.





PARAMETERS

-InstanceName <Object>

The instance from which the connection string must be retrieved. Default: mssqllocaldb



Required? false

Position? 1

Default value mssqllocaldb

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 containing the connection string





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



PS C:\\>Get-LocalDbConnectionString



Returns the connection string from the instance mssqllocaldb









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-LocalDbConnectionString -InstanceName "MyInstance"



Returns the connection string from the instance MyInstance











RELATED LINKS

Questions about this script: rick@chroomsoft.nl