Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Commit 53106f0

Browse files
v4.11.0
1 parent 68d7e9e commit 53106f0

File tree

77 files changed

+169
-124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+169
-124
lines changed

PSAutoLab.psd1

182 Bytes
Binary file not shown.

PSAutoLab.psm1

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,42 @@
1-
#kick off a background job to find
1+
#kick off a background job to find the current version of this module in the PSGallery
22

33
$job = Start-Job {Find-Module -name PSAutolab -Repository PSGallery }
44

5+
#dot source functions
6+
. $PSScriptRoot\functions\public.ps1
7+
. $PSScriptRoot\functions\private.ps1
8+
9+
#region module check
10+
#this code should be redundant and unnecessary since the manifest specifies required Modules
11+
#but we'll keep it as a fail safe.
12+
513
#declare the currently supported version of Lability
614
$LabilityVersion = "0.19.1"
715
$ConfigurationPath = Join-Path -path $PSScriptRoot -ChildPath Configurations
816

9-
#dot source functions
10-
. $PSScriptRoot\functions\public.ps1
11-
. $PSScriptRoot\functions\private.ps1
17+
#declare the currently supported version of Pester
18+
#Pester v5 is incompatible with the current validation tests
19+
$PesterVersion = "4.10.1"
1220

1321
$currentLability = Get-Module -Name Lability -ListAvailable | Sort-Object -property version | Select-Object -last 1
1422
if ($currentLability.version -lt $LabilityVersion) {
1523
Write-Host "You appear to be running an older version of the Lability module. Run Refresh-Host to update to version $LabilityVersion" -ForegroundColor yellow
1624
}
1725

26+
$currentPester = Get-Module -fullyqualifiedname @{ModuleName = "Pester"; ModuleVersion = "$PesterVersion"} -ListAvailable
27+
if (-not $CurrentPester) {
28+
Write-Host "You do not have the required version of the Pester module. If you have already run
29+
Setup-Host, please run Refresh-Host to install Pester version $PesterVersion. Newer versions may
30+
not be supported in this module." -ForegroundColor yellow
31+
}
32+
else {
33+
#remove any existing versions of the module.
34+
Get-Module Pester | Remove-Module
35+
#write-host "Importing Pester v$PesterVersion" -ForegroundColor green
36+
Import-Module -Name Pester -RequiredVersion $pesterVersion -global -Force
37+
}
38+
#endregion
39+
1840
[version]$thisVersion = (Test-ModuleManifest -path $psscriptroot\psautolab.psd1).version
1941
$job | Wait-Job
2042
[version]$onlineVersion = ($job | Receive-Job).version

README.md

Lines changed: 23 additions & 16 deletions

0 commit comments

Comments
 (0)