Single quote in environment name results in failed scripts

If I create a deployment process that includes custom deployment scripts, and the environment being deployed to has a single quote in the name, the scripts fail:

Deploying package ‘C:\Octopus\Files\MyPackage.2015.7.13.112301.nupkg-85491518-20ea-4e8a-80bc-7ebff7e55922’ to machine 'https://x.y.z.a:10933/'
Deploying package: C:\Octopus\Files\MyPackage.2015.7.13.112301.nupkg-85491518-20ea-4e8a-80bc-7ebff7e55922
Using variables from: C:\Octopus\Work\20150713174117-7\Variables.json
At C:\Octopus\Applications\Mark’s dev environment\MyPackage\2015.7.13.112301
_1\Bootstrap.Octopus.Action.CustomScripts.PreDeploy.ps1:590 char:125

  • … s.PreDeploy.ps1’
  •                ~
    

The string is missing the terminator: '.
+ CategoryInfo : ParserError: (:slight_smile: [], ParseException
+ FullyQualifiedErrorId : TerminatorExpectedAtEndOfString
At C:\Octopus\Applications\Mark’s dev environment\MyPackage\2015.7.13.112301
_1\Bootstrap.Octopus.Action.CustomScripts.Deploy.ps1:598 char:122

  • … ipts.Deploy.ps1’
  •                ~
    

The string is missing the terminator: '.
+ CategoryInfo : ParserError: (:slight_smile: [], ParseException
+ FullyQualifiedErrorId : TerminatorExpectedAtEndOfString
At C:\Octopus\Applications\Mark’s dev environment\MyPackage\2015.7.13.112301
_1\Bootstrap.Octopus.Action.CustomScripts.PostDeploy.ps1:598 char:126

  • … .PostDeploy.ps1’
  •                ~
    

The string is missing the terminator: '.
+ CategoryInfo : ParserError: (:slight_smile: [], ParseException
+ FullyQualifiedErrorId : TerminatorExpectedAtEndOfString

Hi Mark,

Thanks for getting in touch! I was able reproduce this behavior. I’ve logged a github issue so our dev team can check this out
fo
https://github.com/OctopusDeploy/Issues/issues/1710

The single quote is one of those characters that you usually try to avoid when naming stuff. If there is a chance for you to change the name of the environment, i’m sure its gonna be the best in the long run. That said, let’s wait for for our dev’s comment on the ticket.

Thanks,

Dalmiro