please find the error coming while executing powershell scripts,,
Invoke-Sqlcmd -ServerInstance "Servername" -Username "username" -Password "password" -Query "CREATE DATABASE
database name"
Invoke-Sqlcmd : The 'Invoke-Sqlcmd' command was found in the module 'SQLPS', but the module could not be loaded. For more
information, run 'Import-Module SQLPS'.
At line:1 char:1
+ Invoke-Sqlcmd -ServerInstance "WLE1731D" -Username "sa" -Password "Th ...
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Invoke-Sqlcmd:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
Invoke-Sqlcmd : The 'Invoke-Sqlcmd' command was found in the module 'SQLPS', but the module could not be loaded. For more
information, run 'Import-Module SQLPS'.
At line:4 char:1
+ Invoke-Sqlcmd -ServerInstance "WLE1731D" -Username "sa" -Password "Th ...
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Invoke-Sqlcmd:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule