Skip to content

[Question]: How to change the formatting of the Ignore $LASTEXITCODE setting in classic pipeline? #21173

@aryanEncryption

Description

@aryanEncryption

Task name

Problem with Ignore $LASTEXITCODE

Task version

No response

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Windows

Question

I have a simple inline powershell inline task in the Azure devops classic pipeline which runs a Write-Host command to print "Hello" followed by an empty line.
Now I don't want to append any exit code at the end of my inline script, and when I turn 'Ignore $LASTEXITCODE' setting on, azure pipeline trims the last empty line when it runs the script on the hosted machine.
Can I somehow change the formatting of the exit code to not remove that empty line from the end of the file or is there a way to add an empty line at the end before the pipeline executes the inline powershell step?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions