PowerShell Pro Tools
Ironman SoftwareGitHub
  • About
  • System Requirements
  • PowerShell Tools Documentation
    • Visual Studio
      • Analysis
      • Debugging
        • Local Debugging
        • Remote Debugging
      • Format Document
      • Go to Definition
      • Packaging in Visual Studio
      • PowerShell 7 Support
      • PowerShell Interactive Window
      • Project System
        • Advanced
        • Debug
        • Build Events
      • Settings
        • General
        • .editorconfig
        • Analysis
        • Diagnostics
      • Tool Windows
      • Refactoring
      • Unit Test Adapter
      • User Interface Design
        • Windows Forms
  • PowerShell Pro Tools Documentation
    • Visual Studio Code
      • Automating Visual Studio Code
      • Code Conversion
      • Debugging
        • Run in New Terminal
        • One-Click Attach
      • Decompiler
      • Diagnostics
      • Enhanced Hover
      • Generating a UI from a function
      • Generate a Tool from a Function
      • Packaging in Visual Studio Code
      • Pin Session
      • PowerShell Explorer
      • Profiler
      • Sign On Save
      • RapidSense
      • Refactoring
      • Rename Symbols
      • Quick Scripts
      • Windows Forms Designer
    • Installers
    • Packaging
      • Package.psd1
      • PowerShell Packager
      • Package Hosts
      • Package as Service
      • Packaging on Linux
      • Packaging on Mac OS X
      • Continuous Integration
      • Anti-Virus
    • PowerShell Module
      • Global Hotkeys
      • Show-PSEditor
      • Show-PSScriptPad
      • Show-TUIDesigner
      • ConvertTo-CSharp
      • ConvertTo-PowerShell
      • Merge-Script
      • Install-PoshProToolsLicense
      • about_MergeScriptConfig
      • Show-WinFormDesigner
    • PowerShell Protect
      • Getting Started
      • Installation
      • Actions
      • Rules
      • Configuration
    • PSCommander
    • PSScriptPad
    • Installation and Licensing
      • Visual Studio Offline Installation
  • Changelog
    • PowerShell Tools for Visual Studio
    • PowerShell Pro Tools for Visual Studio Code
    • PowerShell Packager
    • PSScriptPad
    • PowerShell Pro Tools Module
Powered by GitBook
On this page
  • Unit Test Adapter
  • Getting Started
  • Pester Installation
  • Debugging Issues with the test adapter
  1. PowerShell Tools Documentation
  2. Visual Studio

Unit Test Adapter

PreviousRefactoringNextUser Interface Design

Last updated 10 months ago

Unit Test Adapter

Getting Started

The PowerShell Tools for Visual Studio integrates a unit test adapter that can discover and executetests. To write tests you will need to create a PS1 file that ends in the extension “Tests.PS1”. The test adapter will only look in files with this extension. From there, you can author Pester tests as you normally would. The Test Explorer window will display the tests it finds and you can execute them by clicking Run All or Run.

Test results are shown just like any other testing framework. They will include the result of the test, the reason for failure and a stack trace to the offending code that has failed.

Pester Installation

The test adapter will look in a few places while attempting to load the Pester module.

  1. Test run directory

  2. Solution Package directory

    Note: this does not follow the NuGet package resolution logic and only currently uses the solution directory

  3. PSModule path

Debugging Issues with the test adapter

The test adapater will log to the Output pane in the Tests category. Check here first for any issues you may encounter when writing tests.

Pester