OperationsManager module cannot be imported because no valid module file was found in any module directory.

Brian W 121 Reputation points
2024-04-24T12:29:25.7633333+00:00

I've checked my PSModule path and "C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell" is in there, however import-module -name OperationsManager comes back with:

Import-Module : The specified module 'OperationsManager' was not loaded because no valid module file was

found in any module directory.

At line:1 char:1

  • Import-Module -Name OperationsManager
  • 
        + CategoryInfo          : ResourceUnavailable: (OperationsManager:String) [Import-Module], FileNotFoun 
    
       dException
    
        + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
    
Microsoft System Center
Microsoft System Center
A suite of Microsoft systems management products that offer solutions for managing datacenter resources, private clouds, and client devices.
838 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. XinGuo-MSFT 14,536 Reputation points
    2024-04-25T02:31:17.2066667+00:00

    Hi,

    User's image

    It seems like you’re having trouble importing the OperationsManager module in PowerShell. This error typically occurs when PowerShell can’t find the module in any of the directories specified in the $env:PSModulePath environment variable.

    Here are some steps you can take to troubleshoot this issue:

    1. Verify the module name: Make sure the module name is spelled correctly.
    2. Ensure the correct module path: Check if the module exists in the specified directory. The module needs to be placed in a folder with the same name as the module. For example, if the module name is OperationsManager, the full path would be C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell\OperationsManager\OperationsManager.psm1.
    3. Check File Extension: Ensure that the module file has the correct .psm1 extension.
    4. Reinstall the SCOM admin tools: If the module is part of the System Center Operations Manager (SCOM) admin tools, you might try reinstalling them.