forked from dlwyatt/PowerShellLoggingModule
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test.ps1
18 lines (17 loc) · 746 Bytes
/
Test.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# The tests in here do not work properly in PowerShell 5.x
# If you run them all at once, you will get a lot of FALSE PASSES using the old code
# Running one test at a time in a new powershell session solves this problem:
if (Get-Command powershell.exe -ErrorAction SilentlyContinue) {
foreach ($testcase in ls $PSScriptRoot\Tests\*.Tests.ps1) {
powershell -NoProfile -Command Invoke-Pester $testcase.FullName
}
} else {
Write-Warning "Skipping Windows PowerShell tests"
}
if (Get-Command pwsh -ErrorAction SilentlyContinue) {
foreach ($testcase in ls $PSScriptRoot\Tests\*.Tests.ps1) {
pwsh -NoProfile -Command Invoke-Pester $testcase.FullName
}
} else {
Write-Warning "Skipping PowerShell Core tests"
}