0

I am trying to run this PowerShell task on self hosted private Windows build agent.

https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/azure-file-copy-v6?view=azure-pipelines

When I run it I get:

##[error]PowerShell Core (pwsh.exe) is not installed or not found in PATH.

I then try to install PowerShell using this task:

- script: winget install --id Microsoft.PowerShell --source winget
  displayName: 'Install PowerShell'

And then I get:

'winget' is not recognized as an internal or external command, operable program or batch file.

When I run:

- script: echo %PATH%

I see this, which suggests it is installed but perhaps not recognised ?

C:\agent\externals\git\cmd;C:\agent\externals\git\mingw64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Users\AzDevOps\AppData\Local\Microsoft\WindowsApps

Any idea how can I bootstrap my private self hosted build agent in Azure with PowerShell ?

I have been looking at those options but other than the above they seem less suitable for build agents:

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.