Why Should I Test With PowerShell?

PowerShell Team

Today, on our internal discussion list, someone asked if there were any advantages to testing with PowerShell versus testing with C#.

I was able to come up with 10 quick reasons to test with PowerShell:

  1. Being able to run command line programs easier within PowerShell
  2. Dynamically generating code or test data for a test case (fuzzing or data-driven testing get a lot easier with this)
  3. Being able to access COM easier within PowerShell
  4. Being able to embed PowerShell in C# (so you can avoid writing a framework and just embed PowerShell in your infrastructure)
  5. Being able to use weakly typed variables within PowerShell
  6. Being able to test APIs on the command line, so you test manually and then automate
  7. Getting a history of commands, to take what you’ve explored and turn it into a test case
  8. Being able to strongly cast or coerce types when needed
  9. Support for verbose, warning, and debug streams to provide additional test information
  10. Being able to use PowerShell’s systems administration features to help  setup or cleanup a test environment

I hope these reasons help convince other software testers to use PowerShell. It can really make testing a lot simpler.

Hope this helps,

James Brundage [MSFT]


Discussion is closed.

Feedback usabilla icon