Microsoft PowerApps CLI

We already had PowerApps PowerShell for a while. Yesterday, the PowerApps CLI was released.

 

Installation Steps

Following the steps on the Microsoft PowerApps CLI page. You will need to install some prerequisites:

To use PowerApps CLI you will need the following:

Installing Node.js

  • Install Npm(comes with Node.js) or install Node.js (comes with npm). We recommend LTS (Long Term Support) version 10.15.3 LTS as it seems to be most stable.

  • If you don’t already have Visual Studio 2017 or later, follow one of the options below:

    • Option 1: Install Visual Studio 2017 or later
    • Option 2: Install .NET Core 2.2 SDK and install Visual Studio Code
  • Install Microsoft PowerApps CLI from here

Installing Microsoft PowerApps CLI

 

Starting the PowerApps CLI

Now you will need to start the Developer Command Prompt for VS 2017

Starting Developer Command Prompt for VS 2017

 

Then within the command prompt you can create a folder. You could do this using explorer if you prefer.

Create a folder

Getting starting with the CLI

Before I create a new component some useful commands:

[code lang=text]
pac help
[/code]

running pac help

This shows you the important bits. Note that you can update the CLI with the install parameter.

Creating a new component

Now to create a new component we can run the following command:

[code lang=text]
pac pcf init –namespace   –name  –template
[/code]

the namespace and the component name are easy, but what are the available templates? The CLI has actually been implemented really well. as you ‘forget’ to supply details you get proper help pages.

create a component with pac init

The template options available are currently field and dataset.

template options

This has now created a component file structure for me.

folder strucure created by pac command

 

Now you will still need to install all the dependencies. To do this run npm install.

npm install

This will now create the node_modules folder with many of the files needed by the project. SharePoint SPFx developers will recognise this kind of structure

updated folder structure

By the way does anybody remember yesterday’s post about Are Microsoft Flow and PowerApps really only for citizen developers?

Are you ready to start developing the custom component?

Load the component in Visual Studio 2017

In my next post I will look at building some custom component.

 

 

Advertisements

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.