< Back

Build-PSBuildModule

Sat Jan 18, 2020 9:33 pm

NAME Build-PSBuildModule



SYNOPSIS

Builds a PowerShell module based on source directory





SYNTAX

Build-PSBuildModule [-Path] <String> [-DestinationPath] <String> [-ModuleName] <String> [-Compile] [[-ReadMePath]

<String>] [[-Exclude] <String[]>] [[-Culture] <String>] [<CommonParameters>]





DESCRIPTION

Builds a PowerShell module based on source directory and optionally concatenates

public/private functions from separete files into monolithic .PSM1 file.





PARAMETERS

-Path <String>

The source module path.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-DestinationPath <String>

Destination path to write "built" module to.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ModuleName <String>

The name of the module.



Required? true

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Compile [<SwitchParameter>]

Switch to indicate if separete function files should be concatenated into monolithic .PSM1 file.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-ReadMePath <String>

Path to project README. If present, this will become the "about_<ModuleName>.help.txt" file in the build

module.



Required? false

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Exclude <String[]>

Array of files to exclude from copying into built module.



Required? false

Position? 5

Default value @()

Accept pipeline input? false

Accept wildcard characters? false



-Culture <String>

UI Culture. This is used to determine what culture directory to store "about_<ModuleName>.help.txt" in.



Required? false

Position? 6

Default value (Get-UICulture).Name

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>$buildParams = @{



Path = ./MyModule

DestinationPath = ./Output/MoModule/0.1.0

ModuleName = MyModule

Exclude = @()

Compile = $false

Culture = (Get-UICulture).Name

}

PS> Build-PSBuildModule @buildParams



Build module from source directory './MyModule' and save to '/Output/MoModule/0.1.0'











RELATED LINKS