Type: Bug
Enter Task Name: AzurePowerShell@4
https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/AzurePowerShellV4
errorActionPreference not working
I'm passing errorActionPreference: stop into my task but
write-host "error preference is: $errorActionPreference"
is reporting
error preference is: Continue
Version : 4.159.3
Full task definition...
- task: AzurePowerShell@4
displayName: 'Run Script'
inputs:
azureSubscription: '$(azureSubscription)'
ScriptPath: '$(Pipeline.Workspace)/$(artifactName)/myScript.ps1'
ScriptArguments: '
-location $(location)
-resourceGroupName $(resourceGroupName)'
errorActionPreference: stop
azurePowerShellVersion: 'OtherVersion'
preferredAzurePowerShellVersion: '2.6.0'
And then the very first line in my script I have
write-host "error preference is: $errorActionPreference"
that prints error preference is: Continue
@winstonhenke
This issue has been fixed in new AzurePowerShell version i.e. 5.162.0 . It will take at least 3-4 weeks to get deployed.
Thanks!
The issue should have been fixed by now. It might take some time to mitigate though. Please comment if you're still facing it.