Reputation: 41
Scenario:
I have 2 runbooks, runbook A and runbook B.
Inside runbook B, I want to load runbook A into memory.
Running below doesn't work, can someone help me out please?
.\runbookb.ps1
. ./runbookb.ps1
Upvotes: 1
Views: 1369
Reputation: 1664
Assuming that you want to invoke runbook B from runbook A, first of all please make sure runbook B exists in your Automation Account and is published. Then, depending on the runbook type, you need to use different syntax:
./runbookb.ps1
or . ./runbookb.ps1
(depending on whether you want the "dot-sourcing" behavior or not)runbookb
If you really want to load the runbook content into memory, this is different:
Get-Content ./runbookb.ps1
Upvotes: 2