{"id":75061,"date":"2015-12-15T11:59:00","date_gmt":"2015-12-15T11:59:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2015\/12\/15\/powertip-connect-pester-to-automated-system\/"},"modified":"2019-02-18T09:20:40","modified_gmt":"2019-02-18T16:20:40","slug":"powertip-connect-pester-to-automated-system","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-connect-pester-to-automated-system\/","title":{"rendered":"PowerTip: Connect Pester to Automated System"},"content":{"rendered":"<p><b>Summary<\/b>: Learn how to incorporate Pester into an automated system.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\" \/>&nbsp;How do I incorporate Pester into an automated system?<\/p>\n<p style=\"margin-left:30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\" \/>&nbsp;Use one of the features in Pester that are built for this purpose: NUnit XML export,&nbsp;<b>-PassThru<\/b>&nbsp;switch, or the<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<b>&ndash;EnableExit<\/b>&nbsp;switch in conjunction with powershell.exe&rsquo;s exit code, for example:<\/p>\n<p style=\"margin-left:120px\">$testResults = Invoke-Pester -PassThru -OutputFormat NUnitXml -OutputFile .\\TestResults.xml<\/p>\n<p style=\"margin-left:30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7610.Dr.ScriptoForTips.jpg\" alt=\" \" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Learn how to incorporate Pester into an automated system. &nbsp;How do I incorporate Pester into an automated system? &nbsp;Use one of the features in Pester that are built for this purpose: NUnit XML export,&nbsp;-PassThru&nbsp;switch, or the&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&ndash;EnableExit&nbsp;switch in conjunction with powershell.exe&rsquo;s exit code, for example: $testResults = Invoke-Pester -PassThru -OutputFormat [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[501,56,636,356,45],"class_list":["post-75061","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-dave-wyatt","tag-guest-blogger","tag-pester","tag-powertip","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Learn how to incorporate Pester into an automated system. &nbsp;How do I incorporate Pester into an automated system? &nbsp;Use one of the features in Pester that are built for this purpose: NUnit XML export,&nbsp;-PassThru&nbsp;switch, or the&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&ndash;EnableExit&nbsp;switch in conjunction with powershell.exe&rsquo;s exit code, for example: $testResults = Invoke-Pester -PassThru -OutputFormat [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/75061","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=75061"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/75061\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=75061"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=75061"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=75061"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}