Command
Import-ModuleDependency
Imports a module runtime by exact paths, with dependencies loaded before the root module.
Syntax
Import-ModuleDependency
[-DependencyName <String[]>]
[-Force]
[[-Name] <String>]
[-PassThru]
[[-Path] <String>]
[-RequiredVersion <Version>]
[<CommonParameters>]#Parameter set:
ByNameImport-ModuleDependency
[-DependencyName <String[]>]
[-Force]
-Module <PSObject>
[-PassThru]
[[-Path] <String>]
[-RequiredVersion <Version>]
[<CommonParameters>]#Parameter set:
ByModuleImport-ModuleDependency
[-DependencyName <String[]>]
[-Force]
[-PassThru]
[-Path] <String>
[<CommonParameters>]#Parameter set:
ByPathDescription
Use -Name to import dependencies directly from a module's bundled Internals\Modules payload and then import that module by exact path. Add -Path after Install-ModuleDependency to import the private runtime copy without relying on PSModulePath discovery.
Examples
Import dependencies bundled inside a module, then import the module
Import-ModuleDependency -Name EntraIDConfigImport a private runtime folder created by Install-ModuleDependency
Import-ModuleDependency -Name EntraIDConfig -Path C:\PrivateDepsParameters
- -DependencyName String[]
- Dependency names to import. When omitted, imports all dependencies in the receipt.
- -Force SwitchParameter
- Force re-import of modules already loaded in the session.
- -Name String
- Module containing embedded dependencies.
- -PassThru SwitchParameter
- Return imported module information from Import-Module -PassThru.
- -Path String
- Installed dependency root or module-dependencies.json receipt path.
- -RequiredVersion Version
- Optional exact source module version when using -Name or -Module.
- -Module PSObject
- Specific module object containing embedded dependencies.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.