| external help file | PSPublishModule-help.xml |
|---|---|
| Module Name | PSPublishModule |
| online version | https://github.com/EvotecIT/PSPublishModule |
| schema | 2.0.0 |
Analyzes a script or scriptblock and reports functions/commands it calls that are not present.
Get-MissingFunctions [-FilePath <string>] [-Functions <string[]>] [-Summary] [-SummaryWithCommands] [-ApprovedModules <string[]>] [-IgnoreFunctions <string[]>] [<CommonParameters>]Get-MissingFunctions [-Code <scriptblock>] [-Functions <string[]>] [-Summary] [-SummaryWithCommands] [-ApprovedModules <string[]>] [-IgnoreFunctions <string[]>] [<CommonParameters>]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.
PS> Get-MissingFunctions -FilePath '.\Build\Build-Module.ps1' -SummaryReturns a list of functions referenced by the script that are not part of the script itself.
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.
Module names that are allowed sources for pulling inline helper function definitions.
Type: String[]
Parameter Sets: File, Code
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueScriptBlock to analyze instead of a file. Alias: ScriptBlock.
Type: ScriptBlock
Parameter Sets: Code
Aliases: ScriptBlock
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TruePath to a script file to analyze for missing function dependencies. Alias: Path.
Type: String
Parameter Sets: File
Aliases: Path
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueKnown function names to treat as already available (exclude from missing list).
Type: String[]
Parameter Sets: File, Code
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueFunction names to ignore when computing the missing set.
Type: String[]
Parameter Sets: File, Code
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueReturn only a flattened summary list of functions used (objects with Name/Source), not inlined definitions.
Type: SwitchParameter
Parameter Sets: File, Code
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueReturn a typed report with Summary, SummaryFiltered, and Functions.
Type: SwitchParameter
Parameter Sets: File, Code
Aliases: None
Possible values:
Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
None
System.Object
- None