TroyHar on Wed, 30 Nov 2016 17:55:19
I have uploaded a custom Module through the Automation interfact in assets, and can execute scripts in the test pane, or published runbooks through the "start" button on the runbook overview. These are regular powershell runbooks, not workflows. When running in the test pane, or through the "start" button on the runbook overview, it works perfectly.
However, when the runbook is linked to a schedule the module does not *always* successfully import. I have 3 runbooks scheduled each morning, and some days 2 of the fail and 1 runs, some days all 3 fail. The module does not contain any special DLLs or depend on any other modules. Again, it works fine when manually executing runbooks but not when scheduled runs occur.
Francis Colgan (MSFT CSG) on Fri, 02 Dec 2016 10:34:58
Adding Feedback received on this:
"Unlink and relink the schedule will likely resolve this. When a schedule is linked it creates a cache of the modules that are used. Unlinking and relinking the schedule should refresh this cache."
Can you try the above and confirm if this helps?
TroyHar on Fri, 02 Dec 2016 13:53:08
This was exactly the issue. Thanks. I must have glossed over where that statement was made.
I would also like to note it is unnecessary to use the "ipmo" call to the script as adding the module as an asset makes the functions available without that call.