Skip to main content

BuildTearDown

This page was generated

Contributions are welcome in Psake-repo.

Since Psake 5.0

This command was introduced in Psake 5.0 and is not available in earlier versions.

SYNOPSIS

Adds a scriptblock that will be executed once at the end of the build

SYNTAX

__AllParameterSets

BuildTearDown [-Setup] <scriptblock> [<CommonParameters>]

DESCRIPTION

This function will accept a scriptblock that will be executed once at the end of the build, regardless of success or failure

EXAMPLES

EXAMPLE 1

Task default -Depends Test
Task Test -Depends Compile, Clean {
}
Task Compile -Depends Clean {
}
Task Clean {
}
BuildTearDown {
"Running 'BuildTearDown'"
}

The script above produces the following output: Executing task, Clean... Executing task, Compile... Executing task, Test... Running 'BuildTearDown' Build Succeeded

EXAMPLE 2

Task default -Depends Test
Task Test -Depends Compile, Clean {
throw "forced error"
}
Task Compile -Depends Clean {
}
Task Clean {
}
BuildTearDown {
"Running 'BuildTearDown'"
}

The script above produces the following output: Executing task, Clean... Executing task, Compile... Executing task, Test... Running 'BuildTearDown' forced error At line:x char:x ...

PARAMETERS

-Setup

A scriptblock to execute

Type: System.Management.Automation.ScriptBlock
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

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

INPUTS

OUTPUTS

NOTES

VERSION

This page was generated using comment-based help in Psake 5.0.3.