Imported PowerShell module shows no ExportedCommands

wallst360 21 Reputation points
2020-09-01T18:38:48.673+00:00

I have a batch of 150-200 Windows 2016 servers that were upgraded to 2019. Following the upgrade about a dozen of them can no longer run commands from an AWS supplied module, while the others can. Upon further investigation we found that importing the module gives no errors, and get-module will list the module name. But the issue is the ExportedCommands property is blank/null. When you attempt to call any of the commands within the module it of course fails.

The issue spans across a few isolated/untrusted domains. Both the "good" and "bad" servers all have the same policies applied to them. In fact many of the servers were probably cloned from one another.

Any suggestions on how to troubleshoot? I've tried to research the issue but most hits suggest a problem with the module itself, in which case it does not work anywhere.

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,546 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 46,801 Reputation points
    2020-09-01T19:40:22.68+00:00

    You might try Remove-Module (and use the -Force switch) followed by Import-Module (and use the -Force switch here, too).

    If that doesn't fix things, try Test-ModuleManifest to verify that something isn't wrong on those machines where you don't see any exported commands.

    Are there any dependencies on .Net versions for the module? Are all machines running the same .Net versions? Powershell versions the same (release and bitness)?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.