Teamcity agent powershell - wrong version
Hi,
we are running under TeamCity 9.1.4
When I've deployed new agent with Windows server 2016 and powershell 5.1, TeamCity showing parameter for the agent powershell_x64 2.0 instead 5.1.
windows agent determine right version
Name Value
---- -----
PSVersion 5.1.14393.693
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.693
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Could you help me solve the issue?
Please sign in to leave a comment.
I already tried reinstall agent without any success.
Hello, we've got the same problem.
The TeamCity Agent uses a plugin to determine the powershell version. But the detector class contains an enum with powershell versions up to 4.0.
So, the detector can not map the powershell version (> 4) from the registry with the enum. After changing (warning, only for test purposes!!!) the registry value (from 5.x) to 4.0 the agent detected the powershell version 4.0...
But:
Meanwhile the support answered to our problem that they recommend to upgrade to the latest TeamCity version, where we get support for the recent PowerShell versions...
I think this means that there will be no fix for older versions....
Hi,
yes you have definitely true, but we have discovered that class in our version TC contains enum with ps version up to 5.0. So we have changed registry value from 5.1 to 5.0 and it seems working :)
Thanks for help.
/Vladimir