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…
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?
I use WordPress and have been very happy with it!
Seb
Thank you for sharing your thoughts. I truly appreciate your efforts and I am waiting for
your next write ups thanks once again.
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.
Glad you found it useful – thanks for stopping by!
Wow! In the end I got a webpage from where I be able to actually obtain useful information regarding my study and knowledge.
Thank you. You saved me time! Thank you for posting this.