Azure-pipelines-tasks: Azure PowerShell Task v4 on Windows needs option to run on PowerShell core

Created on 7 May 2019  路  8Comments  路  Source: microsoft/azure-pipelines-tasks

Azure PowerShell Task v4 which is currently in preview runs PowerShell core on any non Windows Image / Agent. On a Windows agent however, it decides on it's own to run Windows PowerShell with no way to overwrite it even though PowerShell Core is installed.

I'd like an option to set Core on Windows for this task (for me it would be the default).

Release enhancement

Most helpful comment

The support of PowerShell core in Windows for task AzurePowerShellV4 is recently added in this week. It will take at least 3-4 weeks to get deployed.

All 8 comments

We are looking into it. will check the feasibility of providing an option to switch to core. We can make PS Core as default in future versions.

Nice, fyi, the PowerShell task already has this capability.

I think this is a must because in the current state this task behaviors completely different on windows and non-windows agent.

This issue just cost me hours of my life. I was trying to run ConvertFrom-Json $appSettings -AsHashtable and it kept complaining about AsHashtable. Turns out that AsHashtable only exists in Powershell Core. :( Switching to non-Windows isn't an option as we still use MSDEPLOY in a subsequent task. I can write my own version of AsHashtable, it's just annoying and confusing to run into a versioning issue.

The support of PowerShell core in Windows for task AzurePowerShellV4 is recently added in this week. It will take at least 3-4 weeks to get deployed.

Great news!

The change has been rolled out, thereby closing the issue.

Was this page helpful?
0 / 5 - 0 ratings