{"id":4571,"date":"2009-01-19T16:40:36","date_gmt":"2009-01-19T16:40:36","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2009\/01\/19\/why-should-i-test-with-powershell\/"},"modified":"2019-02-18T13:12:51","modified_gmt":"2019-02-18T20:12:51","slug":"why-should-i-test-with-powershell","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/why-should-i-test-with-powershell\/","title":{"rendered":"Why Should I Test With PowerShell?"},"content":{"rendered":"<p>Today, on our internal discussion list, someone asked if there were any advantages to testing with PowerShell versus testing with C#.<\/p>\n<p>I was able to come up with 10 quick reasons to test with PowerShell:<\/p>\n<ol>\n<li>Being able to run command line programs easier within PowerShell<\/li>\n<li>Dynamically generating code or test data for a test case (fuzzing or data-driven testing get a lot easier with this)<\/li>\n<li>Being able to access COM easier within PowerShell<\/li>\n<li>Being able to embed PowerShell in C# (so you can avoid writing a framework and just embed PowerShell in your infrastructure)<\/li>\n<li>Being able to use weakly typed variables within PowerShell<\/li>\n<li>Being able to test APIs on the command line, so you test manually and then automate<\/li>\n<li>Getting a history of commands, to take what you&#8217;ve explored and turn it into a test case<\/li>\n<li>Being able to strongly cast or coerce types when needed<\/li>\n<li>Support for verbose, warning, and debug streams to provide additional test information<\/li>\n<li>Being able to use PowerShell&#8217;s systems administration features to help&#160; setup or cleanup a test environment<\/li>\n<\/ol>\n<p>I hope these reasons help convince other software testers to use PowerShell. It can really make testing a lot simpler.<\/p>\n<p>Hope this helps,<\/p>\n<p>James Brundage [MSFT]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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: Being able to run command line programs easier within PowerShell Dynamically generating code or test data for a test case [&hellip;]<\/p>\n","protected":false},"author":600,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[11,75],"class_list":["post-4571","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell","tag-philosophy","tag-testing"],"acf":[],"blog_post_summary":"<p>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: Being able to run command line programs easier within PowerShell Dynamically generating code or test data for a test case [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/4571","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/600"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=4571"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/4571\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=4571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=4571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=4571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}