< Back

Export-AllModuleFunction

Sat Jan 18, 2020 6:47 pm

NAME Export-AllModuleFunction



SYNOPSIS

Exports All Module Functions into Separate PS1 files





SYNTAX

Export-AllModuleFunction [-Module] <String> -OutPath <String> [<CommonParameters>]





DESCRIPTION

Exposes all Private and Public Functions and exports them to a location that you tell it to Export to & Creates a

Basic Shell Pester Test for the Function





PARAMETERS

-Module <String>

This should be passed the Module Name as a single string - for example 'PesterHelpers'



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-OutPath <String>

This is the location that you want to output all the module files to. It is recommended not to use the same

location as where the module is installed.

Also always check the files output what you expect them to.



Required? true

Position? named

Default value

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



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



PS C:\\>Export-AllModuleFunction -Module TestModule -OutPath C:\\TestModule\\



This will get the Module TestModule that is loaded in the Current PowerShell Session and will then iterate through

all the Private & Public Functions and

export them to separate ps1 files with a non-functional test file and a blank Functional tests file created as

well.











RELATED LINKS