Skip to content

Trust Server Certificate Switch #9

@mattmcnabb

Description

@mattmcnabb

I've been using a modified version of Invoke-SqlCmd2 with an added switch -TrustServerCertificate for cases where the cert returned is not in the local trusted store. Generally I've used this for testing with a self-signed cert. Do you see any value in adding this to Invoke-SqlCmd2?

$FormatValues = $SQLInstance,$Database,$Credential.UserName,$Credential.GetNetworkCredential().Password,$ConnectionTimeout,$Encrypt,$TrustServerCertificate
$ConnectionString = "Server={0};Database={1};User ID={2};Password=`"{3}`";Trusted_Connection=False;Connect Timeout={4};Encrypt={5};TrustServerCertificate={6}" -f $FormatValues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions