&lt;?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Articles from September 2016 on PowerShell.org - Welcome Automaters!</title><link>https://powershell.org/articles/2016/09/</link><description>Recent content in Articles from September 2016 on PowerShell.org - Welcome Automaters!</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://powershell.org/articles/2016/09/index.xml" rel="self" type="application/rss+xml"/><item><title>Recap of DuPSUG PowerShell Saturday 2016</title><link>https://powershell.org/articles/2016-09-27-recap-of-dupsug-powershell-saturday-2016/</link><guid>https://powershell.org/articles/2016-09-27-recap-of-dupsug-powershell-saturday-2016/</guid><pubDate>Tue, 27 Sep 2016 07:28:04 +0000</pubDate><description>&lt;p&gt;Last weekend we hosted our second PowerShell Saturday, this time the event was hosted by IPsoft in Amsterdam. During this event members of the Dutch PowerShell User Group gathered together to view a number of presentations and to engage in lively discussions on the various new developments in the PowerShell world.&lt;br&gt;
For more information about PowerShell Saturday, the Dutch PowerShell User Group or the slides and code used in the presentations please head over to the recap blog post here:&lt;br&gt;
&lt;a href="http://www.jaapbrasser.com/recap-of-dutch-powershell-saturday-september-2016/"&gt;Recap of Dutch PowerShell Saturday September 2016&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Last weekend we hosted our second PowerShell Saturday, this time the event was hosted by IPsoft in Amsterdam. During this event members of the Dutch PowerShell User Group gathered together to view a number of presentations and to engage in lively discussions on the various new developments in the PowerShell world.<br>
For more information about PowerShell Saturday, the Dutch PowerShell User Group or the slides and code used in the presentations please head over to the recap blog post here:<br><a href="http://www.jaapbrasser.com/recap-of-dutch-powershell-saturday-september-2016/">Recap of Dutch PowerShell Saturday September 2016</a></p>
]]></content:encoded></item><item><title>PowerShell Happenings at Ignite 2016</title><link>https://powershell.org/articles/2016-09-22-powershell-happenings-at-ignite-2016/</link><guid>https://powershell.org/articles/2016-09-22-powershell-happenings-at-ignite-2016/</guid><pubDate>Thu, 22 Sep 2016 15:27:46 +0000</pubDate><description>&lt;p&gt;With Ignite fast-approaching, here&amp;rsquo;s what&amp;rsquo;s up - and this is intended to be a &amp;ldquo;community post,&amp;rdquo; meaning I&amp;rsquo;d love it if you could add your own PowerShell At Ignite notes in the comments, including sessions you&amp;rsquo;re looking forward to!&lt;br&gt;
On **Sunday evening, **while not officially a PowerShell event, a lot of PowerShell glitterati will be at &lt;a href="https://twitter.com/thekrewe?lang=en"&gt;The Krewe&amp;rsquo;s&lt;/a&gt; annual gathering from 8pm.&lt;br&gt;
On **Monday evening, **the Atlanta PowerShell User Group is kindly hosting a &lt;a href="https://www.meetup.com/Atlanta-PowerShell-Users-Group/events/233394410/"&gt;meet-and-greet&lt;/a&gt; with myself, Jeff Hicks, and Jason Helmick. We promise to be educational; registration required (but free).&lt;br&gt;
&lt;strong&gt;Tuesday evening&lt;/strong&gt; is the PowerShell Community Happy Hour (from 4-7; &lt;a href="https://www.eventbrite.com/e/powershell-community-happy-hour-2016-tickets-26667369821"&gt;tickets required)&lt;/a&gt;, including many of the in-attendance team members, most of the PowerShell.org Board, and a bunch of super Shell enthusiasts. We&amp;rsquo;ll have PowerShell.org and The DevOps Collective laptop stickers!&lt;br&gt;
**Wednesday, **I&amp;rsquo;m looking forward to &lt;a href="https://myignite.microsoft.com/sessions/3112"&gt;PowerShell Unplugged&lt;/a&gt; with Jeffrey Snover and I, from 9 to 9:45am. This is nearly always hilarious and fun. Then, from 10-10:30, Jeffrey, Jason Helmick, and I will be signing books and handing out laptop stickers at the Ignite Bookstore. Finally, from 11-11:30, I&amp;rsquo;ll be signing FREE! books at the &lt;a href="http://conversationalgeek.com/"&gt;Conversational Geek&lt;/a&gt; booth (#571) (who have some &lt;a href="https://twitter.com/convgeek"&gt;amazing scavenger hunt prizes&lt;/a&gt;).&lt;br&gt;
And of course, please stop by the &lt;a href="http://pluralsight.com"&gt;Pluralsight&lt;/a&gt; booth to say hi, pick up some swag, register your company for a free pilot subscription, and whatnot.&lt;br&gt;
So&amp;hellip; what&amp;rsquo;re YOU looking forward to next week?&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>With Ignite fast-approaching, here&rsquo;s what&rsquo;s up - and this is intended to be a &ldquo;community post,&rdquo; meaning I&rsquo;d love it if you could add your own PowerShell At Ignite notes in the comments, including sessions you&rsquo;re looking forward to!<br>
On **Sunday evening, **while not officially a PowerShell event, a lot of PowerShell glitterati will be at<a href="https://twitter.com/thekrewe?lang=en">The Krewe&rsquo;s</a> annual gathering from 8pm.<br>
On **Monday evening, **the Atlanta PowerShell User Group is kindly hosting a<a href="https://www.meetup.com/Atlanta-PowerShell-Users-Group/events/233394410/">meet-and-greet</a> with myself, Jeff Hicks, and Jason Helmick. We promise to be educational; registration required (but free).<br><strong>Tuesday evening</strong> is the PowerShell Community Happy Hour (from 4-7;<a href="https://www.eventbrite.com/e/powershell-community-happy-hour-2016-tickets-26667369821">tickets required)</a>, including many of the in-attendance team members, most of the PowerShell.org Board, and a bunch of super Shell enthusiasts. We&rsquo;ll have PowerShell.org and The DevOps Collective laptop stickers!<br>
**Wednesday, **I&rsquo;m looking forward to<a href="https://myignite.microsoft.com/sessions/3112">PowerShell Unplugged</a> with Jeffrey Snover and I, from 9 to 9:45am. This is nearly always hilarious and fun. Then, from 10-10:30, Jeffrey, Jason Helmick, and I will be signing books and handing out laptop stickers at the Ignite Bookstore. Finally, from 11-11:30, I&rsquo;ll be signing FREE! books at the<a href="http://conversationalgeek.com/">Conversational Geek</a> booth (#571) (who have some<a href="https://twitter.com/convgeek">amazing scavenger hunt prizes</a>).<br>
And of course, please stop by the<a href="http://pluralsight.com">Pluralsight</a> booth to say hi, pick up some swag, register your company for a free pilot subscription, and whatnot.<br>
So&hellip; what&rsquo;re YOU looking forward to next week?</p>
]]></content:encoded></item><item><title>Changing of the Guard at PowerShell.org</title><link>https://powershell.org/articles/2016-09-22-changing-of-the-guard-at-powershell-org/</link><guid>https://powershell.org/articles/2016-09-22-changing-of-the-guard-at-powershell-org/</guid><pubDate>Thu, 22 Sep 2016 14:47:30 +0000</pubDate><description>&lt;p&gt;It&amp;rsquo;s a bit of a sad day at The DevOps Collective, which is the nonprofit that runs PowerShell.org. One of our Board of Directors members, Dave Wyatt, will be stepping down from his Director position this week. He wants to focus on his personal life a bit more, although he&amp;rsquo;s still going to be responsible for our public Build Service, and he&amp;rsquo;s going to continue contributing to the Pester project, so the community isn&amp;rsquo;t losing him entirely. Dave&amp;rsquo;s been a huge help, and a huge inspiration, at PowerShell.org, and he&amp;rsquo;ll be greatly missed.&lt;br&gt;
But our sadness is balanced by some happy news, too, as PowerShell.org Webmaster Will Anderson has agreed to fill Dave&amp;rsquo;s seat. Will has brought a great enthusiasm to our team of volunteers, is also a PowerShell MVP, and also resides in Canada. Will&amp;rsquo;s responsible for most of the photography you&amp;rsquo;ll see in the upcoming PowerShell + DevOps Global Summit 2017 brochure, and he&amp;rsquo;s been a great help in keeping PowerShell.org&amp;rsquo;s website up and running.&lt;br&gt;
So please join me in wishing our outgoing Director all the best, and in welcoming Will to the Board!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>It&rsquo;s a bit of a sad day at The DevOps Collective, which is the nonprofit that runs PowerShell.org. One of our Board of Directors members, Dave Wyatt, will be stepping down from his Director position this week. He wants to focus on his personal life a bit more, although he&rsquo;s still going to be responsible for our public Build Service, and he&rsquo;s going to continue contributing to the Pester project, so the community isn&rsquo;t losing him entirely. Dave&rsquo;s been a huge help, and a huge inspiration, at PowerShell.org, and he&rsquo;ll be greatly missed.<br>
But our sadness is balanced by some happy news, too, as PowerShell.org Webmaster Will Anderson has agreed to fill Dave&rsquo;s seat. Will has brought a great enthusiasm to our team of volunteers, is also a PowerShell MVP, and also resides in Canada. Will&rsquo;s responsible for most of the photography you&rsquo;ll see in the upcoming PowerShell + DevOps Global Summit 2017 brochure, and he&rsquo;s been a great help in keeping PowerShell.org&rsquo;s website up and running.<br>
So please join me in wishing our outgoing Director all the best, and in welcoming Will to the Board!</p>
]]></content:encoded></item><item><title>PowerShell + DevOps Global Summit 2017 Preview</title><link>https://powershell.org/articles/2016-09-19-powershell-devops-global-summit-2017-preview/</link><guid>https://powershell.org/articles/2016-09-19-powershell-devops-global-summit-2017-preview/</guid><pubDate>Mon, 19 Sep 2016 19:55:14 +0000</pubDate><description>&lt;p&gt;As a quick reminder, our &lt;a href="https://powershell.org/2016/09/06/nearing-last-call-for-powershell-summit-topic-proposals-topic-ideas/"&gt;Call for Topics is still open&lt;/a&gt; for a few more days! Summ. Summit is very much intended to be a kind of mega-user group, not a &amp;ldquo;conference,&amp;rdquo; so don&amp;rsquo;t assume all the &amp;ldquo;professional&amp;rdquo; speakers have taken up all the speaking slots. We want &lt;strong&gt;you&lt;/strong&gt; to participate!&lt;br&gt;
In the meantime, while we&amp;rsquo;re waiting on the content committee to select topics and before registration opens in early November, I wanted to offer a peek at what we&amp;rsquo;re planning.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>As a quick reminder, our<a href="https://powershell.org/2016/09/06/nearing-last-call-for-powershell-summit-topic-proposals-topic-ideas/">Call for Topics is still open</a> for a few more days! Summ. Summit is very much intended to be a kind of mega-user group, not a &ldquo;conference,&rdquo; so don&rsquo;t assume all the &ldquo;professional&rdquo; speakers have taken up all the speaking slots. We want <strong>you</strong> to participate!<br>
In the meantime, while we&rsquo;re waiting on the content committee to select topics and before registration opens in early November, I wanted to offer a peek at what we&rsquo;re planning.</p><h2 id="deep-dive-day" class="ps-heading">Deep Dive Day<a class="ps-heading-anchor" href="#deep-dive-day" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Sunday is now a formal &ldquo;full day&rdquo; of Summit, rather than a &ldquo;pre-con&rdquo; day. That means we&rsquo;ll be presenting both Intermediate and Advanced content, including an opportunity for you to dig into the new open-source PowerShell GitHub repo, learn about the layout of the code, review what the community&rsquo;s been up to with that code, and more. Sunday will also offer two Lab opportunities, one for Advanced Functions and one for DSC Resources. You&rsquo;ll be able to wander in at will, and share some of <em>your work</em> with a domain expert, who&rsquo;ll offer critique and advice. We&rsquo;ll also have some pre-done scenarios, in case you&rsquo;d like to try your hand and test your skills. The full four-day pass is expected to cost $1500, and will be the first opened for registration in November (3-day is expected to be $950 or $975, and will open in January or February).</p><h2 id="all-together-now" class="ps-heading">All Together Now<a class="ps-heading-anchor" href="#all-together-now" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Monday (the first day you can attend on a 3-day pass) will feature an opening keynote by myself, a full session with ShellFather Jeffrey Snover, an update on PowerShell from team leaders, and our now-famous Lightning Demos from various developers on the team. We&rsquo;ll finish the day with a grand reception, where you can mix and mingle with everyone you&rsquo;ve seen, and enjoy some quality food and beverages.</p><h2 id="breakout" class="ps-heading">Breakout!<a class="ps-heading-anchor" href="#breakout" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>All day Tuesday, as well as Wednesday morning, we&rsquo;ll feature our usual 45-minute breakout sessions on a huge variety of deep topics. We&rsquo;ll be covering DSC, pull servers, JEA, best practices, security, and SO much more, including sessions delivered by members of the PowerShell product team. We&rsquo;ve got a full three tracks - more than last year! - of content planned.</p><h2 id="par-ti-ci-pa-tion" class="ps-heading">Par-ti-ci-pa-tion<a class="ps-heading-anchor" href="#par-ti-ci-pa-tion" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>We&rsquo;ve noticed that Wednesday afternoons can drag a bit - so after lunch, we&rsquo;re going to roll out some great snacks and drinks. Wednesday afternoon will get more interactive, with a variety of Community Lightning Demos (sign up on site with the moderator), panel discussions, focus groups, and more.</p><h2 id="on-the-air" class="ps-heading">On The Air<a class="ps-heading-anchor" href="#on-the-air" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>We&rsquo;ve expanded and refined our session recording capabilities, and you can expect better audio, as well as screen-capture recordings for every session (barring technical difficulties), something we haven&rsquo;t been previously able to do with this much content. All sessions are made available on YouTube within a couple of weeks of the event&rsquo;s conclusion (we do not live-stream, and we won&rsquo;t be posting sessions instantly each day).</p><h2 id="networking" class="ps-heading">Networking<a class="ps-heading-anchor" href="#networking" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>It ain&rsquo;t just for routers and switches - Summit remains dedicated to providing plenty of face time with your fellow PowerShell and DevOps enthusiasts. We&rsquo;ll offer additional evening fun (anyone interested in a trip to the Microsoft Museum one evening? We&rsquo;re looking into it), side rooms for breakout conversations, and of course we encourage everyone to <em>participate</em> in breakout sessions by offering comments and asking questions.</p><h2 id="extra-bits" class="ps-heading">Extra Bits<a class="ps-heading-anchor" href="#extra-bits" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>2017 will be the Fifth Anniversary of Summit, and so we&rsquo;re bringing along some extra swag and collectible opportunities. If you attended in 2016, bring your 1-inch button to wear around your badge lanyard and show your alumni status (we&rsquo;ll have 2017 buttons, too). Some merchandise will only be available as an advance purchase, so watch PowerShell.org for details; other merch might be available on-site, but in very limited quantities, so be sure to get that 4-day pass!</p><h2 id="mark-your-calendars" class="ps-heading">Mark Your Calendars<a class="ps-heading-anchor" href="#mark-your-calendars" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Sunday-Wednesday passes will open for registration the first week of November, 2016; we expect Monday-Wednesday passes to become available in January or February. As always, registration is limited to about 200 attendees (plus our speakers and the product team members), so _don&rsquo;t delay. _Because registrations are nonrefundable, we do not maintain a waitlist, and we fully expect to sell out - as we have every year.</p>
]]></content:encoded></item><item><title>Nearing Last Call for PowerShell Summit Topic Proposals (+ Topic Ideas!)</title><link>https://powershell.org/articles/2016-09-06-nearing-last-call-for-powershell-summit-topic-proposals-topic-ideas/</link><guid>https://powershell.org/articles/2016-09-06-nearing-last-call-for-powershell-summit-topic-proposals-topic-ideas/</guid><pubDate>Tue, 06 Sep 2016 14:04:52 +0000</pubDate><description>&lt;p&gt;Remember that our &lt;a href="https://powershell.org/2016/08/01/powershell-and-devops-global-summit-2017-call-for-topics/"&gt;Call for Topics is still open&lt;/a&gt; until the end of September, if you&amp;rsquo;d like to submit. And, from our Summit Alumni Slack channel, here are a few things people said they&amp;rsquo;d like to see&amp;hellip;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I would love to see a session on what it takes to build a PKI infrastructure in support of PowerShell operations ( stuff liked passing creds with DSC ) - this is something glossed over all the time as if it is not a big deal but I think it can be quite challenging for a lot of people to implement.&lt;/li&gt;
&lt;li&gt;Writing for Performance: Tips and Tricks to Write Faster Code&lt;/li&gt;
&lt;li&gt;Compiled cmdlets - how to create them and why you might want to (this got a &lt;strong&gt;lot&lt;/strong&gt; of thumbs-up)&lt;/li&gt;
&lt;li&gt;Open source PowerShell hackathon.  Either one multi-hour (2, 3, 4?) window where people can break into groups and work on some open source PowerShell extension, or two sessions, one at the beginning of the event and one at the end.  The one at the beginning the presenters/organizers provide a set of possible project ideas to work on, and people interested can sign up/vote for projects which creates groups.  The one at the end gives groups an opportunity to share/demo what they produced.  Having a room where people can gather to work on it would be cool.  These don&amp;rsquo;t have to be big projects.  They could be small things, like knocking off one or more issues for an open source project.  The end goal is to have a pull request submitted or a new project posted in GitHub or a new module submitted in the Gallery. _Now, to be clear, this isn&amp;rsquo;t a session - but you can definitely propose it. We have some longer time slots on Wednesday for panels, and this might be something you could do then. _&lt;/li&gt;
&lt;li&gt;examples of real world DSC usage - that was a comment I heard from a number of folks this year&lt;/li&gt;
&lt;li&gt;Practical Pipelines. ( Illustrate that release pipelines aren&amp;rsquo;t just for DevOps-practicing shops, or public-facing software )&lt;/li&gt;
&lt;li&gt;Build plans (and tools, like psake)&lt;/li&gt;
&lt;li&gt;Module design best practices (lots of thumbs-up on this one)&lt;/li&gt;
&lt;li&gt;Working with Open Source Projects (as a Contributor)&lt;/li&gt;
&lt;li&gt;Working with Open Source Projects (as a Maintainer)&lt;/li&gt;
&lt;li&gt;Applying Agile Software Development Methodologies to PowerShell&lt;/li&gt;
&lt;li&gt;Using for . (assumption: someone writes the equivalent of inspec wrapped around Pester)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And if you read the above carefully, you&amp;rsquo;ll notice that **we do also have some space for afternoon panels on Wednesday - so if there&amp;rsquo;s a group discussion you&amp;rsquo;d like to lead, propose it! **Just be clear in the description you submit that you&amp;rsquo;re proposing a panel. It&amp;rsquo;ll be up to you to recruit panel members, which you can do on-site. We&amp;rsquo;ll announce panels in need of panelists and direct them to you.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Remember that our<a href="https://powershell.org/2016/08/01/powershell-and-devops-global-summit-2017-call-for-topics/">Call for Topics is still open</a> until the end of September, if you&rsquo;d like to submit. And, from our Summit Alumni Slack channel, here are a few things people said they&rsquo;d like to see&hellip;</p><ul><li>I would love to see a session on what it takes to build a PKI infrastructure in support of PowerShell operations ( stuff liked passing creds with DSC ) - this is something glossed over all the time as if it is not a big deal but I think it can be quite challenging for a lot of people to implement.</li><li>Writing for Performance: Tips and Tricks to Write Faster Code</li><li>Compiled cmdlets - how to create them and why you might want to (this got a <strong>lot</strong> of thumbs-up)</li><li>Open source PowerShell hackathon.  Either one multi-hour (2, 3, 4?) window where people can break into groups and work on some open source PowerShell extension, or two sessions, one at the beginning of the event and one at the end.  The one at the beginning the presenters/organizers provide a set of possible project ideas to work on, and people interested can sign up/vote for projects which creates groups.  The one at the end gives groups an opportunity to share/demo what they produced.  Having a room where people can gather to work on it would be cool.  These don&rsquo;t have to be big projects.  They could be small things, like knocking off one or more issues for an open source project.  The end goal is to have a pull request submitted or a new project posted in GitHub or a new module submitted in the Gallery. _Now, to be clear, this isn&rsquo;t a session - but you can definitely propose it. We have some longer time slots on Wednesday for panels, and this might be something you could do then. _</li><li>examples of real world DSC usage - that was a comment I heard from a number of folks this year</li><li>Practical Pipelines. ( Illustrate that release pipelines aren&rsquo;t just for DevOps-practicing shops, or public-facing software )</li><li>Build plans (and tools, like psake)</li><li>Module design best practices (lots of thumbs-up on this one)</li><li>Working with Open Source Projects (as a Contributor)</li><li>Working with Open Source Projects (as a Maintainer)</li><li>Applying Agile Software Development Methodologies to PowerShell</li><li>Using for . (assumption: someone writes the equivalent of inspec wrapped around Pester)</li></ul><p>And if you read the above carefully, you&rsquo;ll notice that **we do also have some space for afternoon panels on Wednesday - so if there&rsquo;s a group discussion you&rsquo;d like to lead, propose it! **Just be clear in the description you submit that you&rsquo;re proposing a panel. It&rsquo;ll be up to you to recruit panel members, which you can do on-site. We&rsquo;ll announce panels in need of panelists and direct them to you.</p>
]]></content:encoded></item><item><title>Unit Testing is “Pestering” the Hell Out Of Me</title><link>https://powershell.org/articles/2016-09-02-unit-testing-is-pestering-the-hell-out-of-me/</link><guid>https://powershell.org/articles/2016-09-02-unit-testing-is-pestering-the-hell-out-of-me/</guid><pubDate>Fri, 02 Sep 2016 17:31:14 +0000</pubDate><description>&lt;p&gt;About a week or two before Devops Camp, the attendees were asked how much experience they had using Pester, because another attendee was preparing a discussion on Pester and wanted to gauge the other attendees’ comfort level. Learning Pester had been on my to-do list for a while, but I had procrastinated on it for far longer than I intended. I answered “Beginner” - although “complete and utter newbie” would have been more accurate - and I vowed to spend some quality time looking at Pester before arriving at camp.&lt;br&gt;
There are some really great resources out there devoted to Pester, from beginner to intermediate to way-over-my-head. I read articles and watched videos. And I understood, in a conceptual kind of way, how to use Pester. Describe, Context, It, Mock, Assert-MockCalled – I understood what these things were used for. The examples made sense. I was ready to move on to trying it myself. But here is where I stumbled and recovered, and I would like your feedback and opinions on my discoveries.&lt;br&gt;
I took a piece of code I was currently working on and decided that a small function in that code was the perfect function to attempt my first unit test on. I mean, it was the tiniest little function - 7 lines of code! What could possibly be easier? Right?&lt;br&gt;
Boy, was I wrong. The struggle IS real.&lt;br&gt;
In a nutshell, my function really is 7 lines – an If/Else statement and a For-loop – and inside each is an external call to an Active Directory cmdlet. Those would definitely need to be mocked. After all, we know or assume that Set-ADAccountControl and Set-ADObject do what they are supposed to. I was stumped at where to even start because after mocking these external calls – there isn’t actually anything left to the code!&lt;br&gt;
Even after a wise person told me that “This probably isn’t a great example of a “Pester 101” example”, I was still determined to figure out how to write a Pester test to test this function, but I needed to set aside my thoughts of “I can’t figure out how to write a Pester test for this” and instead, start with “Figure out how to write a unit test for this.” My brain freeze wasn’t about Pester – it was about unit testing. What do I need to test? My next step was to do some reading up on general unit testing concepts.&lt;br&gt;
I’m not opposed to buying a book on testing concepts, but I wanted some quick answers and not a research project just to get me started. I turned to “Dr. Google” and I found some useful definitions, both formal and informal, on what unit testing really is. But it wasn’t until I found a comment buried deep in a StackExchange forum post that I realized what my next steps were.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>About a week or two before Devops Camp, the attendees were asked how much experience they had using Pester, because another attendee was preparing a discussion on Pester and wanted to gauge the other attendees’ comfort level. Learning Pester had been on my to-do list for a while, but I had procrastinated on it for far longer than I intended. I answered “Beginner” - although “complete and utter newbie” would have been more accurate - and I vowed to spend some quality time looking at Pester before arriving at camp.<br>
There are some really great resources out there devoted to Pester, from beginner to intermediate to way-over-my-head. I read articles and watched videos. And I understood, in a conceptual kind of way, how to use Pester. Describe, Context, It, Mock, Assert-MockCalled – I understood what these things were used for. The examples made sense. I was ready to move on to trying it myself. But here is where I stumbled and recovered, and I would like your feedback and opinions on my discoveries.<br>
I took a piece of code I was currently working on and decided that a small function in that code was the perfect function to attempt my first unit test on. I mean, it was the tiniest little function - 7 lines of code! What could possibly be easier? Right?<br>
Boy, was I wrong. The struggle IS real.<br>
In a nutshell, my function really is 7 lines – an If/Else statement and a For-loop – and inside each is an external call to an Active Directory cmdlet. Those would definitely need to be mocked. After all, we know or assume that Set-ADAccountControl and Set-ADObject do what they are supposed to. I was stumped at where to even start because after mocking these external calls – there isn’t actually anything left to the code!<br>
Even after a wise person told me that “This probably isn’t a great example of a “Pester 101” example”, I was still determined to figure out how to write a Pester test to test this function, but I needed to set aside my thoughts of “I can’t figure out how to write a Pester test for this” and instead, start with “Figure out how to write a unit test for this.” My brain freeze wasn’t about Pester – it was about unit testing. What do I need to test? My next step was to do some reading up on general unit testing concepts.<br>
I’m not opposed to buying a book on testing concepts, but I wanted some quick answers and not a research project just to get me started. I turned to “Dr. Google” and I found some useful definitions, both formal and informal, on what unit testing really is. But it wasn’t until I found a comment buried deep in a StackExchange forum post that I realized what my next steps were.</p><p><strong>Red-Green-Refactor-Repeat</strong><br><strong>Red:</strong> Write a test that fails.<br><strong>Green:</strong> Write the simplest code that makes the test pass. For the first pass, don’t handle edge cases, just enough to make the test pass.<br><strong>Refactor:</strong> Clean up the code and optimize if necessary. Make sure the test still passes.<br><strong>Repeat:</strong> Now think about handling those edge cases and repeat the previous steps with tests, then code, to handle them.<br>
The entire thread can be found here and the detailed explanation of the Red-Green-Refactor-Repeat concept in the comments is definitely worth a read:<br><a href="http://programmers.stackexchange.com/questions/750/what-should-you-test-with-unit-tests">http://programmers.stackexchange.com/questions/750/what-should-you-test-with-unit-tests</a></p><p>When I started thinking about writing this article, I knew that I was struggling with the concept of unit testing and I had planned to include the code that I was looking to test as part of the blog. After doing the reading to try to wrap my brain around the concepts, I changed my approach. I’ve decided to scrap the original version of this code and try to use the above approach to re-develop the function instead. I plan to blog about my journey through this process in a future post.<br>
Until then, I’d like to initiate a dialog with you, the readers: How do you approach unit testing? What is your thought process? What do you feel is important or not important to include in a unit test?</p>
]]></content:encoded></item></channel></rss>