A parameter cannot be found that matches parameter name 'substituteVariables'

In version 2018.3.8, executing a PowerShell script task fails with the following error message:

A parameter cannot be found that matches parameter name ‘substituteVariables’

I noticed the text “-substituteVariables” appended to the command line in the error message

… 20180328200707-68655-1873\tools\set-configs.ps1’ -substituteVariables

This looks like a bad PowerShell script call. I rolled back to 2018.3.6 and the problem corrected itself.

Hi,

Thanks for letting us know. Could you share more about how that step is setup? I’m guessing you are running a script from a package and supplying extra script arguments? If so could you send us a copy of that value you have entered for that?

We’ll try and reproduce in the meantime.

Rob

Hi,

I’ve tried to reproduce it but have had no luck.

Could you send screenshot of that step configuration? Also if you have it the raw log output from that step?

Rob W

I’ll get the raw log in a moment. I tried this again with 2018.3.9 and had the same results. I’m back on 2018.3.6 where it works.

That is correct, we are running a script from a package, but we’re not passing parameters in most cases; we’re simply defaulting to values from $OctopusParameters like so:

[CmdletBinding()]
param (
[string]$DeploymentStepName = $OctopusParameters[“DeploymentStepName”],
[string]$SettingsStepName = $OctopusParameters[“SettingsStepName”],
[string]$CleanInclude = $OctopusParameters[“CleanInclude”],
[string]$CleanIgnore = $OctopusParameters[“CleanIgnore”]
)

Hi,

Ah I see you are using a step template. Could you send me the export of that step template?

You can get the raw log like this.

Rob

I sent the step template. Does it help show you what might be going wrong?

Hi,

Sorry I was away and am not sure anyone got back to you. We fixed this in 2018.3.12 (https://github.com/OctopusDeploy/Issues/issues/4462)

Thanks for your help,

Rob

1 Like

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