Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errorActionPreference not working #11671

Closed
winstonhenke opened this issue Oct 31, 2019 · 3 comments
Closed

errorActionPreference not working #11671

winstonhenke opened this issue Oct 31, 2019 · 3 comments

Comments

@winstonhenke
Copy link

Required Information

Type: Bug

Enter Task Name: AzurePowerShell@4
https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/AzurePowerShellV4

Environment

  • Server - Azure Pipelines
  • Agent - Hosted
    • Azure Pipelines - Image: VS2017

Issue Description

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

@20shivangi
Copy link
Contributor

@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.

@winstonhenke
Copy link
Author

Thanks!

@chshrikh chshrikh assigned niadak and unassigned kmkumaran Dec 5, 2019
@eaarora-ms
Copy link
Contributor

The issue should have been fixed by now. It might take some time to mitigate though. Please comment if you're still facing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants