'PowerShell - Azure Automation runbook skips Process script block
Below I have a sample script that when I run locally from my computer, it works fine. When I run it through Azure Automation, it skips the Process script block. I think it has something to do with pipelining, but I'm not sure how I would configure that to work, I've used the begin-process-end block purely for organizational purposes.
[CmdletBinding()]
param (
[parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string] $AppName
)
begin
{
Write-Output "Begin Block Start"
}
process
{
Write-Output "Process Block Start"
}
end
{
Write-Output "End Block Start"
}
Run locally output
Begin Block Start
Process Block Start
End Block Start
Run from Azure Automation output
Begin Block Start
End Block Start
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
