mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
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:
+10
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user