I install SQLServer module and tried again but getting the same error: See below:
PS SQLSERVER:\> Get-Module SqlServer -ListAvailable
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 21.0.17224 SqlServer
Do i need to reboot my machine after installing the module?
You need to import the module for your session. In Powershell, execute this:
import-module sqlserver
It's generally better to use that module (Sqlserver) since it is the replacement for SQLPS.
Sue