Is there any way to suppress the following warnings when executing PowerShell scripts. We are running them on PowerShell Core on our worker so it does not seem to be coming from server.
From an Octopus standpoint we really don’t have any control over these warnings directly as PS prints these as part of the output.
However locally on the worker or target you can affect how PS runs by adding command line options or by setting an environment variable. Here are the two ways I have seen it recommended to do this:
This one will set the environment variable:
This one adds the command line option:
I will say, due to PS versions, script type and other environmental factors this may not always work as expected so your mileage may vary.
I will add that we have an open GitHub issue on our backlog to deal with this if you want to subscribe to it:
As I say its on our backlog so I’m not sure when it will get addressed so one of the other two options above may be a faster solution for you.
Do let us know how you get on as others may benefit from the solution if it works for you.
Hi Paraic, thanks for the response. Yeah the initial thought was that we just needed to suppress them which we have done based on the MS docs but it still appears. I have subscribed to the github issue.