Import-Module servermanager fails when using PowerGUI Script Editor – PowerShell

By | April 5, 2013

Today a new PowerShell funny arose while using a machine I did not build or install.

Using PowerGUI (other PowerShell script environments are available!) when attempting to import the servermanager module, I was receiving the following error:

PS C:UsersAdministrator> Import-Module servermanager
Import-Module : The specified module ‘servermanager’ was not loaded because no valid module file was found in any module directory.
At line:1 char:14
+ Import-Module <<<< servermanager
+ CategoryInfo : ResourceUnavailable: (servermanager:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

Mighty strange.

Opening a regular PoSh session, I was able to import the module as expected, and a quick browse to the module path of PoSh showed the servermanager folder and manifest to be present and correct.

What to do?

Turns out that the previous user of the machine (a Windows Server 2008R2 box, for reference) had been using the x86 build of the PowerGUI script editor, which had then nailed itself to the Start menu ready to be clicked by the unsuspecting Seb.

The x86 build of PowerGUI was trying to load the (only version present) 64bit servermanager module which caused this issue to manifest.

Switching to the 64bit (“proper”) version of PowerGUI and lo and behold, the module imports without drama. Needless to say, the x86 version was unpinned and the 64bit pinned!

10 minutes of head scratching wasted, but a solution found.

more to follow…

7 thoughts on “Import-Module servermanager fails when using PowerGUI Script Editor – PowerShell

  1. wa dentist

    I’m curious to find out what blog platform you are using?
    I’m experiencing some minor security problems with my latest site and I would like to
    find something more risk-free. Do you have any suggestions?

    1. sebmatthews Post author

      I use WordPress and have been very happy with it!

  2. thanks!

    Thank you for sharing your thoughts. I truly appreciate your efforts and I am waiting for
    your next write ups thanks once again.

  3. Matt McCann

    Thanks for this! I did not realize it but had pinned the _x86 version of the ISE to the task bar and was getting a similar error. Would not have noticed without this article.

  4. Alchemia Urody

    Wow! In the end I got a webpage from where I be able to actually obtain useful information regarding my study and knowledge.


Leave a Reply

Your email address will not be published. Required fields are marked *