This project is read-only.

PSUnit future features?

Jun 28, 2011 at 5:11 AM

Hi Klaus,

Firstly thank you for creating this great little framework. We are in the process of converting 2,000+ scripts to PowerShell and thus are using PSUnit to unit test these. Your work has been very well received!

Two features we would like to see added:

1)       An add-in for PowerGui so you can run a Unit Test from the PowerGui menu just as you can from ISE. I had a go at writing one of these which I was going to give to you. But because PowerGui add-ins run code in a script block I immediately ran into problems (see: . To fix this I think I would have to re-write some of your code I think.

2)       Some switches like $Skip (if this is the best way to do it?) that makes a function an initialisation function run at the start of the unit test script and another which makes a function a tear down function run at the end of the unit test script.

Keep up the good work,


Jun 30, 2011 at 3:11 PM

Hi rob321,

I was actually considering writing a PowerGUI addin. Thanks for sharing your experience with the integration. I will follow up on that. I will also add the TearDown and Setup functions to the feature list.

Thanks for your feedback,


Jul 8, 2011 at 5:26 AM

Hey Klaus,


I have made a simple change to the PSUnit.Run.ps1 script you might want, what's your email and I'll send it? We have put PSUnit into our CI process. We run the UnitTests at the end of our TFS test server deployments.

The change I made writes the test results to a LogFile using Write-Output (still does the Write-Host) i.e. PSUnit.Run.ps1 -PSUnitTestFile C:\temp\MyUnitTest.Test.ps1 -LogFile "C:\temp\TestResults.log". 

The deployment process just looks for FAIL in the log file and fails the build if it's there.