Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upChange build script to install into a versioned directory #1247
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
…d.psm1
| $oldPSModulePath = $env:PSModulePath | ||
| $savedPSModulePath = $env:PSModulePath | ||
| } | ||
| AfterAll { |
This comment has been minimized.
This comment has been minimized.
bergmeister
Jun 3, 2019
Collaborator
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.
This comment has been minimized.
This comment has been minimized.
JamesWTruher
Jun 3, 2019
•
Author
Member
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!
|
Looks good to me, I ran the build and tests locally (Windows) on PS 6.2 and 5.1 and it worked fine. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

JamesWTruher commentedMay 31, 2019
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.