import-pnponline error in azure automation runbook

Adri 0 Reputation points
2025-05-13T10:46:12.0066667+00:00

Hi,

I am new with Azure automations.

I have created one runbook in an azure automation account. The runbook is using PowerShell 7.2.

I have added the pnp module from the "Browse Gallery". Set it for PowerShell 7.2.

When running a simple import-pnponline command I get the following error:

"The version of PowerShell on this computer is '7.2.0'. The module 'C:\usr\src\PSModules\PnP.PowerShell\PnP.PowerShell.psd1' requires a minimum PowerShell version of '7.4.6' to run. Verify that you have the minimum required version of PowerShell installed, and then try again."

Why is this module in the library if can not be used in Azure automation?

How do I get around this?#

Thanks,

Adrian

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,368 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.