Powershell 4.0 gets empty variables

Hi

We have a situation here with a new environment running windows server 2012 R2 and powershell 4.0 and Octopus Deploy 1.6.31723.
The octopus parameters are all empty when running deploy.ps1, it’s just empty strings everywhere.

The deploy scripts are tested and works on 5 other environments, none of those are using powershell 4.0 though, hence my suspicion.

Could this be a powershell 4.0 issue or can something else cause this?
Will upgrading to Octopus 2.x solve this?

Thanks,
Sune

Hi Sune,

We provide a dictionary called $OctopusParameters to your PowerShell script. Could you try iterating over that dictionary and printing the values you get to see if any values are provided?

$OctopusParameters.GetEnumerator() | % { 
    Write-Host "Key: $($_.key)"
    Write-Host "Value: $($_.value)" 
}

Thanks,

Paul

Hej Paul,

At the same time as posting here I also submitted a request to our customers IT-department for a machine with a different powershell version and they have installed powershell 2.0.

Downgrading to powershell 2.0 has solved the problem for us.

I am no longer able to test with powershell 4.0, so whatever the problem was it is gone now.

I just ran the enumerator script and verified that the variables are defined but the values are empty. Is this fixed in 2.4?

Hi Marcus,

Thanks for letting us know the result, this isn’t fixed in 2.4. We’ll take a look into this and try to fix it as a patch. Here’s an issue you can use to track it:

Paul

Marcus, the original report on this thread was for Octopus 1.6 - are you also running that version, or have you reproduced this on a 2.x Tentacle?

Thanks for the help,
Nick

We were running 2.3 at the time.

Hi everyone,

We’ve been unable to reproduce this issue so far - which suggests some environmental condition (e.g. the identity of the running account, patch level, locale/codepage, …?) is at play here.

Does anyone have a running instance in which the issue is still exhibited? If so would it be possible to spend a few minutes screen sharing via Skype? We have an online conf call scheduling page here: https://octopusdeploy.acuityscheduling.com/schedule.php

Any help much appreciated,
Nick