What is Microsoft Power Platform CLI?

Microsoft Power Platform CLI is a simple, one-stop developer CLI that empowers developers and ISVs to perform various operations in Microsoft Power Platform related to environment lifecycle, authentication, and work with Microsoft Dataverse environments, solution packages, portals, code components, and so on.

Microsoft Power Platform CLI is available for use in the GCC and GCC High (US Sovereign cloud) regions. Use the command pac auth create for help on the --cloud parameter to find out about supported US Sovereign cloud environments.

Install Microsoft Power Platform CLI

You can use either of the following ways to install Microsoft Power Platform CLI.

Power Platform CLI for Windows

To install Power Platform CLI for Windows, follow these steps.

  1. Download and install Microsoft Power Platform CLI.

  2. To take advantage of all the latest capabilities, update Microsoft Power Platform CLI tooling to the latest version by using this command (not applicable for Power Platform Tools for Visual Studio Code):

    pac install latest
    

    Note

    • Currently, Microsoft Power Platform CLI for Windows is supported only on Windows 10 and Windows 11.
    • Power Platform Tools for Visual Studio Code supports Windows 10, Windows 11, Linux, and MacOS.

Using Power Platform Tools for Visual Studio Code

Follow these steps to install Microsoft Power Platform CLI using Visual Studio Code.

  1. Open Visual Studio Code.

  2. Select the Extensions icon from the Activity panel. In the search bar, enter Power Platform Tools.

  3. Select Install. Once the installation is finished, restart Visual Studio Code to see the extension within the Terminal window.

    VS code extension install.

    Note

    Power Platform Tools for Visual Studio Code updates automatically.

  4. Optionally, you can initiate the install into Visual Studio Code directly from Marketplace and it will launch Visual Studio Code and commence the extension installation.

    Launch install from Marketplace.

You can also do a side-load install into Visual Studio Code by downloading the extension from the Marketplace.

Side-load install of Power Platform Tools for Visual Studio Code

In some organizations, downloading or initiating an install over the web is prohibited. Most cases, the organization download the installation media and stores it in a secure location and verify that it is working according to their standards, before it is distributed within the organization. To support this paradigm of installation, you can go to the Marketplace and instead of pressing the install button, press the download extension.

Download the extension.

This is will download a file with a .vsix extension on to your workstation.

Extension file downloaded.

Launch Visual Studio Code and select the Extensions icon, select the ellipsis on the Extensions side bar, and then select Install from VSIX.

Initiate install with the downloaded file.

Standalone Power Platform CLI

To install standalone Power Platform CLI:

  1. Download and install Microsoft Power Platform CLI.

  2. To take advantage of all the latest capabilities, update Microsoft Power Platform CLI tooling to the latest version by using this command (not applicable for Power Platform VS Code Extension):

    pac install latest
    
    

Note

  • Currently, Microsoft Power Platform CLI is supported only on Windows 10 and Windows 11.
  • Power Platform Tools for Visual Studio Code, and works on Windows 10, Windows 11, Linux, and macOS.

Successful installation

Once the installation is successful, you will need to restart Visual Studio Code, upon which you will see the following notification.

Install notification

On the Activity bar. you'll notice the icon for the Power Platform Tools.

Power Platform Tools icon

The final check would be to launch the terminal window and type pac.

Power Platform Command line in the Terminal window

Common commands

This table lists some of the common commands used in the CLI.

Command Description
Admin Commands for environment lifecycle features.
Auth Commands to connect to your environment.
Application Commands to install AppSource applications that are pre-requisites for the solution work in the target environment (Preview).
Canvas Commands for working with canvas app source files (Preview).
Org Commands for working with Dataverse environments.
Package Commands for working with solution packages.
Paportal Commands for working with Portals support for Microsoft Power Platform CLI.
PCF Commands for working with Power Apps component framework.
Plugin Command to create a plug-in project.
Solution Commands for working with Dataverse solution projects.
Telemetry Manages the telemetry settings.

Tip

For the complete list of supported commands, run the pac command or pac <subcommand> - for example: pac solution.

Uninstall Microsoft Power Platform CLI

To uninstall Microsoft Power Platform CLI tooling, run the MSI from https://aka.ms/PowerAppsCLI.

To uninstall the Visual Studio Code extension, follow the same steps as installing the extension, except this time select the Uninstall button.

If you're a private preview participant and have an older version of CLI, follow these steps:

  1. To find out where Microsoft Power Platform CLI is installed, open a command prompt and enter where pac.
  2. Delete the PowerAppsCLI folder.
  3. Open the Environment Variables tool by running the command rundll32 sysdm.cpl,EditEnvironmentVariables in the command prompt.
  4. In the User variable for... section, double-click to select Path .
  5. Select the row containing the PowerAppsCLI path, and then select Delete on the right side.
  6. Select OK twice.

See also

Power Apps component framework