Issue Running Tentacle under user with Dollar sign($) as leading character

I’m trying to run a tentacle under a domain service account, but our corporate policy is that all domain service accounts start with a dollar sign. When trying to execute a step, it appears that the tentacle might be mistaking the user for a variable and trying to replace it when figuring out the path to a temporary powershell script. Since it is not a variable, the username is simply removed from the path creating an invalid path. Any help would be appreciated - here is the error reported by the tentacle. It is running under user $OctoDeploy:

The term ‘C:\Users\AppData\Local\Tentacle\Temp\7482e2b3-87f3-4ff4-a1a7-6312efe334cc.ps1’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users$OctoDeploy\AppData\Local\Tentacle\Temp\Bootstrap.e5ee28d0-d374-4b4b-ace4-4fae66c0b6fb.ps1:1638 char:2

  • . <<<< “C:\Users$OctoDeploy\AppData\Local\Tentacle\Temp\7482e2b3-87f3-4ff4-a1a7-6312efe334cc.ps1”
  • CategoryInfo : ObjectNotFound: (C:\Users\AppDa…312efe334cc.p s1:String) [], ParentContainsErrorRecordException
  • FullyQualifiedErrorId : CommandNotFoundException
    ============================================== PowerShell exit code: 1 ==============================================
    Fatal 14:59:41
    PowerShell script returned a non-zero exit code: 1 Tentacle version 2.5.8.447

Hi Dave,

Thanks for getting in touch! PowerShell is evaluating the $. We are going to look at fixing this as part of our 2.6 build.
https://github.com/OctopusDeploy/Issues/issues/1347 You can track the issue here.
Currently there are no workarounds apart from removing the $ temporarily.

Thanks!
Vanessa

Wonderful - thanks Vanessa. I did find a workaround in the meantime. I created an actual Variable OctoDeploy whose value is $OctoDeploy.

Voila. Resolves correctly and script runs. =)

Hi Dave,

Yeah we figured this might work (we were 80% sure), I just hadn’t had a chance to update the thread, but you figured it out so that’s great :slight_smile:
Proper fix coming in 2.6

Vanessa