In a PowerShell Workflow activity, I can call a native PowerShell script using InlineScript:
workflow test
{
InlineScript
{
.\script.ps1
}
}
But in Azure Automation, the dot-path (at least in my tests) was returning c:\windows\system32
, and the script-as-runbook in Azure Automation did not exist there (or rather, it failed to execute because it could not find the script).
I did a little hunting, and found that when native PS runbooks are executed:
C:\Temp\
I cannot (easily) convert this script to a workflow, and it is used from within other workflow activities. Right now the only way I can make this 'work' is to copy & paste the script into the first InlineScript within a workflow that requires it, which is obviously tedious & annoying from a maintenance perspective.
Presumably, as a workaround, I could use a Hybrid Worker, but that comes with a host of other issues, like ensuring the child runbooks are published there & having to maintain them separately, or AAuto not automatically pushing custom modules from the Automation Account to the worker (though this is planned), etc.
答案 0 :(得分:1)
请参阅https://azure.microsoft.com/en-us/blog/announcing-powershell-script-support-azure-automation-2/:
目前,您只能从PowerShell Runbook调用内联PowerShell Runbook,以及从PowerShell Workflow或Graph Runbook调用PowerShell Workflow或Graph Runbook。这可能在将来发生变化。
它还没有改变:)