Evotec

Project

PSPublishModule

PSPublishModule is an open-source PowerShell and .NET project with packages, release history, and technical documentation.

Stars 43
Forks 13
Open issues 1
PowerShell Gallery downloads 13,876
Release v3.0.3
Language: C# Updated: 2026-04-14

API Reference

Cmdlet

Get-MissingFunctions

Namespace PSPublishModule
Inputs
None
Outputs
System.Object

Analyzes a script or scriptblock and reports functions/commands it calls that are not present.

Remarks

This cmdlet parses PowerShell code and returns a list of referenced commands that look like missing local helpers. It is useful when building “portable” scripts/modules where you want to detect (and optionally inline) helper functions. When -ApprovedModules is specified, helper definitions are only accepted from those modules.

Examples

Authored help example

List missing function dependencies for a script

PS>


Get-MissingFunctions -FilePath '.\Build\Build-Module.ps1' -Summary
        

Returns a list of functions referenced by the script that are not part of the script itself.

Analyze a scriptblock and return inlineable helper definitions

PS>


$sb = { Invoke-ModuleBuild -ModuleName 'MyModule' }; Get-MissingFunctions -Code $sb -SummaryWithCommands -ApprovedModules 'PSSharedGoods','PSPublishModule'
        

Returns a structured report that can include helper function bodies sourced from approved modules.

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

Get-MissingFunctions [-ApprovedModules <String[]>] [-FilePath <String>] [-Functions <String[]>] [-IgnoreFunctions <String[]>] [-Summary] [-SummaryWithCommands] [<CommonParameters>]
#
Parameter set: File

Parameters

ApprovedModules String[] optionalposition: namedpipeline: False
Module names that are allowed sources for pulling inline helper function definitions.
FilePath String optionalposition: namedpipeline: Falsealiases: Path
Path to a script file to analyze for missing function dependencies. Alias: Path.
Functions String[] optionalposition: namedpipeline: False
Known function names to treat as already available (exclude from missing list).
IgnoreFunctions String[] optionalposition: namedpipeline: False
Function names to ignore when computing the missing set.
Summary SwitchParameter optionalposition: namedpipeline: False
Return only a flattened summary list of functions used (objects with Name/Source), not inlined definitions.
SummaryWithCommands SwitchParameter optionalposition: namedpipeline: False
Return a typed report with Summary, SummaryFiltered, and Functions.

Outputs

System.Object

Get-MissingFunctions [-ApprovedModules <String[]>] [-Code <ScriptBlock>] [-Functions <String[]>] [-IgnoreFunctions <String[]>] [-Summary] [-SummaryWithCommands] [<CommonParameters>]
#
Parameter set: Code

Parameters

ApprovedModules String[] optionalposition: namedpipeline: False
Module names that are allowed sources for pulling inline helper function definitions.
Code ScriptBlock optionalposition: namedpipeline: Falsealiases: ScriptBlock
ScriptBlock to analyze instead of a file. Alias: ScriptBlock.
Functions String[] optionalposition: namedpipeline: False
Known function names to treat as already available (exclude from missing list).
IgnoreFunctions String[] optionalposition: namedpipeline: False
Function names to ignore when computing the missing set.
Summary SwitchParameter optionalposition: namedpipeline: False
Return only a flattened summary list of functions used (objects with Name/Source), not inlined definitions.
SummaryWithCommands SwitchParameter optionalposition: namedpipeline: False
Return a typed report with Summary, SummaryFiltered, and Functions.

Outputs

System.Object