GithubHelp home page GithubHelp logo

Comments (8)

kahnman avatar kahnman commented on June 21, 2024 2

Thanks for the quick response @nightroman! My build server is using PowerShell 7.1.3, so let me upgrade to PS 7.2+ and see if that fixes my issue.

I primarily want coloration, which sounds like is already supported in PS 7.2+ and that should be fine for me, but if I decide to use those specific Azure DevOps formatting options, I'll try using Custom task headers and footers as you suggested and comment with my results here to help other.

Thanks!

from invoke-build.

nightroman avatar nightroman commented on June 21, 2024 1

As for your request, I think you can do this using Custom task headers and footers. Instead of typical Write-Build with color codes use Write-Host "##[color]..." as Azure requires.

from invoke-build.

kahnman avatar kahnman commented on June 21, 2024 1

@nightroman I have confirmed that after updating PowerShell to 7.2.7 on my build server, the output in my Azure Pipeline is colorized without any changes being made to by build scripts or Invoke-Build itself. Thank you for your guidance and great work!

from invoke-build.

kahnman avatar kahnman commented on June 21, 2024

I found this Pester issue talking about a similar request to mine. Looks like the Pester developers opted to use ANSI escape codes for output. Maybe a similar route could be taken for Invoke-Build if not already an option?

from invoke-build.

nightroman avatar nightroman commented on June 21, 2024

IB uses escape sequences when it runs in PS v7.2+
See GH action tests output -- https://github.com/nightroman/Invoke-Build/actions/runs/3298362700/jobs/5440381359

What is the PS version in Azure DevOps Pipelines?
And does Azure DevOps Pipelines support escape sequences?

from invoke-build.

nightroman avatar nightroman commented on June 21, 2024

If it works, please share your solution here, so that I add this to the IB sample, to help others.

from invoke-build.

nightroman avatar nightroman commented on June 21, 2024

@kahnman Please let me know how it worked for you.

from invoke-build.

kahnman avatar kahnman commented on June 21, 2024

@nightroman I haven't had time to update PowerShell to 7.2 on my build server to test the built in colorization of Write-Build, but I hope to have time to do that this week.

I did, however, test using the Azure DevOps formatting options in a custom task header and footer and that worked like a charm.

Example:

Set-BuildHeader {
    param($Path)
    Write-Host "##[section]Task $Path"
}

I will update this issue again once I have updated my build server to PowerShell 7.2+.

Cheers!

from invoke-build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.