Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Governance and Administ...
Unanswered

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

(0) ShareShare
ReportReport
Posted on by

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?

  • Community Power Platform Member Profile Picture
    on at
    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

  • v-xida-msft Profile Picture
    on at
    Re: Using the PowerShell for PowerApps cmdlets within an Azure Runbook (PowerShell)?

    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
    on at
    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.

  • v-xida-msft Profile Picture
    on at
    Re: Using the PowerShell for PowerApps cmdlets within an Azure Runbook (PowerShell)?

    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

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Power Apps Governance and Administering

#1
bscarlavai33 Profile Picture

bscarlavai33 5 Super User 2025 Season 1

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 4 Super User 2025 Season 1

#3
Vince_K Profile Picture

Vince_K 2

Overall leaderboard

Featured topics