The expected result is that I will not see the error messages and the step will not fail. But alas it does output the error messages and the step fails.
Thanks for reaching out and deep apologies for the late reply.
I brought this one to the team and it left us scratching our heads for a couple of minutes, until we found the reason of the different behavior between cmdlets:
It seems that sometimes Powershell “simply returns an error code” (insert more tech words here), and sometimes it throws full exceptions. The latter is not supported by -ErrorAction and it simply bypasses it (thus Octopus as well). This is the case for this Get-AzureRmVmss cmdlet.
We found that wrapping the cmdlet in a try/catch helps containing the exception at runtime