Octopus Deploy seems to ignore '-WarningAction SilentlyContinue' in a script step

I have a script step configured where I use Test-NetConnection to validate that a server is alive before doing some work.

No matter what I do, this line will ALWAYS present a warning in the deploy log if the server is unreachable/unpingable:

$serverState = Test-NetConnection -ComputerName $tentacle -Port $listeningPort -WarningAction SilentlyContinue

When I run this script on the ODServer host in normal Powershell, the command works fine, no output, other than what I’m looking for.

Is there something I can do to make Octopus Deploy respect my -WarningAction SilentlyContinue?

Hi Michael,

I notice the same behaviour: -WarningAction SilentlyContinue does not suppress warnings in Octopus. I have created a new ticket which you can track and contribute to: https://github.com/OctopusDeploy/Issues/issues/3736