Change build script to install into a versioned directory#1247
Merged
JamesWTruher merged 7 commits intoPowerShell:developmentfrom Jun 3, 2019
Merged
Change build script to install into a versioned directory#1247JamesWTruher merged 7 commits intoPowerShell:developmentfrom
JamesWTruher merged 7 commits intoPowerShell:developmentfrom
Conversation
instead of installing into out/PSScriptAnalyzer it will be out/PSScriptAnalyzer/<version> Also add some -force to a number of the ew-item -type directory tests because they cause misleading screen output tracked down one of the tests which was not setting �nv:PSModulePath back correctly
Versioned module directories are not supported, so we need to change the name of the directory from <version> to PSScriptAnalyzer so it can be added to env:PSModulePath and work as expected
9167a5b to
cbb59cf
Compare
bergmeister
reviewed
Jun 3, 2019
| $oldPSModulePath = $env:PSModulePath | ||
| $savedPSModulePath = $env:PSModulePath | ||
| } | ||
| AfterAll { |
Collaborator
There was a problem hiding this comment.
Just a note, there is a Pester issue here whereby using BeforeAll or AfterAll inside a Context block results in unpredictable behaviour. Technically they should be only under a Describe block. We should address this in another PR as refactoring this test suite is hard.
Contributor
Author
There was a problem hiding this comment.
yah - I agree - the missing AfterAll was the reason that the analyzer needed to be installed into a specific location. with this change, that is no longer needed! The test altered $env:PSModulePath permanently!
bergmeister
approved these changes
Jun 3, 2019
Collaborator
bergmeister
left a comment
There was a problem hiding this comment.
Looks good to me, I ran the build and tests locally (Windows) on PS 6.2 and 5.1 and it worked fine.
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.
instead of installing into out/PSScriptAnalyzer it will be out/PSScriptAnalyzer/
I also added some
-forceto a number of theNew-item -type directorytests because they cause misleading screen output because the directory already existed.I fixed one of the tests which was not setting �
$env:PSModulePathback correctly to its original state.PR Summary
A number of infrastructure and test fixes
PR Checklist
.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.