0

Uninstalled the old PS module and replaced it with the new SQLServer but now third step of system job syspolicy_purge_history, which is a Powershell step, fails with the following message:

The error information returned by PowerShell is: 'The specified module 'SQLPS' with version '15.0' was not loaded because no valid module file was found in any module directory. '<

If I add #NOSQLPS on top of the script, error message changes slightly indicating cannot locate the new module:

'Cannot find drive. A drive with the name 'SQLSERVER' does not exist. '

Current SQL modules:

enter image description here

Module directories:

enter image description here

How can I make it work again?

Thank you

1 Answer 1

1

'Cannot find drive. A drive with the name 'SQLSERVER' does not exist.

This happens because it's reliant upon the SQLPS module to setup the SQLSERVER psuedo drive in PowerShell.

How can I make it work again?

Do a repair or manually reinstall the powershell module.

2
  • Is it possible to point it to the new module? It is already installed. Why use the old one when the new one already exists? Commented May 26 at 16:39
  • 1
    You can point it wherever you like, it still needs what it needs. It's looking for the psdrive, you're free to make it on your own. @Stackoverflowuser Commented May 29 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.