0

I installed a .NET global tool in Azure Cloud Shell (dotnet tool install -g). The installation works without reporting any problems.

After the installation the shell can’t find the tool (The term '{toolname}' is not recognized as the name of…).

Restarting the Cloud Shell shows no effect. I can see the tool with ‘dotnet tool list -g’. I can install and use the tool as local tool.

Is this a bug or a Cloud Shell restriction or am I missing something?

Dirk Brockhaus
  • 4,922
  • 3
  • 38
  • 47

1 Answers1

1

To answer my own question:

dotnet-tools doesn’t update the PATH environment variable like it does under Windows. I fixed this by adding the following line to my profile.ps1:

$Env:PATH += ":$HOME/.dotnet/tools"

profile.ps1 is located under $HOME/.config/PowerShell. If this is a new Cloud Shell installation, this file and folder must first be created.

Dirk Brockhaus
  • 4,922
  • 3
  • 38
  • 47