> For the complete documentation index, see [llms.txt](https://docs.lithnet.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lithnet.io/resource-management-powershell/v1.0/configuration/operations-element/resourceoperation-element.md).

# \<ResourceOperation> element

The `<ResourceOperation>` element defines an update, add, or remove operation on a resource.

| XML Attribute Name                                                 | Description                                                                                                                                                 | Allowed Values                                                                                                                   |
| ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| operation                                                          | Required. The type of operation to perform on the resource                                                                                                  | "Add", "Update", "Delete" or a combined "Add Update" which will create the resource if it doesn't exist, or update it if it does |
| resourceType                                                       | Required. The object type of the resource to modify                                                                                                         | Any valid resource type defined in the FIM service schema                                                                        |
| id                                                                 | Required. A unique ID to identify the ResourceOperation                                                                                                     | Any string value that is not in use by another ResourceOperation element                                                         |
| refresh-schema                                                     | Optional. Instructs the module to refresh the schema before or after the operation. This should be used when adding object classes, attributes, or bindings | "before-operation" or "after-operation"                                                                                          |
| locale                                                             | Optional. Specifies the locale the resource operation should be performed in. Only valid for update operations.                                             | A language code representing a language pack installed on the FIM/MIM Service. e.g en-US, de-de, ja-jp, es-es, it-it, etc        |
| ### Child elements                                                 |                                                                                                                                                             |                                                                                                                                  |
| The `<ResourceOperation>` element has the following child elements |                                                                                                                                                             |                                                                                                                                  |

* [AnchorAttributes element](/resource-management-powershell/v1.0/configuration/operations-element/anchorattributes-element.md)
* [AttributeOperations element](/resource-management-powershell/v1.0/configuration/operations-element/attributeoperations-element.md)

### Example

The following example defines an Add operation on a set. If the set exists, the operation is skipped

```xml
<ResourceOperation operation="Add" resourceType="Set" id="testSet">
...
</ResourceOperation>
```

The following example defines an Add/Update operation on a set. If the set exists, the set is updated. If it does not exist, it is created

```xml
<ResourceOperation operation="Add Update" resourceType="Set" id="testSet">
...
</ResourceOperation>
```

The following example defines an Update operation on a set. If the set exists, the set is updated. If it does not exist, the operation is skipped

```xml
<ResourceOperation operation="Update" resourceType="Set" id="testSet" locale="it-IT">
...
</ResourceOperation>
```

The following example defines an Delete operation on a set. If the set exists, the set is deleted. If it does not exist, the operation is skipped

```xml
<ResourceOperation operation="Delete" resourceType="Set" id="testSet">
...
</ResourceOperation>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.lithnet.io/resource-management-powershell/v1.0/configuration/operations-element/resourceoperation-element.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
