Powershell warning messages in Task log after executing an empty PostDeploy script


I’ve just spent my morning trying to suppress the following warning message so it won’t appear in my deployment Task Log:

WARNING: Some imported command names contain one or more of the following
restricted characters:

, ( ) {{ }} [ ] & - / \ $ ^ ; : " ’ < > | ? @ ` * % +

= ~

After appending the -DisableNameChecking flag on each my import-module calls, I was still getting the warning. So, on a hunch, I replaced my whole PostDeploy.ps1 script with a single variable declaration. I still get the warnings.

I think these are a result of Octopus doing some importing behind the scenes and no changes to my own script will suppress them. Is there a configuration option to have Octopus suppress these? I’d rather not have unavoidable Octopus red-herrings in our logs.



Thanks for getting in touch! Couple of questions to help with the troubleshooting:

  • What version of Octopus are you running?
  • If you do not import any module on your pre, post or deploy.ps1, do you still get this error message?
  • Are you using any script modules from Library -> Script modules on your project?
  • Could you please send the raw log of the deployment where you saw these warnings? http://docs.octopusdeploy.com/display/OD/Get+the+raw+output+from+a+task



Hi Dalmiro,

  • we’re on
  • we only have a postdeploy script. No pre or deploy. When this postdeploy is empty, we still get the warnings.
  • no script modules are used in the project (and the process consists of one “Deploy a NuGet package” step)
  • log attached (where PostDeploy.ps1 is an empty file)

Thanks for your attention. Looking forward to your analysis.

ServerTasks-4540.log.txt (7 KB)


Thanks for sending the logs. If this warning shows up even if the PostDeploy script is empty, then it must be a module that’s installed on the tentacle box that’s being imported when octopus opens a powershell session.

Could you please add a Powershell Step to your deployment process and just have it run write-host "Hello from Powershell step" . If the warning shows up even in that case, then that’ll prove my theory.



Hi Dalmiro,

Great test idea, I should’ve tried that already.

You were right. I actually did have script modules in my process. For whatever reason, I had step templates and script modules mixed up. A while ago, I was testing the idea of using the Octopus API during the deployment process but eventually decided against it. I left the script module references in and forgot about them.

I actually got so far as testing two projects with identical steps and an identical nuget package before a colleague pointed out that one showed script modules and the other didn’t! Another case of selective blindness.

Thanks for your help (and your patience!)

No problem! Glad I could help.

If you need any help with the Octopus API, just let us know here and we’ll give you a hand.