Skip to content

Export PSScriptFunctionNames

Nick Spreitzer edited this page Nov 16, 2019 · 5 revisions
external help file: WhatsNew.dll-Help.xml
Module Name: WhatsNew
schema: 2.0.0

Export-PSScriptFunctionNames

SYNOPSIS

Extracts function names from a given PowerShell script.

SYNTAX

Export-PSScriptFunctionNames -ScriptFile <String> [<CommonParameters>]

DESCRIPTION

Returns a simple list of all function names contained in a particular PowerShell script. Examine the build.ps1 file in this repository for example usage.

EXAMPLES

Example 1

PS C:\> Get-ChildItem -Path "$PSScriptRoot\src\script-modules" -File |
  Select-Object -ExpandProperty FullName | 
  Export-PSScriptFunctionNames

This example is taken from the WhatsNew build script. It returns all function names exported from the PowerShell script files contained in this module.

PARAMETERS

-ScriptFile

The PowerShell script file from which to extract all function names.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.String

The PowerShell script file from which to extract all function names.

OUTPUTS

NOTES

RELATED LINKS

Export-PSScriptFunctionNames