Comments (8)
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.
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.
@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.
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.
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.
If it works, please share your solution here, so that I add this to the IB sample, to help others.
from invoke-build.
@kahnman Please let me know how it worked for you.
from invoke-build.
@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)
- Amend output on task errors.
- Reusing or sharing tasks HOT 5
- ib.cmd ? ignores a specified file
- vscode outline view: no symbols found in document HOT 2
- Different module and package versions HOT 2
- Parallel execution based on dependency tree HOT 2
- invoke-build discovery fails in powershell container HOT 3
- Please consider adding -Computername and -Session parameter to Task HOT 8
- GitHub action output is not colored
- Use-BuildEnv should make parameters mandatory
- Invoke-BuildExec spitting out service principal secret as current directory HOT 6
- Exec doesn't work well with forward slash arguments HOT 7
- Use `[System.Management.Automation.Cmdlet]::CommonParameters` to get the names of all common parameters HOT 3
- Task condition does not work HOT 8
- Build-Parallel writes only to Output stream HOT 7
- property 'File' cannot be found on this object HOT 17
- Do not wrap internal errors in Resolve-MSBuild
- Fix cryptic errors on unknown parameters
- Invoke-BuildExec should pass the original stderr error to the thrown terminating error HOT 38
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from invoke-build.