---
title: "Create Build"
---
Creates a new build in BuildMaster of an application, and optionally waits for it to complete.
Create-Build(
	Application: <text>,
	[ReleaseNumber: <text>],
	[Pipeline: <text>],
	[Variables: <%(key1: value1, ...)>],
	[ForcePromotion: <true/false>],
	[Wait: <true/false>],
	[FailIfCannotCreate: <true/false>],
	[DeployToFirstStage: <true/false>]
);
This operation may be prefixed with BuildMaster::, although this is a built-in namespace and isn't really necessary.
| Name | Format | Script Usage | Usage Notes | 
|---|---|---|---|
| ☆ In application | text | Application | This argument is required. | 
| For release number | text | ReleaseNumber | This may be a specific release number, "latest" or "all". Default value is "latest". | 
| With pipeline | text | Pipeline | This is used if ReleaseNumber is empty. | 
| Build variables | %(key1: value1, ...) | Variables | Value note: "%(var1: 1000, var2: $HdarFsServer, ...)". | 
| Force past gate | true/false | ForcePromotion | |
| Wait for execution | true/false | Wait | Default value is "True". | 
| Fail if nothing created | true/false | FailIfCannotCreate | |
| Deploy to first stage | true/false | DeployToFirstStage | Default value is "True". | 
Note: When all releases is specified, then a build in *each* release will be created.
Note: When FailIfCannotCreate is specified, the execution will halt if there are no valid builds to create; for example, if the targeted release number doesn't exist. Otherwise, a warning will be issued.
Create-Build
(
    Application: Hdars.Packager,
    ReleaseNumber: latest,
    Variables: %(ReleaseCandidate: true, PackageType: $PackageType)
);