> For the complete documentation index, see [llms.txt](https://docs.patchmypc.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/set-pmpcdeploymenttemplate.md). Agents can also search and read this documentation through its [MCP server](https://docs.patchmypc.com/~gitbook/mcp).

# Set-PmpcDeploymentTemplate

Replaces the settings on a deployment template.

[Back to the Cloud Customer API overview](https://docs.patchmypc.com/patch-my-pc-cloud-api)

## Synopsis

Replaces the settings on a deployment template.

## Syntax

{% code collapsedlinecount="10" %}

```powershell
Set-PmpcDeploymentTemplate [-DeploymentTemplateId] <String> -TemplateName <String>
  [-OsType <OSType>] [-Default] [-BuiltInUpdate <BuiltInUpdate>]
  [-AllowAvailableUninstall] [-RemoveDesktopShortcuts] [-AppVersionsRetention <Int32>]
  [-CustomVendor <String>] [-CustomDeveloper <String>] [-CustomOwner <String>]
  [-CustomNotes <String>] [-CopyForwardAssignments] [-CategoryId <String[]>]
  [-EspProfileId <String[]>] [-RoleScopeTagId <String[]>]
  [-CustomRequirements <EditDeploymentCustomRequirementsRequest>] [-WhatIf] [-Confirm]
  [<CommonParameters>]
```

{% endcode %}

## Description

Updates an existing deployment template on the selected connection.

This replaces rather than merges: every field is stored as sent, so a setting you do not supply is cleared. Read the template with Get-PmpcDeploymentTemplate first and pass back the values you want to keep.

Updating a template that no longer exists is refused rather than creating a second one under a new id, so a stale id fails visibly instead of silently producing a duplicate.

## Parameters

### -AllowAvailableUninstall

Allow users to uninstall the application from the Company Portal.

| Attribute      | Value                                          |
| -------------- | ---------------------------------------------- |
| Type           | `System.Management.Automation.SwitchParameter` |
| Required       | False                                          |
| Position       | Named                                          |
| Pipeline input | True (ByPropertyName)                          |
| Aliases        | None                                           |

### -AppVersionsRetention

How many superseded versions of the application are retained.

| Attribute      | Value                 |
| -------------- | --------------------- |
| Type           | `System.Int32`        |
| Required       | False                 |
| Position       | Named                 |
| Pipeline input | True (ByPropertyName) |
| Aliases        | None                  |

### -BuiltInUpdate

Whether the application's own updater is left enabled.

| Attribute       | Value                         |
| --------------- | ----------------------------- |
| Type            | `BuiltInUpdate`               |
| Required        | False                         |
| Position        | Named                         |
| Pipeline input  | True (ByPropertyName)         |
| Aliases         | None                          |
| Accepted values | NotAvailable, Disable, Enable |

### -CategoryId

Intune application category IDs to file the deployment under.

| Attribute      | Value                 |
| -------------- | --------------------- |
| Type           | `System.String[]`     |
| Required       | False                 |
| Position       | Named                 |
| Pipeline input | True (ByPropertyName) |
| Aliases        | None                  |

### -Confirm

Prompts you for confirmation before running the cmdlet.

| Attribute      | Value                                          |
| -------------- | ---------------------------------------------- |
| Type           | `System.Management.Automation.SwitchParameter` |
| Required       | False                                          |
| Position       | Named                                          |
| Pipeline input | False                                          |
| Aliases        | cf                                             |

### -CopyForwardAssignments

Deployments created from this template inherit the template's assignments.

| Attribute      | Value                                          |
| -------------- | ---------------------------------------------- |
| Type           | `System.Management.Automation.SwitchParameter` |
| Required       | False                                          |
| Position       | Named                                          |
| Pipeline input | True (ByPropertyName)                          |
| Aliases        | None                                           |

### -CustomDeveloper

Developer applied instead of the catalogue's.

| Attribute      | Value                 |
| -------------- | --------------------- |
| Type           | `System.String`       |
| Required       | False                 |
| Position       | Named                 |
| Pipeline input | True (ByPropertyName) |
| Aliases        | None                  |

### -CustomNotes

Free-text notes applied to deployments created from this template.

| Attribute      | Value                 |
| -------------- | --------------------- |
| Type           | `System.String`       |
| Required       | False                 |
| Position       | Named                 |
| Pipeline input | True (ByPropertyName) |
| Aliases        | None                  |

### -CustomOwner

Owner recorded against deployments created from this template.

| Attribute      | Value                 |
| -------------- | --------------------- |
| Type           | `System.String`       |
| Required       | False                 |
| Position       | Named                 |
| Pipeline input | True (ByPropertyName) |
| Aliases        | None                  |

### -CustomRequirements

Custom system requirements. Supplying them replaces the default single-architecture requirement.

| Attribute      | Value                                     |
| -------------- | ----------------------------------------- |
| Type           | `EditDeploymentCustomRequirementsRequest` |
| Required       | False                                     |
| Position       | Named                                     |
| Pipeline input | True (ByPropertyName)                     |
| Aliases        | None                                      |

### -CustomVendor

Publisher applied instead of the catalogue's.

| Attribute      | Value                 |
| -------------- | --------------------- |
| Type           | `System.String`       |
| Required       | False                 |
| Position       | Named                 |
| Pipeline input | True (ByPropertyName) |
| Aliases        | None                  |

### -Default

Make this the connection's default template, demoting whichever template currently holds that position.

| Attribute      | Value                                          |
| -------------- | ---------------------------------------------- |
| Type           | `System.Management.Automation.SwitchParameter` |
| Required       | False                                          |
| Position       | Named                                          |
| Pipeline input | True (ByPropertyName)                          |
| Aliases        | None                                           |

### -DeploymentTemplateId

The template to update.

| Attribute      | Value                 |
| -------------- | --------------------- |
| Type           | `System.String`       |
| Required       | True                  |
| Position       | 0                     |
| Pipeline input | True (ByPropertyName) |
| Aliases        | None                  |

### -EspProfileId

Enrollment Status Page profile IDs the deployment participates in.

| Attribute      | Value                 |
| -------------- | --------------------- |
| Type           | `System.String[]`     |
| Required       | False                 |
| Position       | Named                 |
| Pipeline input | True (ByPropertyName) |
| Aliases        | None                  |

### -OsType

Operating system the template applies to. Defaults to Windows.

| Attribute       | Value                 |
| --------------- | --------------------- |
| Type            | `OSType`              |
| Required        | False                 |
| Position        | Named                 |
| Pipeline input  | True (ByPropertyName) |
| Aliases         | None                  |
| Accepted values | Windows, MacOS        |

### -RemoveDesktopShortcuts

Remove desktop shortcuts after installing.

| Attribute      | Value                                          |
| -------------- | ---------------------------------------------- |
| Type           | `System.Management.Automation.SwitchParameter` |
| Required       | False                                          |
| Position       | Named                                          |
| Pipeline input | True (ByPropertyName)                          |
| Aliases        | None                                           |

### -RoleScopeTagId

Scope tag IDs applied to deployments created from this template.

| Attribute      | Value                 |
| -------------- | --------------------- |
| Type           | `System.String[]`     |
| Required       | False                 |
| Position       | Named                 |
| Pipeline input | True (ByPropertyName) |
| Aliases        | None                  |

### -TemplateName

Name shown when selecting the template.

| Attribute      | Value                 |
| -------------- | --------------------- |
| Type           | `System.String`       |
| Required       | True                  |
| Position       | Named                 |
| Pipeline input | True (ByPropertyName) |
| Aliases        | None                  |

### -WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

| Attribute      | Value                                          |
| -------------- | ---------------------------------------------- |
| Type           | `System.Management.Automation.SwitchParameter` |
| Required       | False                                          |
| Position       | Named                                          |
| Pipeline input | False                                          |
| Aliases        | wi                                             |

### CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).

## Inputs

### System.String

A deployment template id, by property name.

## Outputs

### DeploymentTemplateDto

The updated template, read back from the service.

## Examples

### Example 1: Replace a template with minimal settings

{% code collapsedlinecount="10" %}

```powershell
Set-PmpcDeploymentTemplate -DeploymentTemplateId $templateId -TemplateName 'Windows 11 baseline (2026)'
```

{% endcode %}

Every other setting is replaced with its default, because the update replaces rather than merges.

### Example 2: Change one setting and keep the rest

{% code collapsedlinecount="10" %}

```powershell
$t = Get-PmpcDeploymentTemplate -DeploymentTemplateId $templateId
$requirements = if ($null -ne $t.CustomRequirements) {
    $requirementValues = @{}
    foreach ($property in $t.CustomRequirements.PSObject.Properties) {
        if ($null -ne $property.Value) {
            $requirementValues[$property.Name] = $property.Value
        }
    }
    New-PmpcDeploymentRequirement @requirementValues
}

$settings = @{
    DeploymentTemplateId    = $t.DeploymentTemplateId
    TemplateName            = $t.TemplateName
    OsType                  = $t.OsType
    Default                 = $t.IsDefault
    BuiltInUpdate           = $t.BuiltInUpdate
    AllowAvailableUninstall = $t.AllowAvailableUninstall
    RemoveDesktopShortcuts  = $t.RemoveDesktopShortcuts
    AppVersionsRetention    = 5
    CustomVendor            = $t.CustomVendor
    CustomDeveloper         = $t.CustomDeveloper
    CustomOwner             = $t.CustomOwner
    CustomNotes             = $t.CustomNotes
    CopyForwardAssignments  = $t.CopyForwardAssignments
    CategoryId              = @($t.Categories | ForEach-Object Id)
    EspProfileId            = @($t.EspProfiles | ForEach-Object Id)
    RoleScopeTagId           = @($t.RoleScopeTags | ForEach-Object Id)
    CustomRequirements      = $requirements
}
Set-PmpcDeploymentTemplate @settings
```

{% endcode %}

Changes only AppVersionsRetention among the settings returned by Get-PmpcDeploymentTemplate. The other settings are explicitly copied back, including default status, category, ESP profile and scope tag IDs. New-PmpcDeploymentRequirement converts the returned requirements into the input type Set-PmpcDeploymentTemplate accepts.

## Notes

Requires a selected company and connection.

Because the update replaces the whole template, omitting -CustomRequirements clears any requirements the template previously carried. That is the same behaviour the portal has, and it is why reading the template first is the safe pattern.

## Related links

* [Get-PmpcDeploymentTemplate](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/get-pmpcdeploymenttemplate.md)
* [New-PmpcDeploymentTemplate](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/new-pmpcdeploymenttemplate.md)
* [PowerShell module](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell.md)

## See also

* SDK method: [UpdateDeploymentTemplateAsync](https://docs.patchmypc.com/patch-my-pc-cloud-api/sdk/deployment-templates.md#updatedeploymenttemplateasync)
* REST operation: [`PUT /v1/api/deployments/templates/{deploymentTemplateId}`](https://docs.patchmypc.com/patch-my-pc-cloud-api/rest-api/applications.md#update-deployment-template)
* [Cross-reference: cmdlets, SDK methods, and REST operations](https://docs.patchmypc.com/patch-my-pc-cloud-api/cross-reference.md)


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/set-pmpcdeploymenttemplate.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
