PowerShell Genie

Module imports but command is missing

Incident 2 min read Troubleshooting walkthrough

Documentation: Microsoft Learn

Work the problem

Import succeeded

Fictional case: A module imports without error, but the expected command is absent from Get-Command -Module. Another host has a newer module version.

What should you compare?

Reasoning notebook

Record the evidence that supports your answer and the check you would run next. Your notes stay in this browser — nothing is uploaded.

Why it happens

A manifest controls which functions get exported, so a command defined inside the module can be excluded from FunctionsToExport deliberately or by accident. Side-by-side versions matter too, since the newest available loads by default and the command may only exist in an older one. Sometimes the command is simply remembered from a different module and attributed to this one.

Check this first

1PS> Get-Module ModuleName -ListAvailable; Import-Module ModuleName; Get-Command -Module ModuleName

What to look for

Import success means a module loaded, not that every command you expected exists in that version or is exported.

Working through it

  1. Run Get-Command -Module ModuleName and read the list of commands actually exported.
  2. Compare that against Get-Module ModuleName -ListAvailable to see how many versions are installed.
  3. Import a specific version with -RequiredVersion when more than one is present.
  4. Search everything with Get-Command YourCommand -All, which reveals whether it belongs to a different module.
  5. Check the manifest's FunctionsToExport entry if you own the module, since a wildcard behaves differently from an explicit list.

Avoiding it next time

Verify the repair: Use a clean session with the intended module version and verify the exact command and syntax.

Primary documentation

Get-Command reference

Work through the incident

Inspect module exports

Import-Module succeeds, but the expected function is unavailable.

Review the lesson

Genie guideModule imports but command is missing

Start with the symptom, then inspect the checks and evidence. These are investigation steps; more than one cause may fit.