Use this topic when a cmdlet is missing, the wrong module version loads, command names collide, a script works only in Windows PowerShell 5.1, or module dependencies/exported commands differ across hosts.
Modules
A PowerShell module is a reusable package of commands, types/resources and metadata. Module discovery depends on paths and manifests; import can load a specific implementation/version into the session, while PowerShell 7 may use compatibility mechanisms for some Windows PowerShell modules.
1. Get-Module -ListAvailable <name> — installed? Which version?
2. Import-Module <name> — errors?
3. $env:PSModulePath -split ';' — search paths.
4. Install: Install-Module <name> -Scope CurrentUser (or AllUsers).
5. Version conflicts → Import-Module -RequiredVersion.
module in PSModulePath → imported (auto or explicit) → commands available
Run a minimal representative command and compare object/result behavior to the expected contract.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Do not fix missing cmdlets by copying module folders blindly. Do not assume newer module is always backward compatible. Avoid relying on auto-load when deterministic startup matters; log module/version provenance for production automation.
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
On a failing system, compare $PSVersionTable, $env:PSModulePath, Get-Module -ListAvailable and Get-Command <name> -All. Import the intended module/version explicitly in a clean session, then run the smallest read-only target query before trusting a full script.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Module availability is not the same as module import, and import is not the same as command success.
PSModulePathand module manifests influence discovery/version selection.- Auto-loading can hide when a module was brought into the session.
- PowerShell 7 and Windows PowerShell 5.1 can have different module compatibility.
- Importing one version can change command/type behavior expected by an existing script.
Get-Module -ListAvailable <name>— installed versions$PSVersionTable— PowerShell edition and versionGet-Command <name>— which cmdlet/function/exe runsGet-Help <cmdlet> -Full— syntax and parametersGet-ExecutionPolicy -List— execution policy per scope
ReferenceWhat it is1 section · depth on demand
Core model
Modules are the primary PowerShell unit for reusable command distribution. A manifest can declare version, compatible editions, required modules/assemblies and exported members. The same command name can be exported by multiple modules, making command source part of reproducibility.
ReferenceImportant terms & boundaries2 sections · depth on demand
PowerShell boundary
PowerShell searches module paths and can auto-load a module when a command is invoked. Windows PowerShell 5.1 and PowerShell 7 use different runtimes, so a module that depends on full .NET Framework or Windows-only APIs may require Windows PowerShell or a compatibility approach.
In depth
Modules package functions, cmdlets and resources. Find and install them from the PowerShell Gallery (or an internal repository):
Get-Module -ListAvailable
Find-Module -Name ImportExcel
Install-Module ImportExcel -Scope CurrentUser
Install-PSResource Microsoft.Graph -Scope AllUsers # PSResourceGet (PS 7.4+)
Import-Module ActiveDirectory
$env:PSModulePath -split ';'
Pin versions in automation (-RequiredVersion), and prefer an internal mirror for production scripts so a compromised or changed public module cannot alter your environment.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in PowerShell → Modules. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/powershell/ · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
PowerShell → Modules reference map
Fast lookup boundaries for PowerShell → Modules.
| Item | Meaning | Evidence boundary |
|---|---|---|
| Discovery | Module found on search path | not proof it can import |
| Manifest | Metadata/dependencies/compatibility | metadata can be incomplete or environment-specific |
| Import | Loads module into session | not proof commands work against target |
| Version/path | Implementation identity | different versions can change behavior |
| Compatibility mode | Cross-edition bridge | proxy/serialization can change object behavior |