Suppress Disable-AzureRMContextAutosave warning and Intelligent feature recommendation

Hi Guys,

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.

“The command Disable-AzureRMContextAutosave is in the AzureRM PowerShell module, which is outdated. See Migrate Azure PowerShell scripts from AzureRM to Az | Microsoft Learn for instructions to migrate to Az”

“The intelligent recommendation feature is in preview. Help us improve it by sharing your experience: Discussions · Azure/azure-powershell · GitHub

Thank you


Hi Clemence,
Welcome to the Octopus Help forum!

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.

Kind regards,

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.


This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.