A PowerShell module to help with developing locally using MSBuild.
Table of Contents
![DevOps Commands Screen Shot.][./images/screenshot.png]
To make development simpler in PowerShell using MSBuild this module wraps the commands and defaults to the binary logger which provides far better log output for looking at builds.
To get a local copy up and running follow these simple example steps.
- PowerShell Core 7.x+
To install this module to use you have three options
- Download the zip and extract to a local modules directory
- Install from the PowerShell Gallery
- Clone, build and install
- Clone this repo somewhere.
- Run the build.ps1 in this folder to update.
- Run install.ps1 in this directory to add the loading of this module to your powershell profile. You have to run it in each instance (PowerShell is different to PowerShell Core)
Install-Module -Name platyPS -Scope CurrentUser
git clone
cd devopscommands
.\build.ps1
.\install.ps1
# open a new instance of powershell now and this module will
# be loaded as part of the profile load.
To run with defaults just use the msb
alias at the root of your project. This will run MSBuild with binary logging enabled and will produce a x64 Debug build.
If you want to override the default settings put these variables at the end of your profile with the values you want to use. If you are happy with these defaults do not worry about them.
Setting | Value | Description |
---|---|---|
StructuredLogViewerPath | "$env:USERPROFILE\AppData\Local\MSBuildStructuredLogViewer\app-2.1.88\StructuredLogViewer.exe" | Viewer for the Binary log produced by MSBuild |
MsBuildArguments | '/nologo', '/m', '/nr:false', '/p:TreatWarningsAsErrors="true"', '/p:Platform="x64"' | Arguments passed to MSBuild on every execution |
VsDefault | 17 | Version of Visual Studio to import the console settings from |
Settings are controlled by the SimpleSettings commands, this is a dependency of this module. To update the default you can use commands like below with your values.
Set-SimpleSetting -Name "StructuredLogViewerPath" -Section "DevOpsCommands" -Value "$env:USERPROFILE\AppData\Local\MSBuildStructuredLogViewer\app-2.0.64\StructuredLogViewer.exe"
Set-SimpleSetting -Name "MsBuildArguments" -Section "DevOpsCommands" -Value @('/nologo', '/m', '/nr:false', '/p:TreatWarningsAsErrors="true"', '/p:Platform="x64"')
# 15 == VS 2017
# 16 == VS 2019
# 17 == VS 2022
Set-SimpleSetting -Name "VsDefault" -Section "DevOpsCommands" -Value "17"
To list commands run Get-Command -Module DevOpsCommands
To get help on commands run Get-Command -Module DevOpsCommands | Get-Help
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) Note: Use Conventional Commits format for the commit/Pull Request - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the GNU GPLv3 License. See LICENSE
for more information.
Jon Bullen - @sytone
Project Link: https://github.com/sytone/devopscommands