Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added defensive coding and warning - fixes #33 #35

Closed
wants to merge 1 commit into from

Conversation

kilasuit
Copy link

What problem does this PR address?

Adds a bit of addition defensive coding

Is there a related Issue?

#33

Have you...

@@ -58,7 +62,13 @@ Write-Host "CodeCoverageFolder $CodeCoverageFolder"
Write-Host "ScriptBlock $ScriptBlock"

Import-Module -Name (Join-Path $PSScriptRoot "HelperModule.psm1") -Force
Import-Pester -Version $TargetPesterVersion
If ($TargetPesterVersion -eq '4.99.99') {
Import-Pester -MaximumVersion $TargetPesterVersion
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import-Pester doesn't have a MaximumVersion parameter.

@@ -47,6 +47,10 @@ if ($TargetPesterVersion -match '^5') {
Write-Host "##vso[task.logissue type=error]This version of the task does not support Pester V5, please use task version 10 or higher."
exit 1
}
if ($TargetPesterVersion -match 'latest') {
Write-Host "##vso[task.logissue type=warning]Task version not properly set so defaulting to enforcing it to be the latest possible v4 that we will support in this version of the task - v4.99.99"
$TargetPesterVersion = '4.99.99'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need this change to the target pester version, the import script handles "latest" fine.

@kilasuit
Copy link
Author

Re-reading through this & the wider code base I don't think this change is actually needed

@kilasuit kilasuit closed this Jun 15, 2020
@kilasuit kilasuit deleted the bm/v9defense branch June 15, 2020 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants