< Back

Get-FunctionInfo

Wed Jan 15, 2020 1:58 am

NAME Get-FunctionInfo



SYNOPSIS

Get an instance of FunctionInfo.





SYNTAX

Get-FunctionInfo [[-Path] <String>] [-IncludeNested] [<CommonParameters>]



Get-FunctionInfo [-ScriptBlock <ScriptBlock>] [-IncludeNested] [<CommonParameters>]





DESCRIPTION

FunctionInfo does not present a public constructor. This function calls an internal / private constructor on

FunctionInfo to create a description of a function from a script block or file containing one or more functions.





PARAMETERS

-Path <String>

The path to a file containing one or more functions.



Required? false

Position? 2

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-ScriptBlock <ScriptBlock>

A script block containing one or more functions.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-IncludeNested [<SwitchParameter>]

By default functions nested inside other functions are ignored. Setting this parameter will allow nested

functions to be discovered.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

System.Management.Automation.FunctionInfo





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-ChildItem -Filter *.psm1 | Get-FunctionInfo



Get all functions declared within the *.psm1 file and construct FunctionInfo.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-ChildItem C:\\Scripts -Filter *.ps1 -Recurse | Get-FunctionInfo



Get all functions declared in all ps1 files in C:\\Scripts.











RELATED LINKS