---
schema_version: "1"
id: 87b123d33e494346611d72981285265233c9cf7b7372f0ffa5f8394b7c7d77c5
title: Microsoft Windows PowerShell Connector
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/windows-powershell-connector/latest/index.md
canonical_url: https://docs.mulesoft.com/windows-powershell-connector/latest/
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 662e012d367aa073a11a1b2cf155005c737c827a01b9b3457349c45d9cedeb71
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

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

Microsoft Windows PowerShell Connector Version 2.1

Anypoint Connector for Microsoft Windows PowerShell (PowerShell Connector) enables you to integrate
Windows administration tasks into Mule applications. PowerShell Connector enables you to connect to
any machine, local or remote, to execute script files and commands on those machines. You can use
SSH to execute PowerShell scripts on a remote Windows or Linux (Ubuntu) machine and have the result
processed within Mule runtime engine (Mule).

> [!NOTE] The connector does not support executing a PowerShell script on a MacOS computer.

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).

## Before You Begin

To use this connector, you must be familiar with:

- Anypoint Connectors

- Mule runtime engine (Mule)

- Elements in a Mule flow

- Global elements

- How to create a Mule app using Anypoint Studio

To work with PowerShell Connector, you must first install an SSH server on a Windows or Linux
(Ubuntu) remote machine:

- Windows

  1.  Download [OpenSSH for Win32 or Win64](https://github.com/PowerShell/Win32-OpenSSH/releases).

  2.  Follow the
      [OpenSSH installation steps](https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH).

- Linux (Ubuntu)

  1.  Follow the [SSH installation steps](https://ubuntu.com/server/docs/).

  2.  Follow
      [install PowerShell on Linux](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-6)
      from Microsoft.

## Add a POM File Dependency

```xml
<dependency>
  <groupId>com.mulesoft.connectors</groupId>
  <artifactId>mule-powershell-connector</artifactId>
  <version>x.x.x</version>
  <classifier>mule-plugin</classifier>
</dependency>
```

Verify that the connector `version` corresponds to the one you are using.

To obtain the most up-to-date `pom.xml` file information:

1.  Go to [Anypoint Exchange](https://www.mulesoft.com/exchange/).

2.  In Exchange, click **Login** and supply your Anypoint Platform username and password.

3.  In Exchange, search for `hdfs`.

4.  Click **Dependency Snippets**.

## Add the Connector in Studio

Add PowerShell Connector to a Mule project to automatically populate the XML code with the
connector’s namespace and schema location, as well as add the required dependencies to the project’s
`pom.xml` file.

1.  In Anypoint Studio, from the main menu, select **File > New > Mule Project**.

2.  Enter a name for your Mule project, and click **Finish**.

3.  In the **Mule Palette** view, click **(X) Search in Exchange**.

4.  In **Add Modules to Project**, type `powershell` in the search field.

5.  Click the name of the connector in **Available modules**.

6.  Click **Add**.

7.  Click **Finish**.

Adding a connector to a Mule project in Studio does not make that same connector available to other
projects in your Studio workspace.

### Configure a Global Element in Studio

1.  In Studio, click the **Global Elements** tab at the bottom of the canvas.

2.  In the **Global Configuration Elements** screen, click **Create**:

    ![Choose Global Type window with list of configurations](/mulesoft/current/en-us/windows-powershell-connector/latest/_images/microsoft-powershell-config-global-wizard.png)

3.  In the **Choose Global Type** wizard, expand **Connector Configuration**, select either
    **Windows Configuration** or **Linux Configuration**, and click **OK**.

    This selection enables you to connect remotely to the type of operating system that you choose.

4.  Configure the parameters as follows:

    <table><colgroup><col> <col></colgroup><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td><p><strong>Connection</strong></p></td><td><div><div><p>Connection type: Windows or Linux</p></div></div></td></tr><tr><td><p><strong>IP Address</strong></p></td><td><div><div><p>IP address of the machine on which you want to execute the script file or command</p></div></div></td></tr><tr><td><p><strong>Username</strong></p></td><td><div><div><p>User associated with the Windows or Linux machine</p></div></div></td></tr><tr><td><p><strong>Password</strong></p></td><td><div><div><p>Password associated with the user name</p></div></div></td></tr></tbody></table>

    In the previous image, the placeholder values refer to a configuration file
    `mule-artifact.properties` placed in the `src/main/resources` folder of your project.  
    You can enter your credentials in the global configuration properties, or you can reference a
    configuration file that contains those values.

    To simplify maintenance and improve project reusability, of your project, use a configuration
    file. Keeping these values in a separate file is useful if you need to deploy to different
    environments, such as production, development, and QA, where your access credentials differ.

    See
    [Anypoint Connector Configuration](https://docs.mulesoft.com/connectors/introduction/intro-connector-configuration-overview)
    for more information.

5.  Keep the **Advanced** tab default values.

6.  Click **Test Connection**.

7.  Click **OK**.

8.  Your configuration should look like this:

    ![Global element properties window with Windows configuration](/mulesoft/current/en-us/windows-powershell-connector/latest/_images/microsoft-powershell-config.png)

## Next Step

After you configure the PowerShell Connector, see the
[Examples](https://docs.mulesoft.com/windows-powershell-connector/latest/microsoft-powershell-connector-examples) topic for more configuration information.

## See Also

- [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)

- [Anypoint Connector Configuration](https://docs.mulesoft.com/connectors/introduction/intro-connector-configuration-overview)

- [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio)

- [Microsoft Windows PowerShell Connector](https://www.mulesoft.com/exchange/com.mulesoft.connectors/mule-powershell-connector/)

- [OpenSSH for Windows](https://github.com/PowerShell/Win32-OpenSSH/releases#)

- [OpenSSH installation steps](https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH)

- [Linux install SSH](https://documentation.ubuntu.com/server/)

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