Can I use PowerShell script with Functions in Azure Devops "Powershell@2" task?

curious7 276 Reputation points
2023-12-11T11:55:16.7533333+00:00

I have a powershell script that includes functions defined in it. When I run it manually the script works fine and reference to the functions works fine.

But when I when I run it inside Azure Devops pipeline "Powershell@2" task, the script gets stuck at the point where first function is referenced and just hangs.

Is there a particular way I need to call functions in this script?

Community Center | Not monitored
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.