---
title: "Ensure-Metadata"
---
Ensures that metadata exists on an Asset Directory item.
ProGet::Ensure-Metadata(
	Path: <text>,
	[Metadata: <%(key1: value1, ...)>],
	[Source: <text>],
	[Resource: <text>],
	[EndpointUrl: <text>],
	[ApiKey: <text>],
	[UserName: <text>],
	[Password: <text>]
);
| Name | Format | Script Usage | Usage 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 | Not specifying will "Use URL from secure resource". | 
| API key | text | ApiKey | Not specifying will "Use token from secure credentials". | 
| User name | text | UserName | Not specifying will "Use user name from secure credentials". | 
| Password | text | Password | Not specifying will "Use password from secure credentials". | 
# 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
);