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.169
Language: C# Updated: 2026-10-13

API Reference

Command

Import-ModuleDependency

Namespace PSPublishModule
Inputs
System.Management.Automation.PSObject System.String

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

Remarks

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

Authored help example

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
        

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.

Syntax

Import-ModuleDependency [-DependencyName <String[]>] [-Force] [-Name <String>] [-PassThru] [-Path <String>] [-RequiredVersion <Version>] [<CommonParameters>]
#
Parameter set: ByName

Parameters

DependencyName String[] optionalposition: namedpipeline: False
Dependency names to import. When omitted, imports all dependencies in the receipt.
Force SwitchParameter optionalposition: namedpipeline: False
Force re-import of modules already loaded in the session.
Name String optionalposition: 0pipeline: True (ByPropertyName)aliases: ModuleName
Module containing embedded dependencies.
PassThru SwitchParameter optionalposition: namedpipeline: False
Return imported module information from Import-Module -PassThru.
Path String optionalposition: 0pipeline: False
Installed dependency root or module-dependencies.json receipt path.
RequiredVersion Version optionalposition: namedpipeline: False
Optional exact source module version when using -Name or -Module.
Import-ModuleDependency [-DependencyName <String[]>] [-Force] -Module <PSObject> [-PassThru] [-Path <String>] [-RequiredVersion <Version>] [<CommonParameters>]
#
Parameter set: ByModule

Parameters

DependencyName String[] optionalposition: namedpipeline: False
Dependency names to import. When omitted, imports all dependencies in the receipt.
Force SwitchParameter optionalposition: namedpipeline: False
Force re-import of modules already loaded in the session.
Module PSObject requiredposition: namedpipeline: True (ByValue)
Specific module object containing embedded dependencies.
PassThru SwitchParameter optionalposition: namedpipeline: False
Return imported module information from Import-Module -PassThru.
Path String optionalposition: 0pipeline: False
Installed dependency root or module-dependencies.json receipt path.
RequiredVersion Version optionalposition: namedpipeline: False
Optional exact source module version when using -Name or -Module.
Import-ModuleDependency [-DependencyName <String[]>] [-Force] [-PassThru] -Path <String> [<CommonParameters>]
#
Parameter set: ByPath

Parameters

DependencyName String[] optionalposition: namedpipeline: False
Dependency names to import. When omitted, imports all dependencies in the receipt.
Force SwitchParameter optionalposition: namedpipeline: False
Force re-import of modules already loaded in the session.
PassThru SwitchParameter optionalposition: namedpipeline: False
Return imported module information from Import-Module -PassThru.
Path String requiredposition: 0pipeline: False
Installed dependency root or module-dependencies.json receipt path.