-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
test.ps1
32 lines (30 loc) · 920 Bytes
/
test.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
param ([Switch] $Clean)
if ($Clean) {
& "$PSScriptRoot/build.ps1"
}
else {
try {
& "$PSScriptRoot/build.ps1"
}
catch {
if ($_ -like "*The process cannot access the file*Profiler.dll*being used by another process*") {
Write-Warning "Files are locked, if you made changes to the C# code, close all processes that have the dll loaded and run with -Clean, or run ./build.ps1."
}
else {
throw $_
}
}
}
$devPesterPath = "/p/pester/bin/Pester.psd1"
if (Test-Path $devPesterPath) {
Write-Host "Using Pester from: $devPesterPath"
Get-Module Pester | Remove-Module
Import-Module $devPesterPath
}
else {
if (-not (Get-Module Pester -List | Where-Object Version -GE 5.2.0)) {
Write-Host "Installing Pester"
Install-Module Pester -MinimumVersion 5.0.0 -MaximumVersion 5.9999.9999
}
}
Invoke-Pester ./tst/