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
# IMPORTANT: If the script is run in trusted environments and there is a prelogin handshake error, add -TrustServerCertificate flag in the commands for $serverName, $hostName and Get-SqlInstance lines below.
215
+
# IMPORTANT: If the script is run in trusted environments and there is a prelogin handshake error,
216
+
# add -TrustServerCertificate flag in the commands for $serverName, $hostName and Get-SqlInstance lines below.
| %{ Write-Verbose "Invoke assessment on $($_.Urn)"; $_ }
227
+
| ForEach-Object { Write-Verbose "Invoke assessment on $($_.Urn)"; $_ }
228
228
| Invoke-SqlAssessment 3>&1
229
229
| ConvertTo-LogOutput
230
230
| ConvertTo-Json -AsArray
231
231
| Set-Content $outPath -Encoding UTF8NoBOM
232
232
}
233
233
finally {
234
-
235
234
Write-Verbose "Error count: $($Error.Count)"
236
235
237
236
if ($Error) {
@@ -243,7 +242,7 @@ finally {
243
242
}
244
243
```
245
244
> [!NOTE]
246
-
> In the above script, when it is run in trusted environments and there is a prelogin handshake error, add -TrustServerCertificate flag in the commands for $serverName, $hostName and Get-SqlInstance lines in the above code. .
245
+
> When you run the previous scriptin trusted environments, and you get a prelogin handshake error, add the `-TrustServerCertificate` flag in the commands for `$serverName`, `$hostName` and `Get-SqlInstance` lines in the code.
0 commit comments