PowerShell Genie

Command works on one host but not another

Incident 2 min read Troubleshooting walkthrough

Documentation: Microsoft Learn

Work the problem

Two hosts disagree

Fictional case: Get-Command finds the command on Host A but not Host B. Both hosts can reach the same network resources.

Which comparison is useful first?

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

Two hosts built at different times drift in ways nothing announces: a different PowerShell version, a module present in one version and older or absent in the other, and a module path that includes an extra directory on one machine. A cmdlet can also exist in both places with a parameter that only arrived in a later module release.

Check this first

1PS> $PSVersionTable; $env:PSModulePath; Get-Module -ListAvailable

What to look for

Command discovery depends on the local session and installed modules. Compare those before investigating the command’s eventual network operation.

Working through it

  1. Print $PSVersionTable on both hosts and compare PSVersion along with PSEdition.
  2. Compare $env:PSModulePath, since an extra entry is often where the working host is finding what the other cannot.
  3. Run Get-Module -ListAvailable for the module in question on each and compare the version numbers returned.
  4. Check Get-Command for the specific cmdlet and compare the reported Version and Source on each host.
  5. Confirm the execution policy and any constrained language mode, either of which can fail a script for reasons unrelated to modules.

Avoiding it next time

Verify the repair: Start a clean session on Host B and confirm Get-Command resolves the intended source and version.

Primary documentation

Files, storage and hashes documentation

Genie guideCommand works on one host but not another

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