Skip to content

PowerShell Execution Script

Johan Leino edited this page Sep 26, 2013 · 4 revisions

Introduction

Sometimes I can find it handy to actually use the tsr script locally and then include it as part of the source code. This example simply shows an example of such a script and how you can use it (as an alternative to inline source code)


First, I'll add a new PS file to my specflow project, Execute-Tests.ps1. Here's an example of what it might look like:

Set-Location $PSScriptRoot

Import-Module .\TeamCity.SpecFlow.Reporting.psm1

Set-Properties @{
    PathToPackagesFolder = '..\..\'
}

Invoke-TeamCitySpecFlowReport

Finally inside the TeamCity PowerShell runner I'll make these changes:

Things to notice:

  • Working Directory is set by the script (you can do that with inline also if you like it better)
  • I'm executing a file now instead of source code so change a couple of things to accomodate that.

That's it!

Clone this wiki locally