Showing posts with label PowerCLI. Show all posts
Showing posts with label PowerCLI. Show all posts

Saturday 17 September 2022

Generating a Canvas App from a Custom Connector (Open API)

Overview: The Power Platform CLI in August was updated and 1 of the new features is the ability to use the CLI command line to generate a Canvas app using an Open API as the data source.

The Power CLI supports the GET and POST endpoints.  Which is normally +85% of the endpoints anyway.  

In this post I walk thru the steps to add books using an Open API and retrieve all the books as well as the new book added.  

Solution

1. I used the free postman API endpoints (2 gets and a post) > Exported the collection

2. In Power Apps > using a Solution > Add a new Custom Connector (tip: I used Automate)> Upload from a Postman Collection > Pass in the Postman collection generated in the last step.   Save the Custom Connection as shown below.  Lastly test the Custom Connector.
3. I used Visual Studio code with the Power Platform Extension
Using the Power Platform CLI, in the terminal run ps> pac to verify the Power Platform extension is available.

// Get the environment you want to work on
ps> pac admin list

// Get the Custom Connector Name or Id you are going to base the Canvas app on
ps> pac connector list --environment a9adbbba-c45d-eac1

// Generate the msapp package
ps> pac canvas create --msapp "C:\Radimaging\BookDemo.msapp" --connector-display-name "BookDemoCN" --environment "a9adbbba-c45d"


4. Import the export Power App.  Select your environment, and create a new Canvas driven Power App.  "Open" has recently changed in the UI.


The app will get created, I had to add the Custom Connector to the App and you are ready to customise

Beware: Custom Connectors and Connection References in Managed Solutions.  It's a good idea to check they work in the deployment pipelines as the rework can be a pain.  

Summary: This is a great way to build an application quickly using the pac create.  It is a bit rough, and needs amending after import on the 3 endpoints I've used but a great start to a new feature. 

Tuesday 27 August 2013

VMware PowerCLI issue using templates to create VMs depending on AD forest level

Problem:  Within my DTAP environment I use VMware vShere v5.01.  Using PowerCLI and a Windows 2008 R2 syspreped template against a Windows 2008 R2 forest level DC, I was creating my VM's in CI and test.  When I got to UAT which needs to join the VM's to the existing enterprise domain, it fails.  The existing domain controller runs at Windows 2003 level.

Work Around: I can manually add login to the VM's and add them to the domain so I know the credentials are correct.  Or manually use PowerCli to join the VM's to the domain.

Resolution: Adjusted the sysprepeped template/OSCustomisation template - network domain user string and then could add the new machine/VM to the domain.


More Info:
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1012314
 

Wednesday 30 January 2013

Useful PowerCli Snippets

Title: Revert to a specific set of snapshots
Description:
  • Ps that accepts a configuration file and the name of the snapshot to revert to. 
  • Xml holds the config values to connect to vSphere. 
  • Add the PowerCli PS add-in.
  • Connect to vSphere
  • Loop thru the VM's and revert to a specific snapshot.

    *****************

Title: Create a snapshot of multiple VM's

 
 
   *****************


Sunday 9 December 2012

Setting up VMs (VMware ESX5)


Overview:  VMware ESXi is a 1st class virtualisation platform and commonly used to host SharePoint VM's.  The post looks at the common tools for managing/setting up my VMware based infrastructure.  I'm certainly not an expert in virtualisation but this is a 101 in setting up VM's.
 
vSphere Client connects to the ESXi server infrastructure and provides a UI management tool.
 
PowerShell with PowerCLI to let you manage your ESX infrastructure using PowerShell. 
My preferred option is to use PowerGUI and user the add the PowerCli add in so I can interact with ESX but I have Intellisense and nice debugging capabilities.   The snippet below shows how to connect to the ESXi server.
Script expanded with more detail.  Really need to loop throu config to create multiple VM's and get their individual settings.
Before running the script ensure you have the OSCustomizationSpec and OS template as you need them to build.
Check the VM is created.
Summary:  Useful scripts for building a unique set of VM's on VMware.  For Continuous Integration it is better to start with pre-build environments.  My next step would be to fire off the SQL Server 2012 builds on 1 or more of these VM's as shown in the SQL Server 2012 slipstreamed install.

Thanks to Wayne Senior for info in this post.