Skip to content

Latest commit

 

History

History
173 lines (121 loc) · 8.11 KB

introduction.md

File metadata and controls

173 lines (121 loc) · 8.11 KB
title description keywords ms.author author ms.reviewer ms.date ms.topic
Microsoft Power Platform CLI | Microsoft Docs
Install Microsoft Power Platform CLI to create, debug, and deploy code components by using Power Apps component framework.
Microsoft Power Platform CLI, code components, component framework, CLI
marcsc
devkeydet
jdaly
05/15/2024
overview

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:

Provide feedback

Use github.com/microsoft/powerplatform-build-tools/discussions to view and submit feedback for PAC CLI.

Install Microsoft Power Platform CLI

There are three ways to install the Power Platform CLI. You can use multiple installation methods on the same computer.

Method OS Support Description
Install the Visual Studio Code extension Windows, Linux, macOS Enables use of commands within a PowerShell terminal within Visual Studio Code on Windows 10, Windows 11, Linux, and macOS.

When you install using ONLY this method, by default PAC CLI will only be available within a Visual Studio Code terminal unless you enable PAC CLI in Command Prompt (CMD) and PowerShell terminals for Windows
Install with .NET Tool Windows, Linux, macOS Enables use of commands within a PowerShell, CMD, or Bash shell on Windows 10, Windows 11, Linux, and macOS.

This installation method doesn't enable use of pac data or certain pac package commands (deploy and show) that are only available for Windows.
Install with Windows MSI Windows only Enables use of commands within a PowerShell terminal within Visual Studio Code on Windows only. You can manage installed versions with this installation method.

Note

The following commands are only available on Windows:

To use these commands on Windows, install Power Platform CLI using either (or both) of these installation methods:

These commands aren't available on Windows if you only install using the .NET Tool.

Check whether Power Platform CLI is already installed

How to determine whether the Power Platform CLI is installed depends on your operating system.

  1. Open a PowerShell terminal:

    • If you ONLY installed the Visual Studio Code extension, open a Visual Studio Code Powershell terminal window.
    • If you installed using the .NET Tool, open a Visual Studio Code Powershell terminal OR a Powershell terminal.
  2. Type Get-Command pac | Format-List at the prompt, and press Enter.

The results should look something like this:

Name            : pac.exe
CommandType     : Application
Definition      : C:\Users\you\.dotnet\tools\pac.exe
Extension       : .exe
Path            : C:\Users\you\.dotnet\tools\pac.exe
FileVersionInfo : File:             C:\Users\you\.dotnet\tools\pac.exe
                  InternalName:     pac.dll
                  OriginalFilename: pac.dll
                  FileVersion:      1.29.11
                  FileDescription:  Microsoft Power Platform CLI
                  Product:          Microsoft Power Platform©
                  ProductVersion:   1.29.11+g9e2b163
                  Debug:            False
                  Patched:          False
                  PreRelease:       False
                  PrivateBuild:     False
                  SpecialBuild:     False
                  Language:         Language Neutral

When Power Platform CLI isn't installed, you'll get this error:

Get-Command: The term 'pac' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

To see if Power Platform CLI is installed in Linux or macOS, open the Terminal/Command prompt, type which pac at the prompt, and press Enter.

The results should look something like this:

/home/you/.dotnet/tools/pac

Check which version of Power Platform CLI is installed

Open the command prompt (on Microsoft Windows), or a Terminal session (in Linux), type pac and press Enter.

You should see something like this where the version is on the second line.

Microsoft PowerPlatform CLI
Version: 1.30.3+g0f0e0b9

Manage auth profiles

Most PAC CLI commands require authenticated access to resources. You'll need to create and use auth profiles.

Note

With the Visual Studio Code extension, you can view and manage authentication profiles.

[!INCLUDE auth-intro]

Enable tab completion in PowerShell

Power Platform CLI has a pac complete command similar to the .NET CLI complete command.

When configured using the instructions below, you can type just the beginning of a command and then use the Tab key to complete the input entered.

To add tab completion to PowerShell for the PAC CLI, create or edit the profile stored in the variable $PROFILE. For more information, see How to create your profile and Profiles and execution policy.

Add the following code to your profile:

$scriptblock = {
    param($wordToComplete, $commandAst, $cursorPosition)

    &pac complete -s "$($commandAst.ToString())" | ForEach-Object {
        [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
    }
}

Register-ArgumentCompleter -Native -CommandName pac -ScriptBlock $scriptblock

Other Shells

You can also use this with bash, zsh, fish, and nushell. Instead of dotnet complete use pac complete

US Sovereign cloud availability

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.

Next steps

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

Or view the list of commands in the documentation:

[!div class="nextstepaction"] Microsoft Power Platform CLI Command Groups

See also

Microsoft Power Platform CLI release notes
Microsoft Power Platform CLI Command Groups
Power Apps component framework

[!INCLUDEfooter-include]