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

Micheal Schexnayder's Avatar

Micheal Schexnayder

11 Aug, 2017 06:41 PM

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?

  1. Support Staff 1 Posted by Shane Gill on 14 Aug, 2017 09:24 AM

    Shane Gill's Avatar

    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

    Cheers,
    Shane

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac