How to call a child (powershell) runbook inline from a parent (powershell) runbook in Azure automation?
15:11 15 Apr 2022

In an attempt to create some reusable powershell code I am trying to get the inline invocation of a child runbook to work. I am relatively new to PowerShell and to Azure Automation.

All the attempts I made so far to make an inline call from a parent workbook to a child runbook fail with the following error:

The term './.ps1' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Both runbooks are PowerShell (version 7.1). Both runbooks reside under the same Automation account.

For sake of clarity, I tried to bring it down to its simplest form. Here is the content of the child runbook, named rnbk_test_child.

Write-Output "Hello, this is the child runbook."

The parent runbook also has one single line of code and looks like this:

./rnbk_test_child.ps1

I first published the child runbook before creating and testing the parent runbook. I mainly worked from the information in this article.

powershell azure-automation azure-runbook