Project

PSPublishModule

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

Stars 48
Forks 16
PowerShell Gallery downloads 17,213
Release v3.0.186
Language: C# Updated: 2026-11-04
Command

Import-ModuleDependency

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>]
#
Parameter set: ByName
Import-ModuleDependency
[-DependencyName <String[]>]
[-Force]
-Module <PSObject>
[-PassThru]
[[-Path] <String>]
[-RequiredVersion <Version>]
[<CommonParameters>]
#
Parameter set: ByModule
Import-ModuleDependency
[-DependencyName <String[]>]
[-Force]
[-PassThru]
[-Path] <String>
[<CommonParameters>]
#
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

Import-ModuleDependency -Name EntraIDConfig

Import a private runtime folder created by Install-ModuleDependency

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.