--- title: "Ensure-Metadata" ---
This is generated from the built in components of Otter 2023.0, and may be different than what you have installed (especially if you have extensions); go to [Gear Icon] -> Administration -> Operations within your Otter instance to see exactly what operations are available.

Ensures that metadata exists on an Asset Directory item.

Script usage:

ProGet::Ensure-Metadata(
	Path: <text>,
	[Metadata: <%(key1: value1, ...)>],
	[Source: <text>],
	[Resource: <text>],
	[EndpointUrl: <text>],
	[ApiKey: <text>],
	[UserName: <text>],
	[Password: <text>]
);

Arguments:

NameFormatScript UsageUsage Notes
Path
text
Path
This argument is required.
Metadata
%(key1: value1, ...)
Metadata
Source
text
Source
Secure resource (legacy)
text
Resource
API endpoint URL
text
EndpointUrl
API key
text
ApiKey
User name
text
UserName
Password
text
Password

Example:


# ensures that the my/folder/path directory exists in the ProGet Asset Directory specified by the MyAssetDirResource secure resource
ProGet::Ensure-Metadata
(
    Path: assetitem.html,
    Metadata: %(CreatedFor: $ApplicationName, Release: $ReleaseNumber),
    Resource: MyAssetDirResource
);