Install the SQL Server PowerShell Module from PowerShell Gallery
PowerShell commands such as Invoke-Sqlcmd (SQLServer) - SQL Server PowerShell may require installation of the SQLServer Module - SQL Server PowerShell. The module is supported by Microsoft but may not be included in default installations of PowerShell on Windows.
To download and install the SQL Server module Download SQL Server PowerShell Module - SQL Server PowerShell
Â