Custom deployment script powershell variable evaluating incorrectly

(josh.williams) #1

We have a package deploy step, that contains a windows service utilizing

His Service doesn’t jive too well with Octopus, but we’ve traditionally been able to just use custom deployment scripts. But now the Octopus.Environment.Name substitution is not working.

Here is the deployment script portion
./LENSSX.StateHost.exe display-name:State_Host_$OctopusParameters[“Octopus.Environment.Name”] name:State_Host_$OctopusParameters[“Octopus.Environment.Name”] action:install

This names and installs the service. But $OctopusParamters[“Octopus.Environment.Name”] is evaluating to this:

Successfully registered and started service “LENSS_State_Host_System.Collections.Generic.Dictionary`2[System.String,System.String][Octopus.Environment.Name]” (“This application that is responsible for communicating with the state hosted databases”)

Any ideas why this may be?

WIndows Server version 2008 R2 Datacenter. Octopus 4.

(josh.williams) #2

The solution was to wrap the param in $() …

(Matt Richardson) #4

Hi Josh

Glad to see you’ve got it resolved - PowerShell string interpolation can be a pain sometimes.

Happy deployments!