Windows Build agent not registering PowerShell core version

Answered

I have an Windows based agent running version 2017.1.4 (build 47070) of the TC agent and TC server 2017.1.4 (build 47070). My TC agent has both Windows PowerShell version 5.1 installed and PowerShell Core 6.1 installed. When the agent is registered it's not automatically detecting PowerShell core. I'm wondering how I can get the agent to recognize it has PS core installed?

 

[2019-01-25 21:00:27,642]   INFO - dAgentConfigurationInitializer - Loading build agent configuration from C:\buildAgent\conf\buildAgent.properties 
[2019-01-25 21:00:27,664]   INFO - try.RegistryPowerShellDetector - Detecting PowerShell using RegistryPowerShellDetector 
[2019-01-25 21:00:27,779]   INFO - try.RegistryPowerShellDetector - Found: PowerShell Desktop Edition v5.1.14393.0 32 bit(C:\Windows\SysWOW64\WindowsPowerShell\v1.0/powershell.exe) 
[2019-01-25 21:00:27,894]   INFO - try.RegistryPowerShellDetector - Found: PowerShell Desktop Edition v5.1.14393.0 64 bit(C:\Windows\System32\WindowsPowerShell\v1.0/powershell.exe) 
[2019-01-25 21:00:27,934]   INFO - r.mono.MonoPropertiesExtension - HKLM\Software\Novell\Mono\DefaultCLR wasn't found => no mono 
1
4 comments
Avatar
Permanently deleted user

One year later, few version later, still the same issue :(

0

Hi Leszek,

OP reported the issue on 2017.1.4 where the behaviour was expected: https://youtrack.jetbrains.com/issue/TW-58960. The support for PowerShell Core was added in TeamCity 2018.1. What version are you on?

-Anatoly

0
Avatar
Permanently deleted user

Hi Anatoly,

 

TeamCity Professional 2019.2.1 (build 71758)

Agent is on the same machine as TC.

Windows Server 2012 R2 Standard x64

0

Leszek,

The agent not logging the PowerShell Core version, as per the teamcity-agent.log snippet given by the OP, is a known issue. But despite not being logged by RegistryPowerShellDetector, PowerShell Core should work with the Windows agents.

Please describe how exactly you verify that it does not work and provide the following details:

Agent OS version.
Whether the agent runs in a Docker container.
Output of $PSVersionTable.PSVersion PowerShell Core command on the agent.

P.S. At the moment of writing, the latest version of TeamCity is 2019.2.1, please clarify whether you are using it or 2019.1.2.

-Anatoly

0

Please sign in to leave a comment.