# Get-MissingFunctions

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

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**

`None`

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

## Syntax

```
Get-MissingFunctions
[-ApprovedModules <String[]>]
[-FilePath <String>]
[-Functions <String[]>]
[-IgnoreFunctions <String[]>]
[-Summary]
[-SummaryWithCommands]
[<CommonParameters>]
```

[#](#method-get-missingfunctions-string-string-string-string-switchparameter-switchparameter)

Parameter set: `File`

```
Get-MissingFunctions
[-ApprovedModules <String[]>]
[-Code <ScriptBlock>]
[-Functions <String[]>]
[-IgnoreFunctions <String[]>]
[-Summary]
[-SummaryWithCommands]
[<CommonParameters>]
```

[#](#method-get-missingfunctions-string-scriptblock-string-string-switchparameter-switchparameter)

Parameter set: `Code`

## Description

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

### List missing function dependencies for a script

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

```powershell
$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.

## Parameters

**-ApprovedModules String[] optional**

Module names that are allowed sources for pulling inline helper function definitions.

**-FilePath String optionalaliases: Pathsets: File**

Path to a script file to analyze for missing function dependencies. Alias: Path.

**-Functions String[] optional**

Known function names to treat as already available (exclude from missing list).

**-IgnoreFunctions String[] optional**

Function names to ignore when computing the missing set.

**-Summary SwitchParameter optional**

Return only a flattened summary list of functions used (objects with Name/Source), not inlined definitions.

**-SummaryWithCommands SwitchParameter optional**

Return a typed report with Summary, SummaryFiltered, and Functions.

**-Code ScriptBlock optionalaliases: ScriptBlocksets: Code**

ScriptBlock to analyze instead of a file. Alias: ScriptBlock.

## 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:26271D1ED25942858145FD319F19DD5B37A2BB39DCDB5118F34231AE09C827CF -->
