< Back

Get-MrFunctionsToExport

Sat Jan 18, 2020 4:35 pm

NAME Get-MrFunctionsToExport



SYNOPSIS

Returns a list of functions in the specified directory.





SYNTAX

Get-MrFunctionsToExport [[-Path] <String>] [[-Exclude] <String[]>] [-Recurse] [-Simple] [<CommonParameters>]





DESCRIPTION

Get-MrFunctionsToExport is an advanced function which returns a list of functions

that are each contained in single quotes and each separated by a comma unless the

simple parameter is specified in which case a simple list of the base file names

for the functions is returned.





PARAMETERS

-Path <String>

Path to the folder where the functions are located.



Required? false

Position? 1

Default value (Get-Location)

Accept pipeline input? false

Accept wildcard characters? false



-Exclude <String[]>

Pattern to exclude. By default profile scripts and Pester tests are excluded.



Required? false

Position? 2

Default value ('*profile.ps1', '*.tests.ps1')

Accept pipeline input? false

Accept wildcard characters? false



-Recurse [<SwitchParameter>]

Return function names from subdirectories in addition to the specified directory.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Simple [<SwitchParameter>]

Return a simple list instead of a quoted comma separated list.



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

None





OUTPUTS

String





NOTES





Author: Mike F Robbins

Website: http://mikefrobbins.com

Twitter: @mikefrobbins



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



PS C:\\>Get-MrFunctionsToExport -Path .\\MrToolkit













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



PS C:\\>Get-MrFunctionsToExport -Path .\\MrToolkit -Simple















RELATED LINKS