Microsoft Windows PowerShell Connector Reference | MuleSoft Documentation
# Microsoft Windows PowerShell Connector Reference
Microsoft Windows PowerShell Connector v2.1
For information about compatibility and fixed issues, see Microsoft Powershell Connector Release Notes
## Configuration
### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
The name for this configuration. Connectors reference the configuration with this name.  
Connection | 
  * Linux Configuration
  * Windows Configuration

| The connection types that can be provided to this configuration.  
Expiration Policy |  ExpirationPolicy | 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.  
## Connection Types
### Linux Configuration
#### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
IPAddress | Host used to initialize the session.  
UserName | Username used to initialize the session. The value for this field, can be, for example: `username` or `username@domain`  
Password | Password used to authenticate the user.  
Reconnection |  Reconnection | 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.  
### Windows Configuration
#### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
IPAddress | Host used to initialize the session.  
UserName | Username used to initialize the session. The value for this field, can be, for example: `username` or `username@domain`  
Password | Password used to authenticate the user.  
Reconnection |  Reconnection | 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  
## Operations
  * Execute Command
  * Execute Script File
  * Execute Command (exception handling enabled)
  * Execute Script File (exception handling enabled)


## Execute Command
`<powershell:execute-command>`
This operation executes the command on the machine.
### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Configuration | The name of the configuration to use.  
The command to execute on the client machine.  
Target Variable | Name of the variable that stores the operation’s output.  
Target Value | Expression that evaluates the operation’s output. The expression outcome is stored in the target variable. | `#[payload]`  
Reconnection Strategy | 
  * reconnect
  * reconnect-forever

| A retry strategy in case of connectivity errors  
### Output
### For Configurations
### Throws
  * POWERSHELL:RETRY_EXHAUSTED
  * POWERSHELL:CONNECTIVITY


## Execute Script File
`<powershell:execute-script-file>`
This operation executes the script file.
### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Configuration | The name of the configuration to use.  
File Content | The file which contains the script. | `#[payload]`  
Parameters | The Parameters for the Script.  
Target Variable | The name of a variable on which the operation’s output is placed.  
Target Value | An expression to evaluate against the operation’s output. The outcome of that expression is stored in the target variable. | ` #[payload]`  
Reconnection Strategy | 
  * reconnect
  * reconnect-forever

| A retry strategy in case of connectivity errors.  
### Output
### For Configurations
### 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
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Configuration | The name of the configuration to use.  
The command to execute on the client machine.  
Target Variable | Name of the variable that stores the operation’s output.  
Target Value | Expression that evaluates the operation’s output. The expression outcome is stored in the target variable. | `#[payload]`  
Reconnection Strategy | 
  * reconnect
  * reconnect-forever

| A retry strategy in case of connectivity errors  
### Output
### For Configurations
### 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
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Configuration | The name of the configuration to use.  
File Content | The file which contains the script. | `#[payload]`  
Parameters | The parameters for the script.  
Target Variable | The name of a variable on which the operation’s output is placed.  
Target Value | An expression to evaluate against the operation’s output. The outcome of that expression is stored in the target variable. | ` #[payload]`  
Reconnection Strategy | 
  * reconnect
  * reconnect-forever

| A retry strategy in case of connectivity errors.  
### Output
### For Configurations
### Throws
  * POWERSHELL:RETRY_EXHAUSTED
  * POWERSHELL:CONNECTIVITY
  * POWERSHELL:EXECUTION_EXCEPTION


## Types
### Reconnection
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Fails Deployment | 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.  
Reconnection Strategy | 
  * reconnect
  * reconnect-forever

| The reconnection strategy to use.  
### Reconnect
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
How often to reconnect (in milliseconds).  
The number of reconnection attempts to make.  
If false, the reconnection strategy runs in a separate, non-blocking thread.  
### Reconnect Forever
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
How often in milliseconds to reconnect.  
If false, the reconnection strategy runs in a separate, non-blocking thread.  
### Expiration Policy
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Max Idle Time | 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.  
Time Unit |  Enumeration, one of:
  * NANOSECONDS
  * MICROSECONDS
  * MILLISECONDS
  * SECONDS
  * MINUTES
  * HOURS

| A time unit that qualifies the maxIdleTime attribute.  
## See Also
MuleSoft Help Center