Update build script to build when needed (#2670)#2671
Merged
nohwnd merged 2 commits intopester:mainfrom Dec 15, 2025
Merged
Conversation
The build script previously did not build Pester the project unless `-Clean` was specified. This meant that if you had not previously built it with `-Clean`, then the generated files would be missing all of the .Net assemblies, and the `PesterConfiguration.Formats.ps1xml` file, and would prevent running of the `test.ps1` file. This adds a check at a point in the build where we have either cleaned the bin directory already, or it never existed. If it is not there then we clean so that the build occurs.
296c7de to
5ca42b1
Compare
Member
|
/azp run |
Contributor
|
Azure Pipelines successfully started running 1 pipeline(s). |
nohwnd
approved these changes
Dec 12, 2025
fflaten
approved these changes
Dec 12, 2025
build.ps1
Outdated
| Remove-Item "$PSScriptRoot/bin" -Recurse -Force | ||
| } | ||
|
|
||
| if (-not (Test-Path "$PSScriptRoot/bin")) { |
Collaborator
There was a problem hiding this comment.
nit: use elseif to avoid redundant call on clean build
nohwnd
reviewed
Dec 15, 2025
Member
|
The check is outdated, I've updated the pipeline. We need to explicitly name the steps in the branch check to avoid making it green and auto merge before azdo computes the steps to run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Update
build.ps1to automatically "clean" when the bin directory is not present.My testing process:
git clean -xdfto restore the repository to a "clean" state..\test.ps1and ensure that it builds and passes the tests.Fix #2670
PR Checklist
Create Pull Requestto mark it as a draft. PR can be markedReady for reviewwhen it's ready.Tests are added/update (if required)Not requiredDocumentation is updated/added (if required)Not required