title: How can I set the preferred powershell version in an Azure Devops Pipeline Task?
body: <p>I have a Azure Devops Pipeline $PIPELINE with a task group $TASKGROUP, and one of the actions in that task group is a powershell task $TASK ( a <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/powershell?view=azure-devops" rel="nofollow noreferrer">powershell task</a>, not a AzureCloudPowerShellDeployment task or AzurePowershell task, which are different and have answers to this question)</p>
  
  <p>I'd like to run the task under powershell 5.1 because of some features in the script I'm running require it (mainly $PSEdition, which some of the script's module dependencies expect). However, there doesn't seem to be any way to force a specific version of powershell</p>
  
  <p>How can I force the $TASK to run with powershell version 5.1 or higher?</p>