-
Notifications
You must be signed in to change notification settings - Fork 2
Arch PowerShell
I make use of Adam Driscoll's poshtools PowerShell Tools for Visual Studio. I will endeavor to keep this project up to date with the latest version of Visual Studio. I do so in a non-standard manner because this is a fairly substantial PowerShell application.
I keep each function in a separate script in a Scripts folder, next to the Tests folder. I have a simple Build script that copies all the functions into the project's .psm1 file. The project's tests run against this module file. I prefer to keep functions and other PowerShell object in individual files to simplify editing, and to allow each object to be controlled individually in source control.
The NuGetShared project contains common code that can be used by the NuGetDbPacker and DbSolutionBuilder projects. Each of those projects' .psm1 file imports the NuGetSharedmodule. The Build script copies the project's module files into its bin folder together with the NuGetShared module files. The NuGetShared Build script copies its modules into the other projects' bin folders.
At the solution level, the Build script invokes all the projects' Build scripts in sequence.
My idea is to control the visibility of the module's functions with the .psd1 file but to access the generated .psm1 file from the tests. I have not tested this yet, so all functions are visible.
The solution level TestAll.ps1 script executes all the PowerShell tests with Invoke-Pester, and uses the NUnitHTMLReportGenerator utility to display the test results.
The solution level Bootstrap GetPackageContent and PublishDbProjects are not project scripts and do not have explicit tests.