# Import-ModuleDependency

Imports a module runtime by exact paths, with dependencies loaded before the root module.

Project

PSPublishModule

Build, test, version, sign, and publish PowerShell modules with reusable PowerForge pipelines.

[View on GitHub](https://github.com/EvotecIT/PSPublishModule) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSPublishModule/releases/tag/v3.0.124) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSPublishModule/2.0.27)

Stars **48**

Forks **15**

Open issues **1**

PowerShell Gallery downloads **17,213**

Release **v3.0.195**

Language: C# Updated: 2026-11-25

Command 

**Module**

`PSPublishModule`

**Inputs**

`System.Management.Automation.PSObject` `System.String`

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>]
```

[#](#method-import-moduledependency-string-switchparameter-string-switchparameter-string-version)

Parameter set: `ByName`

```
Import-ModuleDependency
[-DependencyName <String[]>]
[-Force]
-Module <PSObject>
[-PassThru]
[[-Path] <String>]
[-RequiredVersion <Version>]
[<CommonParameters>]
```

[#](#method-import-moduledependency-string-switchparameter-psobject-switchparameter-string-version)

Parameter set: `ByModule`

```
Import-ModuleDependency
[-DependencyName <String[]>]
[-Force]
[-PassThru]
[-Path] <String>
[<CommonParameters>]
```

[#](#method-import-moduledependency-string-switchparameter-switchparameter-string)

Parameter set: `ByPath`

## Description

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

```powershell
Import-ModuleDependency -Name EntraIDConfig
```

### Import a private runtime folder created by Install-ModuleDependency

```powershell
Import-ModuleDependency -Name EntraIDConfig -Path C:\PrivateDeps
```

## Parameters

**-DependencyName String[] optional**

Dependency names to import. When omitted, imports all dependencies in the receipt.

**-Force SwitchParameter optional**

Force re-import of modules already loaded in the session.

**-Name String optionalposition: 0pipeline: True (ByPropertyName)aliases: ModuleNamesets: ByName**

Module containing embedded dependencies.

**-PassThru SwitchParameter optional**

Return imported module information from Import-Module -PassThru.

**-Path String required in ByPathposition: 0**

Installed dependency root or module-dependencies.json receipt path.

**-RequiredVersion Version optionalsets: ByName, ByModule**

Optional exact source module version when using -Name or -Module.

**-Module PSObject requiredpipeline: True (ByValue)sets: ByModule**

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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:0BEE4323270FC96681A36F5BB959CD33E5C333C8464EA4B45BB0829C7EF684DE -->
