You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated Set-RsDatabase and Set-RsDatabaseCredentials scripts to support new parameters of Invoke-Sqlcmd. (#401)
* Added new parameters to Set-RsDatabase script according to SQL Strict Connection Encryption update.
* Improved Set-RsDatabase script compatibility with different versions of Invoke-Sqlcmd cmdlet.
* Applied the changes from Set-RsDatabase script to Set-RsDatabaseCredentials.
* Moved Invoke-Sqlcmd general parameters composition to a separated region.
* Enhanced -Encrypt parameter description.
---------
Co-authored-by: Alexander Sholokhov <v-asholokhov@microsoft.com>
if ($containsSQLServerV22Parameters-and-not$supportSQLServerV22Parameters)
164
+
{
165
+
throw"The current version of Invoke-Sqlcmd cmdlet used in this script doesn't support -Encrypt, -TrustServerCertificate and -HostNameInCertificate parameters. Consider installing SQLServer module version 22 or higher and restarting PowerShell to use the script with these parameters."
166
+
}
167
+
136
168
#region Validating authentication and normalizing credentials
137
169
$username=''
138
170
$password=$null
@@ -178,6 +210,37 @@ function Set-RsDatabase
178
210
}
179
211
#endregion Validating admin authentication and normalizing credentials
180
212
213
+
#region Composing general parameters for Invoke-Sqlcmd cmdlet
if ($containsSQLServerV22Parameters-and-not$supportSQLServerV22Parameters)
123
+
{
124
+
throw"The current version of Invoke-Sqlcmd cmdlet used in this script doesn't support -Encrypt, -TrustServerCertificate and -HostNameInCertificate parameters. Consider installing SQLServer module version 22 or higher and restarting PowerShell to use the script with these parameters."
125
+
}
126
+
95
127
#region Validating authentication and normalizing credentials
96
128
$username=''
97
129
$password=$null
@@ -135,7 +167,39 @@ function Set-RsDatabaseCredentials
135
167
Write-Verbose"Executing database rights script..."
0 commit comments