Add warning to Start-PSPester if Pester module not found (#5069)
Currently, if a user does not clone with the `--recursive` flag or run `git submodule update --init`, `Start-PSPester` will fail to run due to the missing Pester module. While the error hints at the Pester module not being found, there is no suggested way of fixing the issue presented to the user. This change makes a helpful warning to appear at the beginning of the execution of `Start-PSPester` if the Pester module cannot be found.
This commit is contained in:
parent
983409f80e
commit
42e8deb969
10
build.psm1
10
build.psm1
|
@ -848,6 +848,16 @@ function Start-PSPester {
|
|||
[switch]$IncludeFailingTest
|
||||
)
|
||||
|
||||
if (-not (Get-Module -ListAvailable -Name $Pester -ErrorAction SilentlyContinue))
|
||||
{
|
||||
Write-Warning @"
|
||||
Pester module not found.
|
||||
Make sure that the proper git submodules are installed by running:
|
||||
git submodule update --init
|
||||
"@
|
||||
return;
|
||||
}
|
||||
|
||||
if ($IncludeFailingTest.IsPresent)
|
||||
{
|
||||
$Path += "$PSScriptRoot/tools/failingTests"
|
||||
|
|
Loading…
Reference in a new issue