---
schema_version: "1"
id: bd7dd2f3606f07a337e2e42422ab43d6defb6d740db2bad2b3420b6813f0ff46
title: Microsoft Windows PowerShell Connector Reference
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/windows-powershell-connector/latest/microsoft-powershell-connector-reference.md
canonical_url: https://docs.mulesoft.com/windows-powershell-connector/latest/microsoft-powershell-connector-reference
source_site: docs.mulesoft.com
content_type: documentation
content_hash: c599020487f41f3a48586ba7c734f88054e4eac22b9cb356eacb687bb08eb165
description: MuleSoft Documentation Site
release: "2.1"
latest: true
---
---
product: Microsoft Windows PowerShell Connector
version: 2.1
is-latest-version: true
---

# Microsoft Windows PowerShell Connector Reference

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Microsoft Windows PowerShell Connector v2.1

For information about compatibility and fixed issues, see
[Microsoft Powershell Connector Release Notes](https://docs.mulesoft.com/release-notes/connector/microsoft-powershell-connector-release-notes-mule-4)

## Configuration

### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Name</p></td><td><p>String</p></td><td><p>The name for this configuration. Connectors reference the configuration with this name.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Connection</p></td><td><div><div><ul><li><p>Linux Configuration</p></li><li><p>Windows Configuration</p></li></ul></div></div></td><td><p>The connection types that can be provided to this configuration.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Expiration Policy</p></td><td><div><div><p>ExpirationPolicy</p></div></div></td><td><p>Configures the minimum amount of time that a dynamic configuration instance can remain idle before the runtime considers it eligible for expiration. This does not mean that the platform expires the instance at the exact moment that it becomes eligible. The runtime purges instances as it sees fit.</p></td><td></td><td></td></tr></tbody></table>

## Connection Types

### Linux Configuration

#### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>IPAddress</p></td><td><div><div><p>String</p></div></div></td><td><p>Host used to initialize the session.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>UserName</p></td><td><div><div><p>String</p></div></div></td><td><p>Username used to initialize the session. The value for this field, can be, for example: <code>username</code> or <code>username@domain</code></p></td><td></td><td><p>x</p></td></tr><tr><td><p>Password</p></td><td><div><div><p>String</p></div></div></td><td><p>Password used to authenticate the user.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Reconnection</p></td><td><div><div><p>Reconnection</p></div></div></td><td><p>When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.</p></td><td></td><td></td></tr></tbody></table>

### Windows Configuration

#### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>IPAddress</p></td><td><div><div><p>String</p></div></div></td><td><p>Host used to initialize the session.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>UserName</p></td><td><div><div><p>String</p></div></div></td><td><p>Username used to initialize the session. The value for this field, can be, for example: <code>username</code> or <code>username@domain</code></p></td><td></td><td><p>x</p></td></tr><tr><td><p>Password</p></td><td><div><div><p>String</p></div></div></td><td><p>Password used to authenticate the user.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Reconnection</p></td><td><div><div><p>Reconnection</p></div></div></td><td><p>When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy</p></td><td></td><td></td></tr></tbody></table>

## Operations

- [Execute Command](#executeCommand)

- [Execute Script File](#executeScriptFile)

- [Execute Command (exception handling enabled)](#executeCommandExceptionHandlingEnabled)

- [Execute Script File (exception handling enabled)](#executeScriptFileExceptionHandlingEnabled)

## Execute Command

`<powershell:execute-command>`

This operation executes the command on the machine.

### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Configuration</p></td><td><p>String</p></td><td><p>The name of the configuration to use.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Command</p></td><td><div><div><p>String</p></div></div></td><td><p>The command to execute on the client machine.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Target Variable</p></td><td><div><div><p>String</p></div></div></td><td><p>Name of the variable that stores the operation’s output.</p></td><td></td><td></td></tr><tr><td><p>Target Value</p></td><td><div><div><p>String</p></div></div></td><td><p>Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.</p></td><td><p><code>#[payload]</code></p></td><td></td></tr><tr><td><p>Reconnection Strategy</p></td><td><div><div><ul><li><p>reconnect</p></li><li><p>reconnect-forever</p></li></ul></div></div></td><td><p>A retry strategy in case of connectivity errors</p></td><td></td><td></td></tr></tbody></table>

### Output

<table><colgroup><col> <col></colgroup><thead><tr><th>Type</th><th>String</th></tr></thead></table>

### For Configurations

- config

### Throws

- POWERSHELL:RETRY\_EXHAUSTED

- POWERSHELL:CONNECTIVITY

## Execute Script File

`<powershell:execute-script-file>`

This operation executes the script file.

### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Configuration</p></td><td><p>String</p></td><td><p>The name of the configuration to use.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>File Content</p></td><td><div><div><p>Binary</p></div></div></td><td><p>The file which contains the script.</p></td><td><p><code>#[payload]</code></p></td><td></td></tr><tr><td><p>Parameters</p></td><td><div><div><p>Object</p></div></div></td><td><p>The Parameters for the Script.</p></td><td></td><td></td></tr><tr><td><p>Target Variable</p></td><td><div><div><p>String</p></div></div></td><td><p>The name of a variable on which the operation’s output is placed.</p></td><td></td><td></td></tr><tr><td><p>Target Value</p></td><td><div><div><p>String</p></div></div></td><td><p>An expression to evaluate against the operation’s output. The outcome of that expression is stored in the target variable.</p></td><td><p>` #[payload]`</p></td><td></td></tr><tr><td><p>Reconnection Strategy</p></td><td><div><div><ul><li><p>reconnect</p></li><li><p>reconnect-forever</p></li></ul></div></div></td><td><p>A retry strategy in case of connectivity errors.</p></td><td></td><td></td></tr></tbody></table>

### Output

<table><colgroup><col> <col></colgroup><thead><tr><th>Type</th><th>String</th></tr></thead></table>

### For Configurations

- config

### Throws

- POWERSHELL:RETRY\_EXHAUSTED

- POWERSHELL:CONNECTIVITY

## Execute Command (exception handling enabled)

`<powershell:execute-command-exception-handling-enabled>`

This operation executes the command on the machine and throws execution related exceptions, if any.

### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Configuration</p></td><td><p>String</p></td><td><p>The name of the configuration to use.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Command</p></td><td><div><div><p>String</p></div></div></td><td><p>The command to execute on the client machine.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Target Variable</p></td><td><div><div><p>String</p></div></div></td><td><p>Name of the variable that stores the operation’s output.</p></td><td></td><td></td></tr><tr><td><p>Target Value</p></td><td><div><div><p>String</p></div></div></td><td><p>Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.</p></td><td><p><code>#[payload]</code></p></td><td></td></tr><tr><td><p>Reconnection Strategy</p></td><td><div><div><ul><li><p>reconnect</p></li><li><p>reconnect-forever</p></li></ul></div></div></td><td><p>A retry strategy in case of connectivity errors</p></td><td></td><td></td></tr></tbody></table>

### Output

<table><colgroup><col> <col></colgroup><thead><tr><th>Type</th><th>String</th></tr></thead></table>

### For Configurations

- config

### Throws

- POWERSHELL:RETRY\_EXHAUSTED

- POWERSHELL:CONNECTIVITY

- POWERSHELL:EXECUTION\_EXCEPTION

## Execute Script File (exception handling enabled)

`<powershell:execute-script-file-exception-handling-enabled>`

This operation executes the script file on the target machine and throws execution related
exceptions, if any.

### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Configuration</p></td><td><p>String</p></td><td><p>The name of the configuration to use.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>File Content</p></td><td><div><div><p>Binary</p></div></div></td><td><p>The file which contains the script.</p></td><td><p><code>#[payload]</code></p></td><td></td></tr><tr><td><p>Parameters</p></td><td><div><div><p>Object</p></div></div></td><td><p>The parameters for the script.</p></td><td></td><td></td></tr><tr><td><p>Target Variable</p></td><td><div><div><p>String</p></div></div></td><td><p>The name of a variable on which the operation’s output is placed.</p></td><td></td><td></td></tr><tr><td><p>Target Value</p></td><td><div><div><p>String</p></div></div></td><td><p>An expression to evaluate against the operation’s output. The outcome of that expression is stored in the target variable.</p></td><td><p>` #[payload]`</p></td><td></td></tr><tr><td><p>Reconnection Strategy</p></td><td><div><div><ul><li><p>reconnect</p></li><li><p>reconnect-forever</p></li></ul></div></div></td><td><p>A retry strategy in case of connectivity errors.</p></td><td></td><td></td></tr></tbody></table>

### Output

<table><colgroup><col> <col></colgroup><thead><tr><th>Type</th><th>String</th></tr></thead></table>

### For Configurations

- config

### Throws

- POWERSHELL:RETRY\_EXHAUSTED

- POWERSHELL:CONNECTIVITY

- POWERSHELL:EXECUTION\_EXCEPTION

## Types

### Reconnection

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Fails Deployment</p></td><td><div><div><p>Boolean</p></div></div></td><td><p>When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.</p></td><td></td><td></td></tr><tr><td><p>Reconnection Strategy</p></td><td><div><div><ul><li><p>reconnect</p></li><li><p>reconnect-forever</p></li></ul></div></div></td><td><p>The reconnection strategy to use.</p></td><td></td><td></td></tr></tbody></table>

### Reconnect

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p><strong>Frequency</strong></p></td><td><div><div><p>Number</p></div></div></td><td><div><div><p>How often to reconnect (in milliseconds).</p></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>Count</strong></p></td><td><div><div><p>Number</p></div></div></td><td><div><div><p>The number of reconnection attempts to make.</p></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>blocking</strong></p></td><td><div><div><p>Boolean</p></div></div></td><td><div><div><p>If false, the reconnection strategy runs in a separate, non-blocking thread.</p></div></div></td><td><div><div><p>true</p></div></div></td><td><div></div></td></tr></tbody></table>

### Reconnect Forever

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p><strong>Frequency</strong></p></td><td><div><div><p>Number</p></div></div></td><td><div><div><p>How often in milliseconds to reconnect.</p></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>blocking</strong></p></td><td><div><div><p>Boolean</p></div></div></td><td><div><div><p>If false, the reconnection strategy runs in a separate, non-blocking thread.</p></div></div></td><td><div><div><p>true</p></div></div></td><td><div></div></td></tr></tbody></table>

### Expiration Policy

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Max Idle Time</p></td><td><div><div><p>Number</p></div></div></td><td><p>A scalar time value for the maximum amount of time a dynamic configuration instance should be allowed to be idle before it’s considered eligible for expiration.</p></td><td></td><td></td></tr><tr><td><p>Time Unit</p></td><td><div><div><p>Enumeration, one of:</p></div><div><ul><li><p>NANOSECONDS</p></li><li><p>MICROSECONDS</p></li><li><p>MILLISECONDS</p></li><li><p>SECONDS</p></li><li><p>MINUTES</p></li><li><p>HOURS</p></li><li><p>DAYS</p></li></ul></div></div></td><td><p>A time unit that qualifies the maxIdleTime attribute.</p></td><td></td><td></td></tr></tbody></table>

## See Also

[Salesforce Help](https://help.salesforce.com)
