Skip to content

Instantly share code, notes, and snippets.

@ej-github
Created November 15, 2018 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ej-github/283b95f8d2501df0bbadcb1e46490f42 to your computer and use it in GitHub Desktop.
Save ej-github/283b95f8d2501df0bbadcb1e46490f42 to your computer and use it in GitHub Desktop.
Get Configuration Element by Name and Path
// VMware vRealize Orchestrator action sample
//
// Search for Configuration Element by name and category path
//
// For vRO 7.0+
//
// Action Inputs:
// categoryPath - string - Path to the configuration element category (folder)
// configName - string - Name of configuration element
//
// Return type: ConfigurationElement
if (!categoryPath || !configName) { throw "Missing inputs"; }
var category = Server.getConfigurationElementCategoryWithPath(categoryPath);
for each (var c in category.configurationElements) {
if (c.name == configName) {
return c;
}
}
return null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment