web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Using the PowerShell f...
Power Apps
Unanswered

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

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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?

I have the same question (0)
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    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 Power Platform Member Profile Picture
    Microsoft Employee on at

    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.

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    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 Power Platform Member Profile Picture
    Microsoft Employee on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard