Git Product home page Git Product logo

powerbuild's Introduction

PowerBuild

Build status

PowerBuild module provides full MSBuild integration into PowerShell pipeline. Unlike simmilar modules that provide wrapper around msbuild.exe, PowerBuild's Invoke-MSBuild cmdlet uses Microstft.Build API directly. It means it can write build results into output, making the results available for processing by other cmdlets. Default logger utilizes Error, Warning and Verbose streams to log MSBuild events.

Getting started:

You can get the module from the PowerShell Gallery by executing following script.

Install-Module -Name PowerBuild 

Using PowerBuild

Invoke MSBuild and store results to local variable.

PS> $buildResults = Invoke-MSBuild -Project c:\Workspace\GitHub\kovalikp\PowerBuild\PowerBuild.sln `
>>   -Target Build -Verbosity Minimal -ConsoleLogger PSHost `
>>   -Property @{Configuration="Release"}

Manipulate results in pipeline.

PS> $buildResults | Select-Object -ExpandProperty Items | Format-Table ItemSpec,MetadataCount

Supported switches

CommandLine PowerShell
[project file | directory] -Project <string>
/target:<targets> -Target <string[]>
/property:<n>=<v> -Property <Hashtable>
/property:Configuration=<v> -Configuration <string>
/property:Platform=<v> -Platform <string>
/maxcpucount[:n] -MaxCpuCount <int>
/toolsversion:<version> -ToolsVersion <string>
/verbosity:<level> -Verbosity <LoggerVerbosity>
/consoleloggerparameters:<parameters> -ConsoleLoggerParameters <string>
/noconsolelogger -ConsoleLogger {None | PSStreams | PSHost}
/fileLogger[n] New-FileLogger
/fileloggerparameters[n]:<parameters> New-FileLogger
/distributedlogger
/distributedFileLogger
/logger:<logger> -Logger <ILogger[]>
/binaryLogger New-BinaryLogger
/binaryLogger:<parameters> New-BinaryLogger
/warnaserror -WarningsAsErrors @()
/warnaserror:code[;code2] -WarningsAsErrors <string[]>
/warnasmessage -WarningsAsMessages @()
/warnasmessage:code[;code2] -WarningsAsMessages <string[]>
/validate
/validate:<schema>
/ignoreprojectextensions:<extensions> -IgnoreProjectExtensions <string[]>
/nodeReuse:<parameters> -NodeReuse <bool>
/preprocess Invoke-MSBuildPreprocess
/preprocess:file Invoke-MSBuildPreprocess -OutputFile <string>
/detailedsummary -DetailedSummary
@<file>
/noautoresponse
/nologo
/version
/help Get-Help Invoke-MSBuild

Argument Completers

PowerBuild provides autocompleters for several arguments. They either use MSBuild API directly, or try to approximate MSBuild functionality to generate values.

Parameter Solution Project
Target Metaproject + API MSBuild API
Configuration MSBuild API "Debug" or "Release"
Platform MSBuild API "AnyCPU", "x64" or "x86"

Logging

Default logger can be specified using -ConsoleLogger parameter. The parameter currently recognized these values.

  • $null - If console logger was passed via -Logger parameter, then None, else PSStreams.
  • PSStreams - Uses Error, Warning and Verbose streams to write logs. -Verbosity switch affects log level output to Verbose stream.
  • PSHost - Uses PowerShell host to write logs. This is equivalent of msbuild.exe's console logger.
  • None - Disables console logger.

Level of logging is affected by -Verbose parameter.

Additional loggers can be created using New-Logger, New-ConsoleLogger, New-FileLogger, New-BinaryLogger or New-StructuredLogger commnandlets and passed to -Logger parameter.

Example

Console

powerbuild's People

Contributors

kovalikp avatar

Stargazers

 avatar

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.