We are using the new custom powershell feature and have noticed an issue with it. We currently use this feature to run a command line application we have installed on our servers. The path to this application is stored in a library variable. If I specify the following it will generate an error:
write-host "Run Custom App"
$OctopusParameters[‘ApplicationPath’] /en /f:.\Web.config /s:connectionStrings /force
You must provide a value expression on the right-hand side of the ‘/’ operator.
At \CustomScriptConvention.PostDeploy.ps1:4 char:63
- $OctopusParameters[‘ApplicationPath’] / <<<< en /f:.\Web.config /s:connectionStrings /force
- CategoryInfo : ParserError: ( , ParentContainsErrorRecordException
- FullyQualifiedErrorId : ExpectedValueExpression
PowerShell script returned a non-zero exit code: 1
However if we hard code the path then everything works fine. It looks as though the parser you are using is not interpreting the octopus variable correctly when evaluating the power-shell statement.