Azure-devops-docs: What does the '|' character do after powershell or bash in the examples above.

Created on 20 Sep 2018  Â·  6Comments  Â·  Source: MicrosoftDocs/azure-devops-docs

The script tag shows steps, then a child of PowerShell that has a value of a "pipe" character:
steps:

  • powershell: |
    Write-Error 'Uh oh, an error occurred'
    Write-Host 'Trying again...'

Update: I see in Yaml it indicates that it is a "multi-line scalar value" that follows. That to me would be a nice bit of info in this doc. Not sure if you agree. I don't see any good Link or help on explaining Yaml itself.

Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

devopprod doc-bug

Most helpful comment

@vtbassmatt, you might also consider mentioning as a note or something that any TextMate-based YAML synctax highlighting may appear broken at times because of bug https://github.com/textmate/yaml.tmbundle/issues/26. For example, the following will appear with errors but is correct. If authors try to put the lines that begin with "*" in quotes - which for literal strings is required - it will actually include those quotes as literals and the task(s) will likely fail:

example: |
  **/*.zip

I have screenshots in a bug I opened against VSCode, though when digging in deeper it was discovered it was a TextMate grammar issue.

All 6 comments

I'll find a good YAML overview and link to it. Thanks for the suggestion.

@vtbassmatt, you might also consider mentioning as a note or something that any TextMate-based YAML synctax highlighting may appear broken at times because of bug https://github.com/textmate/yaml.tmbundle/issues/26. For example, the following will appear with errors but is correct. If authors try to put the lines that begin with "*" in quotes - which for literal strings is required - it will actually include those quotes as literals and the task(s) will likely fail:

example: |
  **/*.zip

I have screenshots in a bug I opened against VSCode, though when digging in deeper it was discovered it was a TextMate grammar issue.

Thanks @heaths -- that explains the long string highlighting behavior I see with our Azure Pipelines extension as well.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Still need a good "intro to YAML" someplace in our docs.

There's a YAML primer linked from the schema now.

Was this page helpful?
0 / 5 - 0 ratings