PowerShell 4 - Import-Module: The specified "SQLPS" module was not loaded because no valid module file was found in any module directory

Previously worked with PowerShell 3. Upgrade PowerShell to 4 and uninstall it as shown below. "Import module: the specified" SQLPS "module was not loaded because no valid module file was found in any module directory." But all sql related stuff is working fine with an error. What is the cause of this error in the PowerShell console?

+8
source share
2 answers

It looks like you need to manually update the module path.

Make sure this directory exists on the computer.

C:\Program Files (x86)\Microsoft SQL Server\110\Tools\PowerShell\Modules\SQLPS 

[Fixed]

If this happens, run

 $env:PSModulePath = $env:PSModulePath + ";C:\Program Files (x86)\Microsoft SQL Server\110\Tools\PowerShell\Modules" 

Then check if the SQLPS module is in the list of available modules using

 get-module -listavailable 
+12
source

This is just a normal mistake.

 Step: 1 - We have to check the Path[[ C:\Program Files (x86)\Microsoft SQL Server\110\Tools\PowerShell\Modules\SQLPS]] is available in our machine. If yes, follow step 2 Step: 2. Just copy the [SQLPS] folder from the above link Step: 3. Paste the same in [[C:\Windows\system32\WindowsPowerShell\v1.0\Modules\\\ Step: 4 Its been occur due to unavailability of the SQLPS 
0
source

Source: https://habr.com/ru/post/1234842/


All Articles