Invoke-SqlCmd2 icon indicating copy to clipboard operation
Invoke-SqlCmd2 copied to clipboard

Request: a trustServerCertificate option for -Encrypt (code included)

Open mbourgon opened this issue 3 years ago • 0 comments

Right now, it requires a trusted authority sign it. I'd like to get an option for it. For what I'm doing it's easy:

            if ($Encrypt) {
                $CSBuilder["Encrypt"] = $true
                **$CSBuilder["trustServerCertificate"] = $true**
            }

However, for a real version, you'd need a variable for it, and probably a nested if.

            if ($Encrypt) {
                $CSBuilder["Encrypt"] = $true
                if ($TrustServerCert) {
                    $CSBuilder["trustServerCertificate"] = $true
                }
            }

mbourgon avatar Jun 23 '21 21:06 mbourgon