4

Press the shortcut key 'Ctrl+F5' in VSCode to run the Pester test file with the suffix '.tests.ps1'.

In 'about_Parsing.Tests.ps1' After you press "Ctrl+F5", the console will directly appear:d:\GitRepository\PowerShell\example\pester\‪about_Parsing\‪about_Parsing.Tests.ps1

The test is then run directly.

How to run tests in such a convenient way and use various invoke-pester parameters, such as -output detailed?

Mark Wragg
  • 22,105
  • 7
  • 39
  • 68
Andy
  • 1,077
  • 1
  • 8
  • 20

1 Answers1

5

If you go to the Settings of VSCode and search for Pester, you should find a setting called:

PowerShell > Pester: Output Verbosity

You can set this to "detailed".

The setting also indicates that if you're using Pester v5 or newer you can also set this via the $PesterPreference variable which it uses by default. You could set this variable in your script or PowerShell profile.

$PesterPreference = [PesterConfiguration]::Default
$PesterPreference.Output.Verbosity = 'Detailed'
Lieven Keersmaekers
  • 57,207
  • 13
  • 112
  • 146
Mark Wragg
  • 22,105
  • 7
  • 39
  • 68