> 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.md). Agents can also search and read this documentation through its [MCP server](https://docs.patchmypc.com/~gitbook/mcp).

# PowerShell module

Install the Patch My PC Cloud Customer API PowerShell module, connect, and find the cmdlet for each task.

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

The `PatchMyPC.Cloud` PowerShell module lets you manage applications and deployments in the Patch My PC Cloud Customer API from a script, a scheduled task, or the PowerShell console. It has one cmdlet for each SDK method, and it calls the same service as the SDK and the REST API.

## Install the module

The module requires PowerShell 7.4 or later on Windows, macOS, or Linux. It's published to the PowerShell Gallery. To install it for your user account, run:

{% code collapsedlinecount="10" %}

```powershell
Install-Module PatchMyPC.Cloud -Scope CurrentUser
```

{% endcode %}

Then import it:

{% code collapsedlinecount="10" %}

```powershell
Import-Module PatchMyPC.Cloud
```

{% endcode %}

## Connect

Every cmdlet that calls the Cloud Customer API needs a connected session. Connect with a personal access token (PAT) that you created in the Patch My PC portal under **Settings** > **Access Tokens**. [Connect-PmpcCloudWithPat](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/connect-pmpccloudwithpat.md) exchanges the PAT for an access token, and exchanges the PAT again when the access token expires. Use `-Region` for the region your account is in.

{% code collapsedlinecount="10" %}

```powershell
$token = Read-Host -AsSecureString 'PAT'
Connect-PmpcCloudWithPat -Token $token -Region Us
Get-PmpcCustomerInfo
```

{% endcode %}

The session can do everything the token's scopes allow. To create a PAT, choose its scopes, or revoke it, use the portal; see [Create a personal access token](https://docs.patchmypc.com/patch-my-pc-cloud-api/create-a-personal-access-token.md).

## Get help offline

The help on these pages ships with the module, so `Get-Help` works without an internet connection. For example:

{% code collapsedlinecount="10" %}

```powershell
Get-Help New-PmpcDeployment -Full
Get-Help New-PmpcDeployment -Examples
```

{% endcode %}

## Cmdlets by area

### Session and authentication

| Cmdlet                                                                                                              | Synopsis                                                               |
| ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| [Connect-PmpcCloudWithPat](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/connect-pmpccloudwithpat.md) | Authenticates using a personal access token.                           |
| [Disconnect-PmpcCloud](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/disconnect-pmpccloud.md)         | Signs out and tears down the module's session.                         |
| [Get-PmpcCloudSession](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/get-pmpccloudsession.md)         | Reports the module's current session state.                            |
| [Test-PmpcCloudHealth](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/test-pmpccloudhealth.md)         | Checks whether the Cloud Customer API responds to a heartbeat request. |
| [Get-PmpcSelectedCompany](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/get-pmpcselectedcompany.md)   | Gets the company the session is currently scoped to.                   |

### Customer and connections

| Cmdlet                                                                                                                  | Synopsis                                                            |
| ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| [Get-PmpcCustomerInfo](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/get-pmpccustomerinfo.md)             | Gets account information and usage limits for the current customer. |
| [Get-PmpcConnection](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/get-pmpcconnection.md)                 | Lists the Intune connections available to the selected company.     |
| [Set-PmpcConnection](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/set-pmpcconnection.md)                 | Selects the Intune connection that deployment commands act on.      |
| [Get-PmpcSelectedConnection](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/get-pmpcselectedconnection.md) | Gets the Intune connection the session is currently scoped to.      |

### Applications

| Cmdlet                                                                                                            | Synopsis                                                       |
| ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| [Find-PmpcApplication](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/find-pmpcapplication.md)       | Searches the Patch My PC public catalog.                       |
| [Get-PmpcApplication](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/get-pmpcapplication.md)         | Gets the details of a single public catalog application.       |
| [Get-PmpcApplicationFile](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/get-pmpcapplicationfile.md) | Lists the files that make up an application's current version. |

### Custom applications

| Cmdlet                                                                                                                      | Synopsis                                             |
| --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| [Find-PmpcCustomApplication](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/find-pmpccustomapplication.md)     | Searches the customer's custom applications catalog. |
| [Get-PmpcCustomApplication](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/get-pmpccustomapplication.md)       | Gets the details of a single custom application.     |
| [New-PmpcCustomApplication](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/new-pmpccustomapplication.md)       | Creates a custom application and uploads its files.  |
| [Update-PmpcCustomApplication](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/update-pmpccustomapplication.md) | Publishes a new version of an existing application.  |
| [Set-PmpcCustomApplication](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/set-pmpccustomapplication.md)       | Edits an application's current version in place.     |
| [Remove-PmpcCustomApplication](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/remove-pmpccustomapplication.md) | Deletes a custom application.                        |
| [New-PmpcDetectionRule](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/new-pmpcdetectionrule.md)               | Builds a detection rule set.                         |
| [New-PmpcFileRule](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/new-pmpcfilerule.md)                         | Builds a file or folder rule.                        |
| [New-PmpcRegistryRule](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/new-pmpcregistryrule.md)                 | Builds a registry rule.                              |
| [New-PmpcScriptRule](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/new-pmpcscriptrule.md)                     | Builds a script rule.                                |
| [New-PmpcRequirement](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/new-pmpcrequirement.md)                   | Builds an application's installation requirements.   |

### Deployments

| Cmdlet                                                                                                                                        | Synopsis                                                             |
| --------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| [Get-PmpcDeployment](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/get-pmpcdeployment.md)                                       | Gets an application's Intune deployments, or one deployment in full. |
| [Get-PmpcDeploymentDependencyCandidate](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/get-pmpcdeploymentdependencycandidate.md) | Lists deployments that can be used as a dependency.                  |
| [New-PmpcDeployment](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/new-pmpcdeployment.md)                                       | Creates an Intune deployment for an application.                     |
| [Set-PmpcDeployment](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/set-pmpcdeployment.md)                                       | Changes an existing Intune deployment.                               |
| [Remove-PmpcDeployment](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/remove-pmpcdeployment.md)                                 | Deletes an Intune deployment.                                        |
| [Restart-PmpcDeployment](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/restart-pmpcdeployment.md)                               | Forces a deployment to be recreated in Intune.                       |
| [Sync-PmpcDeployment](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/sync-pmpcdeployment.md)                                     | Syncs a deployment to its latest pending version.                    |
| [Suspend-PmpcDeployment](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/suspend-pmpcdeployment.md)                               | Pauses a deployment's scheduled sync.                                |
| [Resume-PmpcDeployment](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/resume-pmpcdeployment.md)                                 | Resumes a deployment's scheduled sync.                               |
| [New-PmpcDeploymentAssignment](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/new-pmpcdeploymentassignment.md)                   | Builds an assignment for a deployment.                               |
| [New-PmpcDeploymentConfiguration](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/new-pmpcdeploymentconfiguration.md)             | Builds a deployment's optional configuration block.                  |
| [New-PmpcDeploymentAppInfo](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/new-pmpcdeploymentappinfo.md)                         | Builds the catalogue metadata shown for a deployment.                |
| [New-PmpcDeploymentRequirement](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/new-pmpcdeploymentrequirement.md)                 | Builds a deployment's installation requirements.                     |
| [New-PmpcDeploymentReturnCode](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/new-pmpcdeploymentreturncode.md)                   | Builds one installer exit code and the outcome it maps to.           |

### Deployment templates

| Cmdlet                                                                                                                        | Synopsis                                            |
| ----------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| [Get-PmpcDeploymentTemplate](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/get-pmpcdeploymenttemplate.md)       | Lists deployment templates, or reads one in detail. |
| [New-PmpcDeploymentTemplate](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/new-pmpcdeploymenttemplate.md)       | Creates a deployment template.                      |
| [Set-PmpcDeploymentTemplate](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/set-pmpcdeploymenttemplate.md)       | Replaces the settings on a deployment template.     |
| [Remove-PmpcDeploymentTemplate](https://docs.patchmypc.com/patch-my-pc-cloud-api/powershell/remove-pmpcdeploymenttemplate.md) | Deletes a deployment template.                      |

## Related pages

* [Cross-reference: cmdlets, SDK methods, and REST operations](https://docs.patchmypc.com/patch-my-pc-cloud-api/cross-reference.md)
* [SDK reference](https://docs.patchmypc.com/patch-my-pc-cloud-api/sdk.md)
* [REST API reference](https://docs.patchmypc.com/patch-my-pc-cloud-api/rest-api.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.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.
