-
Notifications
You must be signed in to change notification settings - Fork 32
Add ability to override Pester script parameters and specify version of module to execute #12
Add ability to override Pester script parameters and specify version of module to execute #12
Conversation
Add the ability to specify a specific version of an OVF module to execute as well as the ability to override script parameters defined in Pester tests.
…idation-Framework into script-parameters
Hi @devblackops, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
@devblackops, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
@JamesWTruher Any comment on this PR? |
@JamesWTruher Who at Microsoft is responsible for maintaining this module? Is it just you or are there others that can take a look at this? I'd like to see some traction or PR review. This is a super useful module but if it takes ages to get a PR through or even to get a discussion going, I don't see it going anywhere. |
Some feedback on this PR would be nice. This is something I'd use heavily if implemented. As I invest more time into OVF I'd like to know there is active development behind it. |
After speaking with @devblackops he mentioned that this PR adds tag support. I haven't tried his implementation out yet but I'm excited. The Simple/Comprehensive designation seemed arbitrary. Being able to use my own tags from Pester to better categorize my OVF tests would be great. |
Small clarification. This PR does NOT add tag support. Just support for providing parameters to Pester scripts and OVF module versions. Tag support is in this branch in my fork. That branch includes the changes in this PR as well. Once I do a little more testing, I'll submit a PR to add tag support. That is, if anyone at Microsoft will review and comment 😏 |
sorry about the delay, I'm not getting notifications for some reason. I like this PR, but could we add some tests to validate the new functionality? |
# Did we specify a specific version to find? | ||
if ($PSBoundParameters.ContainsKey('Version')) | ||
{ | ||
$manifestFile = Get-ChildItem -Path $modDir.FullName -Filter "$modDir.psd1" | Select-Object -First 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$modDir [](start = 102, length = 7)
when I see write things like this, i usually like to use "${modDir}.psd1"
just to avoid confusion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. I've changed it to "$($obj.prop)" syntax
Thanks for responding @JamesWTruher. I'll make the required changes to tests and let you know when this can be reviewed again. Expect a similar PR to come in that adds tag support referenced in #10 |
Hi @JamesWTruher I believe this is ready to merge. Cheers. |
thanks! |
This PR adds the ability to pass script parameters to Pester tests referenced in issue #6 as well as the ability to specify the version of the module to execute in the event that there are multiple versions of the OVF module in
$PSModulePath
.If a Pester script inside an OVF module had a parameter block like so:
then those parameters can be overridden by injecting new values in the form of a
[hashtable]
when callingInvoke-OperationValidation
Example
This change is