How to import local modules into your automation service by command line.
Hy everyone, how are u? Bringing a cool tip for those who use the automation service available in Azure (Azure Automation). The import process via the graphical interface is intuitive and helps a lot when there is not much intimacy with the command line, but it becomes somewhat repetitive if you need to search for various modules and perform an import.
Sometimes, when we are developing some automation, we carry out local tests. And, often, it uses modules to help the tasks. If for some reason you have module numbers, how do you put that list in your automation account? I will demonstrate how to execute the process in the script below:
⚠ When do you use the first script you can receive an error because the import-module on Azure Automation has a limited number of jobs simultaneously.
After all modules are finished importing, we can use them in our PowerShell runbooks, without any problem of failing due to lack of any reference.
That's it, folks. Don't forget, PWSH + Azure Automation is life
Top comments (0)