Internet Explorer is no longer supported. Many things will still work, but your experience will be degraded and some things won't function. Please use a modern browser such as Edge, Chrome, or Firefox.

Ensure Asset

Ensures the existence of an asset file on a server.

Script usage:

Ensure-Asset(
	Name: <text>,
	[Raft: <text>],
	[Type: <integer>],
	[Exists: <true/false>],
	Directory: <text>,
	[FileName: <text>]
);

This operation may be prefixed with Files::, although this is a built-in namespace and isn't really necessary.

Arguments:

NameFormatScript UsageUsage Notes
Asset name
text
Name
This argument is required.
Raft name
text
Raft
Asset type
integer
Type
Exists
true/false
Exists
Target directory
text
Directory
This argument is required.
Rename asset to
text
FileName
The name of the file on disk located in the path specified by the Directory argument. If no file name is specified, the operation will use the asset file name.

Example:


# ensures the config.yml file from the current raft is current on the server
Ensure-Asset config.yml (
    Path: F:\configs
);