Hello Lihang Jose,
Thank you for posting your query on Microsoft Q&A portal.
PowerShell runbooks in Azure Automation are built on Windows PowerShell. You can write and edit the runbook code directly in the Azure portal using its text editor, or create it offline in any editor and then upload it to Azure Automation.
The PowerShell version used during execution depends on the Runtime Version you select. Azure’s sandbox environment and Hybrid Runbook Workers can run multiple runbooks side by side, even if they target different runtime versions.
- PowerShell 7.4 is currently supported for both cloud and hybrid jobs in all public regions, except Brazil Southeast and government clouds.
- When you choose Runtime Version 7.4, the system uses modules compatible with 7.4. Similarly, selecting Runtime Version 5.1 ensures modules for 5.1 are used.
- Always make sure the modules match the runtime version you select.
Example: If you’re automating SharePoint tasks in a runbook set to Runtime Version 7.4, import the SharePoint module built for 7.4. If the runbook uses Runtime Version 5.1, then import the module for 5.1.
Reference: https://free.blessedness.top/en-us/azure/automation/automation-runbook-types?tabs=lps74%2Cpy10
Kindly let us know if the solution provided worked for you. If you need any further assistance, please feel free to reach out.
If you found the comment helpful, please consider clicking "Upvote it".
Thanks,
Suchitra.