I am trying to run this PowerShell task on self hosted private Windows build agent.
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: