-
Notifications
You must be signed in to change notification settings - Fork 8
LoadTask Task
Aaron Jensen edited this page Sep 27, 2019
·
1 revision
The LoadTask
task loads custom tasks into your build. Set the Path
parameter to a list of paths to PowerShell script files that contain tasks. Wildcards are allowed.
If any file contains no tasks, the build build will fail. If Whiskey has already loaded tasks from a file during the current build, it is skipped.
In order for Whiskey to find and run your tasks, they must be scoped at the script level, i.e. prefix all your task functions with the script:
scope, e.g.
function script:MyTask
{
[Whiskey.Task('MyTask')]
param(
[Parameter(Mandatory=$true)]
[Whiskey.Context]
$TaskContext,
[Parameter(Mandatory=$true)]
[hashtable]
$TaskParameter
)
}
See Writing Tasks for documentation on how to write your own tasks.
-
Path
(mandatory): a list of paths to PowerShell script files, each containing task functions.
Build:
- LoadTask:
Path: Build\Whiskey\*.ps1
Demonstrates how to load tasks. In this example, all the tasks in all the *.ps1
files the Build\Whiskey
directory are loaded.
- Common Task Properties
- AppVeyorWaitForBuildJob
- CopyFile
- Delete
- DotNet
- Exec
- File
- GetPowerShellModule
- GitHubRelease
- InstallNodeJs
- LoadTask
- Log
- MergeFile
- MSBuild
- NuGetPack
- NuGetPush
- NuGetRestore
- NUnit2
- NUnit3
- Parallel
- Pester
- Pipeline
- PowerShell
- ProGetUniversalPackage
- PublishBitbucketServerTag
- PublishBuildMasterPackage
- PublishNodeModule
- PublishPowerShellModule
- PublishProGetAsset
- PublishProGetUniversalPackage
- SetVariable
- SetVariableFromPowerShellDataFile
- SetVariableFromXml
- TaskDefaults
- Version
- Zip