Powershell SQL module errors out when trying to use sqlserver cmdlets

44 Views Asked by At

I have the sqlserver module imported into Powershell Get-Module result

ModuleType Version    Name                                
ExportedCommands                                                                                                                                               
Manifest   21.0.17099 sqlserver                           
{Add-RoleMember, Add-SqlAvailabilityDatabase, Add- 
SqlAvailabilityGroupListenerStaticIp...
Script     0.0        SqlServer  

However I still recieve the following error when trying to use Invoke-sqlcmd:

Invoke-sqlcmd error

Invoke-Sqlcmd 
Invoke-Sqlcmd : Could not load file or assembly 
'Microsoft.SqlServer.BatchParser.dll' or one of its dependencies. 
The specified module could not 
be found.

I have tried re-importing the module and it imports successfully but it still errors out when attempting to use this. Intellisense is even detecting the module's cmdlets

0

There are 0 best solutions below