I was helping my colleague to install Sitecore 10.2.1 using Sitecore Install Framework (SIF).
Problem
His installation was failing on step XConnectXP0_CreateShardApplicationDatabaseServerLoginInvokeSqlCmd with following exception:
Install-SitecoreConfiguration : A parameter cannot be found that matches parameter name 'TrustServerCertificate'. This error might have been caused by applying the default parameter binding. You can disable the default parameter<br>binding in $PSDefaultParameterValues by setting $PSDefaultParameterValues["Disabled"] to be $true, and then trying again. The following default parameters were successfully bound for this cmdlet when the error occurred: -Debug<br>-WarningAction -Verbose -InformationAction -ErrorAction
I was searching what could be the cause and found out that he has older version of SqlServer Powershell module installed than the version that SIF needs.
You can check current version of the module yourself by running this command in PS cmd:
(Get-Command Invoke-SqlCmd).Module
Outcome is this:

You need at least version 22.2. Currently the latest version is 22.3 as of writing this post which is also just fine to install.
As he had already this module installed (with version 21.1.18256), the usual command Install-Module -Name SqlServer -AllowClobber did not fix it as he saw this warning:

Solution
Solution was pretty simple, just by adding -Force param to command.
So final command to install latest SqlServer Powershell module that works with SIF is this one:
Install-Module -Name SqlServer -Force -AllowClobber
What’s cool about PowerShell is that if you have various versions of modules installed, it will use the latest if you don’t specify it explicitly so you can just leave your system with two versions installed. Same goes to SIF itself as it’s just like any other PS Module 😉
May the force be with your Sitecore installation(s)!
