microsoft / azure-pipelines-agent

Azure Pipelines Agent 🚀
MIT License
1.7k stars 856 forks source link

[enhancement]: Extensions with Powershell Core execution handler #4386

Open ckrueger1979 opened 11 months ago

ckrueger1979 commented 11 months ago

Describe your feature request here

Hi,

it would be great if a powershell core (pwsh) execution handler for extensions would be available.

If you have currently a powershell extension it's not easy to make it platform independant because you have to rewrite the extension completly in Typescript. Going from powershell 5 to powershell core is relativly easy.

Maintenance on Typescript extensions is much higher. There is a huge dependancy tree that has to be updated for security reasons regularly and there are much more breaking changes in the Node world then in the Powershell world.

greetings Carsten

kirill-ivlev commented 10 months ago

Hi @ckrueger1979, thanks for reporting! We are working on more prioritized issues at the moment but will get back to this one soon.

geekzter commented 10 months ago

@ckrueger1979 thanks for the suggestion. We are considering various options for new execution handlers, and this is one of them.

jessehouwing commented 8 months ago

@geekzter browsing through the code, it doesn't look hard to add this feature on the agent. Should be like 2 files to implement, possibly a bit more if we were to add proper linux support.

On top of that the VstsTaskSdk would need to be ported. Most of the tasklib would be simple, the bits that do Authentication and load the object model would be more work.

What are the reasons for not adding it? Last time I asked, years ago, it was to not have to add to the maintenance burden. But looking at the code the PowerShell and PowerShell3 handler have been stable and haven't had any major work done on them since forever. The VstsTaskSdk has been very stable as well.

MJECloud commented 4 months ago

@geekzter @kirill-ivlev is there any update on this?

I think that this is a much needed feature. Updating all my tasks to use PowerShell7 is a pain. It's more complex to rewrite everything in TypeScript just to call pwsh.exe. Having a PowerShell7 Handler would make things more easier and faster. 😊