cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SGiles123
Level: Powered On

Using the PowerShell for PowerApps cmdlets within an Azure Runbook (PowerShell)?

HI,

I would like to create an Azure Runbook (PowerShell) using some of the PowerShell for PowerApps cmdlets.

 

Todo this I need to manually add the Module to the Azure Automation Account.  When trying to import the zip folder of files (https://docs.microsoft.com/en-us/powerapps/administrator/powerapps-powershell#installation) i get a "Importing of module failed" message with an error of:

 

Error importing the module PowerAppsCmdlets-V5. Import failed with the following error: Orchestrator.Shared.AsyncModuleImport.ModuleImportException: Cannot import the module of name PowerAppsCmdlets-V5, as the module structure was invalid.

 

Is this possible?

4 REPLIES 4
Community Support Team
Community Support Team

Re: Using the PowerShell for PowerApps cmdlets within an Azure Runbook (PowerShell)?

Hi @SGiles123,

Could you please share more details about the error message on your side?

Further, could you please share a bit more about the PowerApps cmdlets you used within your PowerShell window?

I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:4.JPG

 

5.JPG

Please take a try to use the following PowerApps cmdlets to import PowerApps module within your PowerShell window:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
dir . | Unblock-File
Import-Module .\Microsoft.PowerApps.Administration.PowerShell.psm1 -Force
Import-Module .\Microsoft.PowerApps.PowerShell.psm1 -Force
Add-PowerAppsAccount

Please check and see if the following blog would help in your scenario:

https://powerapps.microsoft.com/en-us/blog/gdpr-admin-powershell-cmdlets/

Note: Please go into the unziped PowerShell script file (download here) firstly, then run your Windows PowerShell as Administrator.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
SGiles123
Level: Powered On

Re: Using the PowerShell for PowerApps cmdlets within an Azure Runbook (PowerShell)?

Thanks for your reply Kris.

 

I have no trouble using the cmdlets and retrieving results using the zipped files on my local machine as you've described..

 

What i'm struggling with is how I now replicate this using code using an Azure Runbook which we will used to automate some admin tasks we have.  I can't find a way of importing the modules needed into the Modules container within the Azure Automation Account which is needed for me to use the cmdlets (https://docs.microsoft.com/en-us/azure/automation/automation-runbook-gallery)

 

The error messages are given when trying to import the Ziped folder into the Modules container.

 

Error importing the module PowerAppsCmdlets-V5. Import failed with the following error: Orchestrator.Shared.AsyncModuleImport.ModuleImportException: Cannot import the module of name PowerAppsCmdlets-V5, as the module structure was invalid.

Community Support Team
Community Support Team

Re: Using the PowerShell for PowerApps cmdlets within an Azure Runbook (PowerShell)?

Hi @SGiles123,

Do you want to import PowerApps cmdlets module into your Azure Runbook?

Based on the error message that you provided, I think there is no way to import PowerApps cmdlets module into a Azure Runbook currently.

If you want to get further help in this issue, please submit an assisted support ticket through the following link:

https://powerapps.microsoft.com/en-us/support/pro/

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
SGiles123
Level: Powered On

Re: Using the PowerShell for PowerApps cmdlets within an Azure Runbook (PowerShell)?

Once again thanks for your reply.

 

The good news is that it looks like MS have published the PowerApps modules into the Modules library on the 4th January.  Excellent timing.

  

Cheers