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
- Microsoft Dataverse environments
- Solution packages
- Portals
- Code components
- and more.
Microsoft Power Platform CLI is available for use in the GCC and GCC High (US Sovereign cloud) regions. See the --cloud
parameter for the pac auth create command to find out about supported US Sovereign cloud environments.
Install Microsoft Power Platform CLI
You can install Microsoft Power Platform CLI using either or both of the following methods:
Installation Method | Description |
---|---|
Install using Power Platform Tools for Visual Studio Code | Enables use of commands within a PowerShell terminal within Visual Studio Code on Windows 10, Windows 11, Linux, and macOS. |
Install Power Platform CLI for Windows | Enables use of commands using PowerShell for Windows 10 and Windows 11. Certain commands, such as pac data, are only available using Power Platform CLI for Windows |
Install using Power Platform Tools for Visual Studio Code
Follow these steps to install Microsoft Power Platform CLI using Visual Studio Code.
Open Visual Studio Code.
Select the Extensions icon from the Activity panel. In the search bar, enter Power Platform Tools.
Select Install. Once the installation is finished, restart Visual Studio Code to see the extension within the Terminal window.
Note
Power Platform Tools for Visual Studio Code updates automatically.
Optionally, you can initiate the install into Visual Studio Code directly from Marketplace and it launches Visual Studio Code and commence the extension installation.
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 downloads the installation media and stores it in a secure location and verify that it's working according to their standards, before it's distributed within the organization. Use the following instructions to support this type of installation.
Go to the Marketplace and instead of pressing the Install button, select the Download Extension link under Resources:
Clicking this link downloads a file with a .vsix extension on to your workstation.
Launch Visual Studio Code and select the Extensions icon, select the ellipsis on the Extensions side bar, and then select Install from VSIX.
Successful installation
Once the installation is successful, you need to restart Visual Studio Code, upon which you see the following notification.
On the Activity bar. you notice the icon for the Power Platform Tools.
The final check would be to launch the terminal window and type pac
.
Uninstall Power Platform Tools for Visual Studio Code
To uninstall Power Platform Tools for Visual Studio Code, follow the same steps as installing the extension, except this time select the Uninstall button.
Install Power Platform CLI for Windows
To install Power Platform CLI for Windows, you can either install via DotNet tool or .msi.
To install via DotNet tool, you must have .NET installed (.NET 6.0 recommended). Install Power Platform CLI by using this command:
dotnet tool install --global Microsoft.PowerApps.CLI.Tool
To install via .msi download and run the .msi file found here: Microsoft Power Platform CLI, choose the Install option.
Update Power Platform CLI for Windows/MacOS/Linux
To take advantage of all the latest capabilities, update Microsoft Power Platform CLI tooling to the latest version by using this command:
pac install latest
To update via DotNet tool, you must have .NET installed (.NET 6.0 recommended). Update Power Platform CLI by using this command:
dotnet tool update --global Microsoft.PowerApps.CLI.Tool
Note
pac install latest
command is not applicable for Power Platform Tools for Visual Studio Code. It will look for updates and update automatically each time you open Visual Studio Code.
Uninstall Power Platform CLI for Windows
To uninstall Power Platform CLI for Windows, download and run the .msi from Microsoft Power Platform CLI and choose the Remove option.
Install Power Platform CLI for Linux/macOS
To install Power Platform CLI for Linux/macOS using DotNet tool, you must have .NET installed (.NET 6.0 recommended). Install Power Platform CLI by using this command:
dotnet tool install --global Microsoft.PowerApps.CLI.Tool
The default location for a tool's binaries depends on the operating system:
OS | Path |
---|---|
Linux/macOS | $HOME/.dotnet/tools |
Windows | %USERPROFILE%\.dotnet\tools |
This location is added to the user's path when the SDK is first run. So global tools can be invoked from any directory without specifying the tool location.
Tool access is user-specific, not machine global. A global tool is only available to the user that installed the tool.
Common commands
This table lists some of the common commands used in the PAC CLI.
Command | Description |
---|---|
pac admin | Commands for environment lifecycle features. |
pac auth | Commands to connect to your environment. |
pac application | Commands to install AppSource applications that are prerequisites for the solution work in the target environment (Preview). |
pac canvas | Commands for working with canvas app source files (Preview). |
pac org | Commands for working with Dataverse environments. |
pac package | Commands for working with solution packages. |
pac paportal | Commands for working with Portals support for Microsoft Power Platform CLI. |
pac pcf | Commands for working with Power Apps component framework. |
pac plugin | Command to create a plug-in project. |
pac solution | Commands for working with Dataverse solution projects. |
pac telemetry | Manages the telemetry settings. |
Tip
For the complete list of supported commands, see Microsoft Power Platform CLI Command Groups or run the pac
command or pac
<subcommand> - for example: pac solution
.
Provide feedback
Use github.com/microsoft/powerplatform-build-tools/discussions to view and submit feedback for PAC CLI.
See also
Microsoft Power Platform CLI Command Groups
Power Apps component framework
Feedback
Submit and view feedback for