Skip to content

Start BuildScript

Nate Ferrell edited this page Sep 8, 2019 · 3 revisions

Start-BuildScript

SYNOPSIS

For those using the typical build.ps1 build scripts for PowerShell projects, this will allow invoking the build script quickly from wherever folder you are currently in using a child process.

SYNTAX

Start-BuildScript [[-Project] <String>] [[-Task] <String[]>] [[-Engine] <String>] [-NoExit]
 [-IncludeConcepts <Object>] [-GitPush <Object>] [<CommonParameters>]

DESCRIPTION

For those using the typical build.ps1 build scripts for PowerShell projects, this will allow invoking the build script quickly from wherever folder you are currently in using a child process. Any projects in the ProjectPaths list that were discovered during PSProfile load and have a build.ps1 file will be able to be tab-completed for convenience. Temporarily sets the path to the build folder, invokes the build.ps1 file, then returns to the original path that it was invoked from.

EXAMPLES

EXAMPLE 1

Start-BuildScript MyModule -NoExit

Changes directories to the repo root of MyModule, invokes build.ps1, imports the compiled module in a clean child process and stops before exiting to allow testing of the newly compiled module.

EXAMPLE 2

bld MyModule -ne

Same experience as Example 1 but uses the shorter alias 'bld' to call. Also uses the parameter alias `-ne` instead of `-NoExit`

PARAMETERS

-Project

The path of the project to build. Allows tab-completion of PSBuildPath aliases if ProjectPaths are filled out with PSProfile that expand to the full path when invoked.

You can also pass the path to a folder containing a build.ps1 script, or a full path to another script entirely.

Type: String
Parameter Sets: (All)
Aliases: p

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Task

The list of Tasks to specify to the Build script.

Type: String[]
Parameter Sets: (All)
Aliases: t

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Engine

The engine to open the clean environment with between powershell, pwsh, and pwsh-preview. Defaults to the current engine the clean environment is opened from.

Type: String
Parameter Sets: (All)
Aliases: e

Required: False
Position: 3
Default value: $(if ($PSVersionTable.PSVersion.ToString() -match 'preview') {
            'pwsh-preview'
        }
        elseif ($PSVersionTable.PSVersion.Major -ge 6) {
            'pwsh'
        }
        else {
            'powershell'
        })
Accept pipeline input: False
Accept wildcard characters: False

-NoExit

If $true, does not exit the child process once build.ps1 has completed and imports the built module in BuildOutput (if present to allow testing of the built project in a clean environment.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: ne, noe

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-GitPush

{{ Fill GitPush Description }}

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-IncludeConcepts

{{ Fill IncludeConcepts Description }}

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
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

OUTPUTS

NOTES

RELATED LINKS

PSProfile

Concepts

Function Help

Command Aliases

Configuration

Helpers

Init Scripts

Meta

Modules to Import

Modules to Install

Path Aliases

Plugin Paths

Plugins

Power Tools

Project Paths

Prompts

Script Paths

Secrets

Symbolic Links

Variables

Badges

Azure Pipelines      Discord - Chat      Slack - Chat      Codacy PowerShell Gallery      GitHub Releases      GitHub Releases

Clone this wiki locally