This project is read-only.

Debugging test Script with powerShell ISE

Apr 27, 2010 at 1:07 PM

How is it possible to debug the unit test script?

Wouldn’t it be better to call the ps unit test script “dot sourced” instead of “Invoke-Expression”.


I’ve changed the PSUnit.Run.ps1 file from


#Loading test functions into global scope

$ScriptLines = Get-Content -Path $PSUnitTestFile -Encoding "UTF8"

$ScriptText = [String]::Join("`r`n", $ScriptLines)

Invoke-Expression $ScriptText



 #Loading test functions into global scope

. $PSUnitTestFile


 Then it is possible to debug the test script with powerShell ISE.

Apr 27, 2010 at 7:33 PM

Thanks for your feedback JochenAxt.

I made the change and I am now running some tests before I commit it.

It seems to work fine so far.

Being able to step trough your code in the debugger is a huge improvement.