powershell on Ubuntu Server 18.4.2 not recognized

I'm trying to set Teamcity build numbers based on git and some other stuff and found that a powershell script is supposed to be the way to go.

However the linux build agent is not considered compatible: Unmet requirements: powershell_Core_x64 exists

The agent has been installed via agent push from a dockerized Teamcity 2019.1 server.

Its OS is Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-55-generic x86_64).

(I tried setting the Platform to x64 and Edition to Core since some posts seemed to sugges that may help in linux, but it just breaks the config for the windows agents. So <Auto> and <Any> dont work either for me.)

Teamcity sees it like that:

Status

  • Connected since 25 Jul 19 14:51, last communication date 29 Jul 19 17:42
  • Authorized on 23 Jul 19 16:06 by Holly     Unauthorize agent
    Enabled     Disable agent    

Details

  • Agent name: Agent 3
  • Hostname: tcbuildagent3.office.our-domain.com 
  • IP: 192.168.1.224
  • Port: 9090
  • Communication protocol: unidirectional 
  • Operating system: Linux, version 4.15.0-55-generic
  • CPU rank: 666
  • Pool: Default
  • Version: 66192

On the comand line of the agent it looks like that:

teamcity@tc-agent3:~$ powershell
PowerShell 6.2.2
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

PS /home/teamcity> get-host

Name : ConsoleHost
Version : 6.2.2
InstanceId : 8c45f3dc-6166-4ff7-9d06-dde32066457f
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace

So powershell is installed and yet teamcity does not seem to see it. From what I could find there was a problem with detecting powershell core on linux in the past but that should no longer be a problem.

Any ideas what could cause the problem?

How does teamcity determine that powershell_Core_x64 exists?

1 comment
Comment actions Permalink

Hi Holly, 

you can enable the debug logging on an agent and restart it to get more details about tools detection on an agent start. BTW, have you restarted the agent after you've installed PowerShell on the machine?

Could you please also tell me how did you install PowerShell? I'm asking because you have PowerShell version 6+ and in this version, `powershell` command was renamed to `pwsh`. 

0

Please sign in to leave a comment.