&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 October 2013 on PowerShell.org - Welcome Automaters!</title><link>https://powershell.org/articles/2013/10/</link><description>Recent content in Articles from October 2013 on PowerShell.org - Welcome Automaters!</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://powershell.org/articles/2013/10/index.xml" rel="self" type="application/rss+xml"/><item><title>PowerShell "Scripting and Toolmaking" Classroom Training Course Now Available to Microsoft Training Centers</title><link>https://powershell.org/articles/2013-10-28-powershell-scripting-and-toolmaking-classroom-training-course-now-available-to-microsoft-training-centers/</link><guid>https://powershell.org/articles/2013-10-28-powershell-scripting-and-toolmaking-classroom-training-course-now-available-to-microsoft-training-centers/</guid><pubDate>Mon, 28 Oct 2013 17:11:03 +0000</pubDate><description>&lt;p&gt;Attention Microsoft training centers! Microsoft&amp;rsquo;s Courseware Marketplace now offers course 55039AC, &amp;ldquo;Windows PowerShell Scripting and Toolmaking.&amp;rdquo; Designed as a 5-day course, it&amp;rsquo;s a spiritual &amp;ldquo;Part 2&amp;rdquo; to Microsoft Official Curriculum course 10961.&lt;br&gt;
With 10961, the goal was to provide a founding in PowerShell basics, in a somewhat product-neutral way. That is, the course doesn&amp;rsquo;t cover Exchange, or SharePoint, or AD; it focuses on pure PowerShell. Unlike its predecessor, 10325, the 10961 course kind of &amp;ldquo;stops short&amp;rdquo; of actual scripting. It shows you how to build a parameterized script, but doesn&amp;rsquo;t dig into advanced functions, debugging, error handling, and the like. There was a feeling - which has been largely upheld through customer feedback - that a sizable audience needed to get the shell basics under their belt, and weren&amp;rsquo;t necessarily comfortable leaping into coding. 10325 kind of breezed through scripting at a somewhat high level, and didn&amp;rsquo;t have time to offer much in the way of practices and other guidance, and it didn&amp;rsquo;t really set you up for building reusable units of automation.&lt;br&gt;
That&amp;rsquo;s where 55039AC comes in. It is a scripting class, pure and simple, and it focuses on building reusable units of automation according to best practices and patterns. More time is devoted to design, structure, procedural error handling, and so on. There&amp;rsquo;s also deeper coverage of module building, including building custom formatting views, and there&amp;rsquo;s even an introduction to Workflow. Although designed for v3, the course is pretty version-agnostic, meaning it&amp;rsquo;s suitable for someone who wants to use PowerShell v2, v3, or beyond. And, because it&amp;rsquo;s a Courseware Marketplace offering, it&amp;rsquo;s compatible with Software Assurance (SA) training vouchers.&lt;br&gt;
Training centers are welcome to combine 10961 and 55039 to create an &amp;ldquo;accelerated&amp;rdquo; class that includes heavier scripting coverage than 10961 alone. I do that myself, actually, although it&amp;rsquo;s a pretty hardcore week. If you&amp;rsquo;re interested in doing that, &lt;a href="http://concentratedtech.com/contact"&gt;contact me&lt;/a&gt; and I can provide some of the accelerated-delivery outlines that I use.&lt;br&gt;
55039&amp;rsquo;s modules are all standalone - with a twist. Students are encouraged to use and evolve a single code project throughout several modules. However, if you&amp;rsquo;re not teaching all of the modules, or if a student falls behind, each lab comes with a complete &amp;ldquo;starting point&amp;rdquo; that keeps everyone on the same page.&lt;br&gt;
55039 has already been beta-taught, and of course I &lt;a href="http://concentratedtech.com/contact"&gt;welcome feedback&lt;/a&gt; if you&amp;rsquo;ve taught the course or taken it as a student.&lt;br&gt;
My company also offers licensing for this course outside the Courseware Marketplace, mainly geared to training centers who want an unlimited perpetual license to reproduce the course materials on their own. We know courseware costs are a significant concern, so we&amp;rsquo;re trying to offer something reasonable there.&lt;br&gt;
Both 10961 and 55039 (or at least a subset of 55039; we&amp;rsquo;re still working on exactly what) will be considered pre-requisites for the upcoming 3-day 10962 course, which will focus on advanced PowerShell techniques for us in production environments, including database connectivity, report generation, and so on.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Attention Microsoft training centers! Microsoft&rsquo;s Courseware Marketplace now offers course 55039AC, &ldquo;Windows PowerShell Scripting and Toolmaking.&rdquo; Designed as a 5-day course, it&rsquo;s a spiritual &ldquo;Part 2&rdquo; to Microsoft Official Curriculum course 10961.<br>
With 10961, the goal was to provide a founding in PowerShell basics, in a somewhat product-neutral way. That is, the course doesn&rsquo;t cover Exchange, or SharePoint, or AD; it focuses on pure PowerShell. Unlike its predecessor, 10325, the 10961 course kind of &ldquo;stops short&rdquo; of actual scripting. It shows you how to build a parameterized script, but doesn&rsquo;t dig into advanced functions, debugging, error handling, and the like. There was a feeling - which has been largely upheld through customer feedback - that a sizable audience needed to get the shell basics under their belt, and weren&rsquo;t necessarily comfortable leaping into coding. 10325 kind of breezed through scripting at a somewhat high level, and didn&rsquo;t have time to offer much in the way of practices and other guidance, and it didn&rsquo;t really set you up for building reusable units of automation.<br>
That&rsquo;s where 55039AC comes in. It is a scripting class, pure and simple, and it focuses on building reusable units of automation according to best practices and patterns. More time is devoted to design, structure, procedural error handling, and so on. There&rsquo;s also deeper coverage of module building, including building custom formatting views, and there&rsquo;s even an introduction to Workflow. Although designed for v3, the course is pretty version-agnostic, meaning it&rsquo;s suitable for someone who wants to use PowerShell v2, v3, or beyond. And, because it&rsquo;s a Courseware Marketplace offering, it&rsquo;s compatible with Software Assurance (SA) training vouchers.<br>
Training centers are welcome to combine 10961 and 55039 to create an &ldquo;accelerated&rdquo; class that includes heavier scripting coverage than 10961 alone. I do that myself, actually, although it&rsquo;s a pretty hardcore week. If you&rsquo;re interested in doing that,<a href="http://concentratedtech.com/contact">contact me</a> and I can provide some of the accelerated-delivery outlines that I use.<br>
55039&rsquo;s modules are all standalone - with a twist. Students are encouraged to use and evolve a single code project throughout several modules. However, if you&rsquo;re not teaching all of the modules, or if a student falls behind, each lab comes with a complete &ldquo;starting point&rdquo; that keeps everyone on the same page.<br>
55039 has already been beta-taught, and of course I<a href="http://concentratedtech.com/contact">welcome feedback</a> if you&rsquo;ve taught the course or taken it as a student.<br>
My company also offers licensing for this course outside the Courseware Marketplace, mainly geared to training centers who want an unlimited perpetual license to reproduce the course materials on their own. We know courseware costs are a significant concern, so we&rsquo;re trying to offer something reasonable there.<br>
Both 10961 and 55039 (or at least a subset of 55039; we&rsquo;re still working on exactly what) will be considered pre-requisites for the upcoming 3-day 10962 course, which will focus on advanced PowerShell techniques for us in production environments, including database connectivity, report generation, and so on.</p>
]]></content:encoded></item><item><title>Why Get-Content Ain't Yer Friend</title><link>https://powershell.org/articles/2013-10-21-why-get-content-aint-yer-friend/</link><guid>https://powershell.org/articles/2013-10-21-why-get-content-aint-yer-friend/</guid><pubDate>Mon, 21 Oct 2013 20:18:41 +0000</pubDate><description>&lt;p&gt;Well, it isn&amp;rsquo;t your &lt;em&gt;enemy&lt;/em&gt;, of course, but it&amp;rsquo;s definitely a tricky little beast.&lt;br&gt;
Get-Content is quickly becoming my nemesis, because it&amp;rsquo;s sucking a lot of PowerShell newcomers into its insidious little trap. Actually, the real problem is that most newcomers don&amp;rsquo;t really understand that PowerShell is an object-oriented, rather than a text-oriented shell; they&amp;rsquo;re trying to treat Get-Content like the old Type command (and why not? &lt;strong&gt;type&lt;/strong&gt; is an alias to Get-Content in PowerShell, isn&amp;rsquo;t it?), and failing.&lt;br&gt;
Worse, PowerShell has just enough under-the-hood smarts to make &lt;em&gt;some&lt;/em&gt; things work, but not _everything. _&lt;br&gt;
For example, this works to replace all instances of &amp;ldquo;t&amp;rdquo; with &amp;ldquo;x&amp;rdquo; in the file test.txt, outputting the result to new.txt:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Well, it isn&rsquo;t your <em>enemy</em>, of course, but it&rsquo;s definitely a tricky little beast.<br>
Get-Content is quickly becoming my nemesis, because it&rsquo;s sucking a lot of PowerShell newcomers into its insidious little trap. Actually, the real problem is that most newcomers don&rsquo;t really understand that PowerShell is an object-oriented, rather than a text-oriented shell; they&rsquo;re trying to treat Get-Content like the old Type command (and why not?<strong>type</strong> is an alias to Get-Content in PowerShell, isn&rsquo;t it?), and failing.<br>
Worse, PowerShell has just enough under-the-hood smarts to make <em>some</em> things work, but not _everything. _<br>
For example, this works to replace all instances of &ldquo;t&rdquo; with &ldquo;x&rdquo; in the file test.txt, outputting the result to new.txt:</p><p><code>$x = Get-Content test.txt $x -replace "t","x" | Out-File new.txt</code>Sadly, this reinforces - for newcomers - the notion that Get-Content is just reading in the text file as a big chunk o&rsquo; text.<br>
Nope.<br>
You see, in reality, Get-Content reads _each line of the file individually,_and returns _collection of System.String objects. _It &ldquo;loses&rdquo; the carriage returns from the file at the same time. But you&rsquo;d never know that, because when PowerShell <em>displays</em> a collection of strings, it displays them _one object per line and inserts carriage returns._So if you do this, it&rsquo;ll look like you&rsquo;re dealing with a big hunk o&rsquo; text:</p><p><code>$x = Get-Content test.txt $x</code>But you&rsquo;re not. $x, in that example, is a<em>collection of objects,</em> not a single string.<br>
Never fear - you can make sense of this. First, if you use the <strong>-Raw</strong> parameter of Get-Content (available in v3+), it does in fact read the entire file as a big ol&rsquo; string, preserving carriage returns instead of using them to separate the file into single-line string objects. In v2, you can achieve something similar by using Out-String:</p><p><code>$x = Get-Content test.txt | Out-String</code>So if you just <em>need</em> to work with a big ol&rsquo; string, you can. Alternately, you might find that some operations are quicker when you actually do work line-by-line. For example, asking PowerShell to do a regex replace on a huge string can consume a ton of memory; working with one line at a time is often quicker. Just use a foreach:</p><p><code>ForEach ($line in (Get-Content test.txt)) { $line -replace "\d","x" | Out-File new.txt -Append }</code>Of course, don&rsquo;t <em>assume</em> it&rsquo;ll be quicker - Measure-Command lets you test different approaches, so you can see which one is <em>actually</em> quicker.<br>
You should also consider <em>not</em> using Get-Content, especially with very large files. That&rsquo;s because it wants to read the <em>entire</em> file into memory at once, at that can take a lot of memory - not to mention a bit more processor power, swap file space, or whatever else.<br>
Instead, read your file from disk one line at a time, work with each line, and then (if that&rsquo;s your intent) write each line back out to disk. Instead of caching the entire file in RAM, you&rsquo;re reading it off disk one line at a time.</p><p>`$file = New-Object System.IO.StreamReader -Arg &ldquo;test.txt&rdquo;
while ($line = $file.ReadLine()) {</p><h1 id="line-has-your-line" class="ps-heading">$line has your line<a class="ps-heading-anchor" href="#line-has-your-line" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>}
$file.close()
`Or at least something like that. Yeah, welcome to .NET Framework. Other options available to the Framework include reading a text file in chunks - again, to help conserve memory and improve processing speed, but not necessarily making you read line-by-line.<br>
Whatever approach you choose, just remember that, by default, Get-Content isn&rsquo;t just reading a stream of text all at once. You&rsquo;ll be getting, and need to be prepared to deal with, a <em>collection</em> of objects. Those will often require that you enumerate them (line by line, in other words) using a foreach construct, and with large files the act of reading the entire file might negatively impact performance and system resources.<br>
Knowing is half the battle!</p>
]]></content:encoded></item><item><title>The Shell vs. The Host</title><link>https://powershell.org/articles/2013-10-19-the-shell-vs-the-host/</link><guid>https://powershell.org/articles/2013-10-19-the-shell-vs-the-host/</guid><pubDate>Sat, 19 Oct 2013 18:03:11 +0000</pubDate><description>&lt;p&gt;One thing that&amp;rsquo;s often &lt;em&gt;very&lt;/em&gt; confusing about PowerShell is the difference between the shell itself - what I&amp;rsquo;ll call &lt;em&gt;the engine&lt;/em&gt; in this article - and the application that hosts the engine.&lt;br&gt;
You see, you as a human being can&amp;rsquo;t really interact directly with PowerShell&amp;rsquo;s engine. Instead, you need a &lt;em&gt;host application&lt;/em&gt; that lets you do so. The standard console - PowerShell.exe - is one such host; the Integrated Script Environment (ISE) is another. Those hosts &amp;ldquo;spin up&amp;rdquo; a _runspace, _which is essentially an instance of the PowerShell engine. When you type a command and hit enter, the host creates a pipeline, jams your command into it, and then deals with the output.&lt;br&gt;
A number of standardized PowerShell commands actually require the host to implement some kind of command support. For example, most of the core Write- cmdlets actually depend upon the host to do something. Write-Verbose is a great example: The command causes the engine to spew text into the Verbose pipeline; the host is responsible for doing something with it. In the case of the console host, the Verbose text is displayed as yellow text (by default) preceded by the word &amp;ldquo;VERBOSE:&amp;rdquo;.&lt;br&gt;
When you develop a script using the ISE or the console (which behave pretty similarly for most of the core commands), you get used to your script behaving in a certain way. If you then move that script over to another host - perhaps a runbook automation system that runs PowerShell scripts by hosting the engine, rather than by launching PowerShell.exe - you may get entirely different behavior.&lt;br&gt;
Here&amp;rsquo;s a perfect example: most of the &amp;ldquo;built-in&amp;rdquo; variables you&amp;rsquo;re used to working with in the ISE or the console aren&amp;rsquo;t actually built into the _engine, _they&amp;rsquo;re built into those _hosts. _For example, since the host is responsible for presenting verbose output, the &lt;em&gt;host&lt;/em&gt; is what creates and uses the $VerbosePreference variable. When your script is running in a different host, $VerbosePreference may not exist, and indeed verbose output may simply be ignored. An off-the-shelf PowerShell runspace doesn&amp;rsquo;t actually come with very much &amp;ldquo;built-in&amp;rdquo; at all, so scripts can behave &lt;em&gt;very&lt;/em&gt; differently.&lt;br&gt;
It&amp;rsquo;s pretty important to understand these potential differences. When a developer sets out to create their own host application - like most of the commercial script editors do - it can be very confusing and frustrating, because they essentially have to reverse-engineer much of what the PowerShell.exe console application is doing, so that they can provide an equivalent experience. But you should never &lt;em&gt;assume&lt;/em&gt; that a script&amp;rsquo;s behavior under one host will be consistent in all other hosts; test and verify.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>One thing that&rsquo;s often <em>very</em> confusing about PowerShell is the difference between the shell itself - what I&rsquo;ll call <em>the engine</em> in this article - and the application that hosts the engine.<br>
You see, you as a human being can&rsquo;t really interact directly with PowerShell&rsquo;s engine. Instead, you need a <em>host application</em> that lets you do so. The standard console - PowerShell.exe - is one such host; the Integrated Script Environment (ISE) is another. Those hosts &ldquo;spin up&rdquo; a _runspace, _which is essentially an instance of the PowerShell engine. When you type a command and hit enter, the host creates a pipeline, jams your command into it, and then deals with the output.<br>
A number of standardized PowerShell commands actually require the host to implement some kind of command support. For example, most of the core Write- cmdlets actually depend upon the host to do something. Write-Verbose is a great example: The command causes the engine to spew text into the Verbose pipeline; the host is responsible for doing something with it. In the case of the console host, the Verbose text is displayed as yellow text (by default) preceded by the word &ldquo;VERBOSE:&rdquo;.<br>
When you develop a script using the ISE or the console (which behave pretty similarly for most of the core commands), you get used to your script behaving in a certain way. If you then move that script over to another host - perhaps a runbook automation system that runs PowerShell scripts by hosting the engine, rather than by launching PowerShell.exe - you may get entirely different behavior.<br>
Here&rsquo;s a perfect example: most of the &ldquo;built-in&rdquo; variables you&rsquo;re used to working with in the ISE or the console aren&rsquo;t actually built into the _engine, _they&rsquo;re built into those _hosts. _For example, since the host is responsible for presenting verbose output, the <em>host</em> is what creates and uses the $VerbosePreference variable. When your script is running in a different host, $VerbosePreference may not exist, and indeed verbose output may simply be ignored. An off-the-shelf PowerShell runspace doesn&rsquo;t actually come with very much &ldquo;built-in&rdquo; at all, so scripts can behave <em>very</em> differently.<br>
It&rsquo;s pretty important to understand these potential differences. When a developer sets out to create their own host application - like most of the commercial script editors do - it can be very confusing and frustrating, because they essentially have to reverse-engineer much of what the PowerShell.exe console application is doing, so that they can provide an equivalent experience. But you should never <em>assume</em> that a script&rsquo;s behavior under one host will be consistent in all other hosts; test and verify.</p>
]]></content:encoded></item><item><title>More Summit Speaker Names Leaked</title><link>https://powershell.org/articles/2013-10-18-more-summit-speaker-names-leaked/</link><guid>https://powershell.org/articles/2013-10-18-more-summit-speaker-names-leaked/</guid><pubDate>Fri, 18 Oct 2013 16:36:24 +0000</pubDate><description>&lt;p&gt;So, I got hold of one of the Summit planning spreadsheets and have the list of speaker names. Now, these folks haven&amp;rsquo;t yet confirmed, so there are obviously possible changes, but here&amp;rsquo;s who&amp;rsquo;ll be invited based on their proposals:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Augh, they caught me! The &lt;strong&gt;complete&lt;/strong&gt; session list isn&amp;rsquo;t yet finalized, and there are a few on the &amp;ldquo;final cut list&amp;rdquo; that may not actually physically fit, so stay tuned&amp;hellip;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Lotta Jasons in there. Hmm, maybe I shouldn&amp;rsquo;t put Helmick in charge of this again. He appears to be partial. There&amp;rsquo;s also several slots for PowerShell product team members that haven&amp;rsquo;t yet been sorted; they may come in a bit closer to the show, once the team has a better grip on their short-term work schedule.&lt;br&gt;
That&amp;rsquo;s about &lt;strong&gt;63 sessions total&lt;/strong&gt;. Wow. We&amp;rsquo;re planning to run continuous sessions from 9am to noon, and then from 1pm to 5pm every day, spread across three tracks. There&amp;rsquo;ll also be welcome address at 8:15am Monday morning.&lt;br&gt;
Please - tell a colleague. Help us get the word out, because this is going to be _amazing. _&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>So, I got hold of one of the Summit planning spreadsheets and have the list of speaker names. Now, these folks haven&rsquo;t yet confirmed, so there are obviously possible changes, but here&rsquo;s who&rsquo;ll be invited based on their proposals:</p><ul><li>Augh, they caught me! The <strong>complete</strong> session list isn&rsquo;t yet finalized, and there are a few on the &ldquo;final cut list&rdquo; that may not actually physically fit, so stay tuned&hellip;</li></ul><p>Lotta Jasons in there. Hmm, maybe I shouldn&rsquo;t put Helmick in charge of this again. He appears to be partial. There&rsquo;s also several slots for PowerShell product team members that haven&rsquo;t yet been sorted; they may come in a bit closer to the show, once the team has a better grip on their short-term work schedule.<br>
That&rsquo;s about <strong>63 sessions total</strong>. Wow. We&rsquo;re planning to run continuous sessions from 9am to noon, and then from 1pm to 5pm every day, spread across three tracks. There&rsquo;ll also be welcome address at 8:15am Monday morning.<br>
Please - tell a colleague. Help us get the word out, because this is going to be _amazing. _</p>
]]></content:encoded></item><item><title>Desired State Configuration – General Availability Changes</title><link>https://powershell.org/articles/2013-10-18-desired-state-configuration-general-availability-changes/</link><guid>https://powershell.org/articles/2013-10-18-desired-state-configuration-general-availability-changes/</guid><pubDate>Fri, 18 Oct 2013 13:19:21 +0000</pubDate><description>&lt;p&gt;PowerShell DSC, along with Windows Server 2012 R2 has reached General Availability!  Yay!&lt;br&gt;
However, there is (at least one so far) &lt;em&gt;&lt;strong&gt;breaking change&lt;/strong&gt;&lt;/em&gt;** **in Desired State Configuration (DSC).&lt;br&gt;
Fortunately, the change is in an area I haven&amp;rsquo;t blogged about yet.. creating custom resources.  Unfortunately, it does mean I&amp;rsquo;ll have to update the &lt;a href="https://github.com/PowerShellOrg/DSC"&gt;GitHub repository&lt;/a&gt; and all my internal content (should be done by early next week).&lt;br&gt;
The short version is that DSC resources are now resources inside modules, rather than each resource being independent modules.  The benefit of this is that now DSC resources won&amp;rsquo;t pollute the module scope, each resource won&amp;rsquo;t need its own psd1 file (the source module will require one though), and it provides an easier way to group resources, which wasn&amp;rsquo;t really possible before.&lt;br&gt;
So, with GA, resources should go under the module root in a folder DSCResources.  You can have one or more resources in one PowerShell module.  The PowerShell module version is what will be used for the resource version number, so if you have several resources, a version number bump affects all the resources in the module.&lt;br&gt;
I&amp;rsquo;ll be picking back up with the DSC series next week with how to configure DSC clients, so stay tuned.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>PowerShell DSC, along with Windows Server 2012 R2 has reached General Availability!  Yay!<br>
However, there is (at least one so far)<em><strong>breaking change</strong></em>** **in Desired State Configuration (DSC).<br>
Fortunately, the change is in an area I haven&rsquo;t blogged about yet.. creating custom resources.  Unfortunately, it does mean I&rsquo;ll have to update the<a href="https://github.com/PowerShellOrg/DSC">GitHub repository</a> and all my internal content (should be done by early next week).<br>
The short version is that DSC resources are now resources inside modules, rather than each resource being independent modules.  The benefit of this is that now DSC resources won&rsquo;t pollute the module scope, each resource won&rsquo;t need its own psd1 file (the source module will require one though), and it provides an easier way to group resources, which wasn&rsquo;t really possible before.<br>
So, with GA, resources should go under the module root in a folder DSCResources.  You can have one or more resources in one PowerShell module.  The PowerShell module version is what will be used for the resource version number, so if you have several resources, a version number bump affects all the resources in the module.<br>
I&rsquo;ll be picking back up with the DSC series next week with how to configure DSC clients, so stay tuned.</p>
]]></content:encoded></item><item><title>Did you attend the 2013 PowerShell Summit?</title><link>https://powershell.org/articles/2013-10-17-did-you-attend-the-2013-powershell-summit/</link><guid>https://powershell.org/articles/2013-10-17-did-you-attend-the-2013-powershell-summit/</guid><pubDate>Thu, 17 Oct 2013 15:45:10 +0000</pubDate><description>&lt;p&gt;I&amp;rsquo;m looking to hear from folks who attended the PowerShell Summit North America 2013. Specifically, I&amp;rsquo;d love to hear what you thought of it. What value did you get? If someone were considering attending in 2014, what advice would you offer them? How should they approach the boss? What did you, personally, &amp;ldquo;take home&amp;rdquo; from the Summit in the way of new information or skills?&lt;br&gt;
Drop a comment below. Some comments might be re-published as standalone posts as we try to help people understand what the Summit is all about, and why they might want to attend. Thanks!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I&rsquo;m looking to hear from folks who attended the PowerShell Summit North America 2013. Specifically, I&rsquo;d love to hear what you thought of it. What value did you get? If someone were considering attending in 2014, what advice would you offer them? How should they approach the boss? What did you, personally, &ldquo;take home&rdquo; from the Summit in the way of new information or skills?<br>
Drop a comment below. Some comments might be re-published as standalone posts as we try to help people understand what the Summit is all about, and why they might want to attend. Thanks!</p>
]]></content:encoded></item><item><title>Why the HECK Do You Want to be Taught .NET in a PowerShell Class?!?!?!</title><link>https://powershell.org/articles/2013-10-15-why-the-heck-do-you-want-to-be-taught-net-in-a-powershell-class/</link><guid>https://powershell.org/articles/2013-10-15-why-the-heck-do-you-want-to-be-taught-net-in-a-powershell-class/</guid><pubDate>Tue, 15 Oct 2013 20:01:23 +0000</pubDate><description>&lt;p&gt;Ok, that post title is deliberately provocative. Twitter and all that.&lt;br&gt;
So look, we&amp;rsquo;re designed this advanced PowerShell class. One of the top five constant suggestions I get whenever I say &amp;ldquo;advanced&amp;rdquo; and &amp;ldquo;PowerShell&amp;rdquo; is &amp;ldquo;.NET Framework.&amp;rdquo;&lt;br&gt;
And I get it. When there&amp;rsquo;s no cmdlet, .NET has a ton of goodies that can solve a lot of problems. Maybe you don&amp;rsquo;t like turning to it, but you&amp;rsquo;ll do it if you have to.&lt;br&gt;
My problem is, what&amp;rsquo;s that look like &lt;em&gt;in a class?&lt;/em&gt;&lt;br&gt;
I mean, for me, using .NET basically works like this:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Ok, that post title is deliberately provocative. Twitter and all that.<br>
So look, we&rsquo;re designed this advanced PowerShell class. One of the top five constant suggestions I get whenever I say &ldquo;advanced&rdquo; and &ldquo;PowerShell&rdquo; is &ldquo;.NET Framework.&rdquo;<br>
And I get it. When there&rsquo;s no cmdlet, .NET has a ton of goodies that can solve a lot of problems. Maybe you don&rsquo;t like turning to it, but you&rsquo;ll do it if you have to.<br>
My problem is, what&rsquo;s that look like <em>in a class?</em><br>
I mean, for me, using .NET basically works like this:</p><ol><li>Spend hours on Google finding the .NET class that will do whatever I need done.</li><li>Look up class documentation on MSDN.</li><li>Fiddle around in PowerShell with properties and methods until I get what I want.</li></ol><p>I can totally see a class making #2 and #3 a little easier. That&rsquo;s just some basic experience, which is what a class helps build. The problem is, I can teach someone those steps in 30 minutes or less. The hard part is #1, and I truly don&rsquo;t know any way to &ldquo;teach&rdquo; that. You&rsquo;re either good at Google, or you aren&rsquo;t. I certainly can&rsquo;t provide some kind of mega-directory to the whole Framework - that&rsquo;s what bloody Google or MSDN Search is for.<br>
#3 can also be a hard part, because it requires you to know a bit about the underlying technology. It&rsquo;s easy to use .NET to resolve DNS names to IP addresses - IF you know how DNS works. If you don&rsquo;t, .NET is hard to use for that task. I can&rsquo;t turn a PowerShell class into a &ldquo;here&rsquo;s how ____ works, so that I can show you how to do it in .NET.&rdquo;<br>
So everytime I try to teach .NET in a PowerShell class, I end up showing people how to read the MSDN documentation, execute methods in PowerShell, and look at properties in PowerShell. Kinda boring. I mean, they&rsquo;re just freakin&rsquo; objects, right? Once you&rsquo;ve grasped &ldquo;objects,&rdquo; isn&rsquo;t .NET easy, assuming you&rsquo;ve done #1 and found the class you need?<br>
So if you were taking your dream class in &ldquo;advanced PowerShell,&rdquo; and you were all excited that it had a module on &ldquo;Using .NET Framework,&rdquo; <em><strong>exactly what would that module look</strong></em>** like**
? What would you want to be TAUGHT?<br>
Leave a comment. Tell me.<br>
(By the way, if your answer to the question is, &ldquo;I want to learn how to find what&rsquo;s in the .NET Framework,&rdquo; there&rsquo;s no need to leave a comment - we all want that, I&rsquo;ve just no clue how to teach it other than teaching you to be better at Google!)</p>
]]></content:encoded></item><item><title>Questions about an Advanced PowerShell Class Design</title><link>https://powershell.org/articles/2013-10-15-questions-about-an-advanced-powershell-class-design/</link><guid>https://powershell.org/articles/2013-10-15-questions-about-an-advanced-powershell-class-design/</guid><pubDate>Tue, 15 Oct 2013 19:45:18 +0000</pubDate><description>&lt;p&gt;As we continue collecting responses to an outline survey about an Advanced PowerShell class, I&amp;rsquo;ve come up with a couple of questions and would appreciate any feedback you&amp;rsquo;d care to leave here.&lt;br&gt;
Keep in mind that we&amp;rsquo;re a bit bound by this course being Microsoft Official Curriculum. I gotta make sure, in other words, that the average MCT can teach it. Ahem. I also have to face facts that people don&amp;rsquo;t read or obey course pre-requisite suggestions, and that a lot of people taking the course will have zero programming background.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>As we continue collecting responses to an outline survey about an Advanced PowerShell class, I&rsquo;ve come up with a couple of questions and would appreciate any feedback you&rsquo;d care to leave here.<br>
Keep in mind that we&rsquo;re a bit bound by this course being Microsoft Official Curriculum. I gotta make sure, in other words, that the average MCT can teach it. Ahem. I also have to face facts that people don&rsquo;t read or obey course pre-requisite suggestions, and that a lot of people taking the course will have zero programming background.</p><h2 id="question-1-gui" class="ps-heading">Question 1: GUI<a class="ps-heading-anchor" href="#question-1-gui" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>First, we desperately want to include some module on &ldquo;building friendly GUI tools for techs and end-users.&rdquo; It&rsquo;s a massively demanded topic. That said, hand-coding a GUI in either WinForms or WPF is physically painful and time-consuming, and nobody would do it. Asking the class to use SAPIEN PowerShell Studio is probably not on the table; Microsoft has rules, these days, about third-party applications in classes, even if they&rsquo;re free (which Studio isn&rsquo;t). Using Visual Studio to generate WPF XAML is probably also out of the question - it adds a lot of build effort for just a single module.<br>
So I&rsquo;m down to a couple of options. Option A would be to provide students with a basic module that used PowerShell commands to construct a WinForms GUI. They would have after-class access to the module, too. After all, the big thing to teach here is less about how to physically build a GUI (if you were serious about it, you&rsquo;d get PowerShell Studio), and more about the process of hooking up code to the GUI. By providing a module that shortcuts the hand-coding effort, we&rsquo;d get to the important bit.<br>
But there&rsquo;s also a valid perspective that creating little distributable GUI tools is dumb, and that you should be building Web-based ones instead. We could certainly build a module around a simple ASPX page - which is much easier to hand-code with a few examples in front of you - that hosts the PowerShell engine to execute PowerShell commands. They&rsquo;re centralized, great self-service tools, and easy to crank out once you&rsquo;ve got a pattern to work from (which we&rsquo;d provide in the class).<br>
Thoughts?</p><h2 id="question-2-workflow" class="ps-heading">Question 2: Workflow<a class="ps-heading-anchor" href="#question-2-workflow" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>We&rsquo;d originally proposed a workflow overview module, with a basic example. Folks have quite rightly commented that workflow isn&rsquo;t all it was hyped to be. It&rsquo;s slow, in many cases. It&rsquo;s hard. It isn&rsquo;t really PowerShell. There aren&rsquo;t a ton of killer examples that you can cover in the scope of a class.<br>
But it offers parallelization, which is a great feature. So we&rsquo;re considering replacing workflow with a module on parallelizing PowerShell. My thought is to do that mainly with jobs. Jobs work very consistently inside the shell, and are easy to use. They have some straightforward caveats, like the fact that they return serialized objects.<br>
There&rsquo;s an argument to be made for runspace pools, too. But those get very programmer-y. You have to start worrying about concurrency, thread safety, thread and pool management, and a lot more. I&rsquo;m not sure, in the context of a PowerShell class, we can sufficiently cover all those extras so that someone could be safely effective with runspace pools. I get that they&rsquo;re more flexible and low-level, but they&rsquo;re a big topic, and nothing else in the course &ldquo;leads up&rdquo; to that level of .NET programming.<br>
Thoughts?</p><h2 id="anything-else" class="ps-heading">Anything Else?<a class="ps-heading-anchor" href="#anything-else" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Any other suggestions aside from these two questions would be better served in the<a href="http://t.co/Pv7lmFsUWu">original survey</a>. I&rsquo;m not the only one evaluating those responses, and that survey is the only place we can guarantee the entire team will see everything.</p>
]]></content:encoded></item><item><title>Building a Desired State Configuration Configuration – Part 2</title><link>https://powershell.org/articles/2013-10-14-building-a-desired-state-configuration-configuration-part-2/</link><guid>https://powershell.org/articles/2013-10-14-building-a-desired-state-configuration-configuration-part-2/</guid><pubDate>Mon, 14 Oct 2013 18:19:03 +0000</pubDate><description>&lt;p&gt;Ok, let&amp;rsquo;s get back to creating a DSC configuration.  &lt;a href="https://powershell.org/2013/10/08/building-a-desired-state-configuration-configuration/"&gt;If you haven&amp;rsquo;t read the last post in this series, go back and do that now&lt;/a&gt;, I&amp;rsquo;ll wait.  Now with that out of the way, let&amp;rsquo;s get back to it&amp;hellip;&lt;/p&gt;
&lt;h2 id="the-high-points" class="ps-heading"&gt;The High Points&lt;a class="ps-heading-anchor" href="#the-high-points" aria-label="Link to this section" title="Link to this section"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://powershell.org/2013/10/02/building-a-desired-state-configuration-infrastructure/"&gt;Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://powershell.org/2013/10/03/building-a-desired-state-configuration-pull-server/"&gt;Configuring the Pull Server (REST version)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Creating Configurations (&lt;a href="https://powershell.org/2013/10/08/building-a-desired-state-configuration-configuration/"&gt;one of two&lt;/a&gt;, two of two - this post)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://powershell.org/2013/11/06/configuring-a-desired-state-configuration-client/"&gt;Configuring Clients&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://powershell.org/2014/03/13/building-desired-state-configuration-custom-resources/"&gt;Building Custom Resources&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Packaging Custom Resources&lt;/li&gt;
&lt;li&gt;Advanced Client Targeting&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="picking-back-up" class="ps-heading"&gt;Picking Back UP&lt;a class="ps-heading-anchor" href="#picking-back-up" aria-label="Link to this section" title="Link to this section"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;Now that we have some of the basics down, we can start to look deeper at how composable these configurations are. A DSC configuration defined in PowerShell offers several advantages, not the least of which is that a configuration can be parameterized.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Ok, let&rsquo;s get back to creating a DSC configuration.  <a href="https://powershell.org/2013/10/08/building-a-desired-state-configuration-configuration/">If you haven&rsquo;t read the last post in this series, go back and do that now</a>, I&rsquo;ll wait.  Now with that out of the way, let&rsquo;s get back to it&hellip;</p><h2 id="the-high-points" class="ps-heading">The High Points<a class="ps-heading-anchor" href="#the-high-points" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><ul><li><a href="https://powershell.org/2013/10/02/building-a-desired-state-configuration-infrastructure/">Overview</a></li><li><a href="https://powershell.org/2013/10/03/building-a-desired-state-configuration-pull-server/">Configuring the Pull Server (REST version)</a></li><li>Creating Configurations (<a href="https://powershell.org/2013/10/08/building-a-desired-state-configuration-configuration/">one of two</a>, two of two - this post)</li><li><a href="https://powershell.org/2013/11/06/configuring-a-desired-state-configuration-client/">Configuring Clients</a></li><li><a href="https://powershell.org/2014/03/13/building-desired-state-configuration-custom-resources/">Building Custom Resources</a></li><li>Packaging Custom Resources</li><li>Advanced Client Targeting</li></ul><h3 id="picking-back-up" class="ps-heading">Picking Back UP<a class="ps-heading-anchor" href="#picking-back-up" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>Now that we have some of the basics down, we can start to look deeper at how composable these configurations are. A DSC configuration defined in PowerShell offers several advantages, not the least of which is that a configuration can be parameterized.</p><h4 id="parameterization" class="ps-heading">Parameterization<a class="ps-heading-anchor" href="#parameterization" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h4><p><code>configuration MyFirstServerConfig { param ([string[]]$NodeName) node $NodeName { WindowsFeature snmp { Name = 'SNMP-Service' } } }</code>With this simple tweak, I&rsquo;ve taken a configuration that was hard-coded to one server name to one that can take an array of server names. The PowerShell savvy are probably going, &ldquo;Big deal.. functions could do that since Monad&rdquo;. If you remember back in the last post, I showed how ConfigurationData could be used to pass data into a configuration. Then my main configuration did some stuff based on metadata about the node. My configuration was starting to look a bit complicated. The ability to parameterize configurations really helps us when we are ready for the next step, nesting configurations.</p><h4 id="nesting-configurations" class="ps-heading">Nesting Configurations<a class="ps-heading-anchor" href="#nesting-configurations" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h4><p>Let&rsquo;s start with an example&hellip;</p><p><code>$ConfigurationData = @{ AllNodes = @( @{NodeName = 'Server1';Role='Web'}, @{NodeName = 'Server2';Role='FileShare'} @{NodeName = 'Server3';Role=@('FileShare','Web')} ) } configuration RoleConfiguration { param ($Roles) switch ($Roles) { 'FileShare' { WindowsFeature FileSharing { Name = 'FS-FileServer' } } 'Web' { WindowsFeature Web { Name = 'web-Server' } } } } configuration MyFirstServerConfig { node $allnodes.NodeName { WindowsFeature snmp { Name = 'SNMP-Service' } RoleConfiguration MyServerRoles { Roles = $Node.Role } } }</code>So, what did we just see? I defined a parameterized configuration and then used it like a DSC Resource in my main configuration. Parameters are passed to the nested configuration in the exact same way as to a DSC Resource. This syntax also means that we can use DependsOn to create dependency chains between groups of functionality more easily.</p><p><code>configuration MyFirstServerConfig { node $allnodes.NodeName { WindowsFeature snmp { Name = 'SNMP-Service' } RoleConfiguration MyServerRoles { Roles = $Node.Role DependsOn = '[WindowsFeature]snmp' } } }</code>We can leverage this technique of creating nested configurations to simplify our configuration scripts, minimize dependency chains, and provide an easy way to reuse configuration sections for multiple configurations, all using the same semantics of any DSC resource.</p><h4 id="applying-configurations" class="ps-heading">Applying Configurations<a class="ps-heading-anchor" href="#applying-configurations" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h4><p>Once we have our configurations generated, we have a couple of ways to distribute and apply the configurations. We&rsquo;ll start assuming that we have generated our configurations for the servers we would like to target.</p><h5 id="start-dscconfiguration" class="ps-heading">Start-DscConfiguration<a class="ps-heading-anchor" href="#start-dscconfiguration" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h5><p>Our first option is Start-DscConfiguration. We can point Start-DscConfiguration to the configuration files that we&rsquo;ve generated (just point to the directory with the configuration files in them).</p><p><code>Start-DscConfiguration -Path ./MyFirstServerConfig</code>Doing this will attempt to run the configurations generated against any nodes specified. You can target specific servers by using the -computername or -cimsession parameters.<br>
One downside to using Start-DscConfiguration is that any custom resources (not nested configurations) need to be present on the remote node BEFORE applying the configuration.<br>
You CANNOT create a configuration that uses the file resource (or any other resource) to create the resource on disk during the DSC run. While this would be a cool trick, the resources contain a schema.mof file that defines the interface that DSC can use and the DSC engine will error if it cannot find the resource interface when the configuration is validated before it applies. One option is having two-phased configurations, one to distribute resources and the second to apply it.</p><h5 id="pulling-a-configuration" class="ps-heading">Pulling a Configuration<a class="ps-heading-anchor" href="#pulling-a-configuration" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h5><p>The next alternative is to distribute configurations and resources using a pull Server. In box, DSC supports two types of pull server, an REST based pull server (<a href="https://powershell.org/2013/10/03/building-a-desired-state-configuration-pull-server/">like described in my previous post</a>) and an SMB based pull server (<a href="http://blog.cosmoskey.com/powershell/desired-state-configuration-in-pull-mode-over-smb/">described here</a>). The pull server requires nodes to be labeled with a GUID (the configuration ID, which we&rsquo;ll talk about in an upcoming post), instead of server name. The pull server also requires that each config be accompanied by a checksum file with the file hash of the configuration file (example 72ed4117-fc49-4f81-822c-5bc59db64dd3.mof and 72ed4117-fc49-4f81-822c-5bc59db64dd3.mof.checksum).  One word off caution.. there can be no extra whitespace after the hash in the checksum file or the hash check will fail on the client node.  This means you cannot use</p><p><code>Get-FileHash 72ed4117-fc49-4f81-822c-5bc59db64dd3.mof | out-file 72ed4117-fc49-4f81-822c-5bc59db64dd3.mof.checksum</code>or</p><p><code>Get-FileHash 72ed4117-fc49-4f81-822c-5bc59db64dd3.mof | set-content 72ed4117-fc49-4f81-822c-5bc59db64dd3.mof.checksum</code>as those leave extra whitespace at the end of the file. I&rsquo;ve been using</p><p><code>[System.IO.File]::AppendAllText('72ed4117-fc49-4f81-822c-5bc59db64dd3.mof.checksum', (Get-FileHash 72ed4117-fc49-4f81-822c-5bc59db64dd3.mof).Hash)</code>In my next post, I&rsquo;ll be talking about we can configure our clients to talk to a pull server, then we can see stuff really start to happen.</p>
]]></content:encoded></item><item><title>PhillyPoSH 10/03/2013 meeting summary and presentation materials</title><link>https://powershell.org/articles/2013-10-13-phillyposh-10032013-meeting-summary/</link><guid>https://powershell.org/articles/2013-10-13-phillyposh-10032013-meeting-summary/</guid><pubDate>Mon, 14 Oct 2013 00:40:19 +0000</pubDate><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://mellositmusings.com/"&gt;John Mello&lt;/a&gt; gave a presentation on creating HTML reports in PowerShell, &lt;a href="https://powershell.org/wp-content/uploads/2013/10/PhillyPosh_10_03_2013.zip"&gt;a copy of his presentation and scripts can be found here&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/techguytj"&gt;TJ Turner&lt;/a&gt; gave a presentation on Community Defined Best Practices, &lt;a href="https://powershell.org/wp-content/uploads/2013/10/PhillyPosh_10_03_03_Community_Best_Practices.zip"&gt;a copy of his presentation can be found here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;We had user error audio issues with Lync throughout the meeting so a recording will not be posted to our &lt;a href="https://www.youtube.com/channel/UCAc_ow5FIJtRpvew__9Iqzg"&gt;YouTube channel&lt;/a&gt;,&lt;/li&gt;
&lt;li&gt;We celebrated our 1st anniversary!&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://powershell.org/wp-content/uploads/2013/10/PhillyPosh_cake_10_03_2013.jpg"&gt;&lt;img src="https://powershell.org/wp-content/uploads/2013/10/PhillyPosh_cake_10_03_2013-300x168.jpg" alt="PhillyPosh_cake_10_03_2013"&gt;&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<ul><li><a href="http://mellositmusings.com/">John Mello</a> gave a presentation on creating HTML reports in PowerShell,<a href="https://powershell.org/wp-content/uploads/2013/10/PhillyPosh_10_03_2013.zip">a copy of his presentation and scripts can be found here</a><ul><li><a href="https://twitter.com/techguytj">TJ Turner</a> gave a presentation on Community Defined Best Practices,<a href="https://powershell.org/wp-content/uploads/2013/10/PhillyPosh_10_03_03_Community_Best_Practices.zip">a copy of his presentation can be found here</a></li><li>We had user error audio issues with Lync throughout the meeting so a recording will not be posted to our<a href="https://www.youtube.com/channel/UCAc_ow5FIJtRpvew__9Iqzg">YouTube channel</a>,</li><li>We celebrated our 1st anniversary!</li></ul></li></ul><p><a href="https://powershell.org/wp-content/uploads/2013/10/PhillyPosh_cake_10_03_2013.jpg"><img src="https://powershell.org/wp-content/uploads/2013/10/PhillyPosh_cake_10_03_2013-300x168.jpg" alt="PhillyPosh_cake_10_03_2013"/></p>
]]></content:encoded></item><item><title>Help me Design the Advanced PowerShell Class!</title><link>https://powershell.org/articles/2013-10-12-help-me-design-the-advanced-powershell-class/</link><guid>https://powershell.org/articles/2013-10-12-help-me-design-the-advanced-powershell-class/</guid><pubDate>Sat, 12 Oct 2013 16:06:39 +0000</pubDate><description>&lt;p&gt;I&amp;rsquo;ve been asked to work on an &amp;ldquo;advanced&amp;rdquo; PowerShell class. Now, I don&amp;rsquo;t like the &amp;ldquo;advanced&amp;rdquo; word very much, because it means something different to everyone, depending on their experience. So I&amp;rsquo;m trying to make the class focus on &amp;ldquo;powerful, practical things you can do with PowerShell that definitely drift into programming and scripting.&amp;rdquo;&lt;br&gt;
You can tell me what you think by &lt;a href="http://674004.polldaddy.com/s/advanced-powershell-class-design"&gt;taking an online survey about the proposed outline&lt;/a&gt;, which will be online through October 18th, 2013.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I&rsquo;ve been asked to work on an &ldquo;advanced&rdquo; PowerShell class. Now, I don&rsquo;t like the &ldquo;advanced&rdquo; word very much, because it means something different to everyone, depending on their experience. So I&rsquo;m trying to make the class focus on &ldquo;powerful, practical things you can do with PowerShell that definitely drift into programming and scripting.&rdquo;<br>
You can tell me what you think by<a href="http://674004.polldaddy.com/s/advanced-powershell-class-design">taking an online survey about the proposed outline</a>, which will be online through October 18th, 2013.</p>
]]></content:encoded></item><item><title>LEAK: PowerShell Summit NA 2014 Speakers</title><link>https://powershell.org/articles/2013-10-10-leak-powershell-summit-na-2014-speakers/</link><guid>https://powershell.org/articles/2013-10-10-leak-powershell-summit-na-2014-speakers/</guid><pubDate>Thu, 10 Oct 2013 19:21:05 +0000</pubDate><description>&lt;p&gt;I got a glance at the &amp;ldquo;short list&amp;rdquo; of speakers for the PowerShell Summit North America 2014. While none of these names are guaranteed - these guys haven&amp;rsquo;t even been contacted to confirm - they&amp;rsquo;ll &lt;em&gt;definitely&lt;/em&gt; receive an invite in the next few days.&lt;br&gt;
First up, Mike Pfeiffer. This excites me because Mike&amp;rsquo;s a former MVP, and now a Premier Field Engineer (PFE) with Microsoft. He _literally _wrote the book on managing Exchange Server with PowerShell, and should be a great addition to our new Domain-Specific track.&lt;br&gt;
Next, Steven Murawski. I&amp;rsquo;m betting he&amp;rsquo;ll be asked to deliver talks on Desired State Configuration (DSC), something he&amp;rsquo;s been playing with intensely at his job. Yeah, &lt;em&gt;production use of DSC&lt;/em&gt;.&lt;br&gt;
Ed Wilson&amp;rsquo;s going to be invited. What&amp;rsquo;s a Summit without the Scripting Guy?!?!?&lt;br&gt;
Ashley McGlone, too - another PFE, which gives us some awesome from-the-field experience, especially from large-scale environments where PFEs tend to work. Should be awesome stuff.&lt;br&gt;
I imagine I&amp;rsquo;ll be invited to speak , along with my often-co-author Jeffery Hicks and &lt;em&gt;PowerShell In Depth&lt;/em&gt; co-author Richard Siddaway. Richard&amp;rsquo;s a WMI master, and his talks in 2013 were very well-received. Jeff, of course, is Jeff - it&amp;rsquo;ll be a fun talk or two, whatever they&amp;rsquo;re about.&lt;br&gt;
I saw Adam Driscoll&amp;rsquo;s name on the list (uber-developer with a ton of PowerShell experience), Jason Helmick (I&amp;rsquo;m hoping he&amp;rsquo;ll do a deeply in-depth talk on PowerShell Web Access, since he&amp;rsquo;s pretty much mastered all the not-documented intricacies of setting it up), and a few more.&lt;br&gt;
Early November should see the schedule finalized. Stay tuned.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I got a glance at the &ldquo;short list&rdquo; of speakers for the PowerShell Summit North America 2014. While none of these names are guaranteed - these guys haven&rsquo;t even been contacted to confirm - they&rsquo;ll <em>definitely</em> receive an invite in the next few days.<br>
First up, Mike Pfeiffer. This excites me because Mike&rsquo;s a former MVP, and now a Premier Field Engineer (PFE) with Microsoft. He _literally _wrote the book on managing Exchange Server with PowerShell, and should be a great addition to our new Domain-Specific track.<br>
Next, Steven Murawski. I&rsquo;m betting he&rsquo;ll be asked to deliver talks on Desired State Configuration (DSC), something he&rsquo;s been playing with intensely at his job. Yeah, <em>production use of DSC</em>.<br>
Ed Wilson&rsquo;s going to be invited. What&rsquo;s a Summit without the Scripting Guy?!?!?<br>
Ashley McGlone, too - another PFE, which gives us some awesome from-the-field experience, especially from large-scale environments where PFEs tend to work. Should be awesome stuff.<br>
I imagine I&rsquo;ll be invited to speak , along with my often-co-author Jeffery Hicks and <em>PowerShell In Depth</em> co-author Richard Siddaway. Richard&rsquo;s a WMI master, and his talks in 2013 were very well-received. Jeff, of course, is Jeff - it&rsquo;ll be a fun talk or two, whatever they&rsquo;re about.<br>
I saw Adam Driscoll&rsquo;s name on the list (uber-developer with a ton of PowerShell experience), Jason Helmick (I&rsquo;m hoping he&rsquo;ll do a deeply in-depth talk on PowerShell Web Access, since he&rsquo;s pretty much mastered all the not-documented intricacies of setting it up), and a few more.<br>
Early November should see the schedule finalized. Stay tuned.</p>
]]></content:encoded></item><item><title>Building a Desired State Configuration Configuration</title><link>https://powershell.org/articles/2013-10-08-building-a-desired-state-configuration-configuration/</link><guid>https://powershell.org/articles/2013-10-08-building-a-desired-state-configuration-configuration/</guid><pubDate>Tue, 08 Oct 2013 16:36:33 +0000</pubDate><description>&lt;p&gt;Now that&amp;rsquo;s a title!  We&amp;rsquo;ve worked through my reasoning as to why I want Desired State Configuration (DSC) and how to build a pull server.  Today and in the next post we are going to look at how to create configurations which describe how our target systems are supposed to work.&lt;/p&gt;
&lt;h2 id="the-high-points" class="ps-heading"&gt;The High Points&lt;a class="ps-heading-anchor" href="#the-high-points" aria-label="Link to this section" title="Link to this section"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://powershell.org/2013/10/02/building-a-desired-state-configuration-infrastructure/"&gt;Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://powershell.org/2013/10/03/building-a-desired-state-configuration-pull-server/"&gt;Configuring the Pull Server (REST version)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Creating Configurations (one of two - this post, &lt;a href="https://powershell.org/2013/10/14/building-a-desired-state-configuration-configuration-part-2/"&gt;two of two&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://powershell.org/2013/11/06/configuring-a-desired-state-configuration-client/"&gt;Configuring Clients&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://powershell.org/2014/03/13/building-desired-state-configuration-custom-resources/"&gt;Building Custom Resources&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Packaging Custom Resources&lt;/li&gt;
&lt;li&gt;Advanced Client Targeting&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="building-configurations" class="ps-heading"&gt;Building Configurations&lt;a class="ps-heading-anchor" href="#building-configurations" aria-label="Link to this section" title="Link to this section"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Configurations are the driving force for DSC.  A configuration is a &lt;a href="http://msdn.microsoft.com/en-us/library/aa823192(v=vs.85).aspx"&gt;Managed Object Format&lt;/a&gt; (MOF) document that describes the how a specified server (or servers) should look.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Now that&rsquo;s a title!  We&rsquo;ve worked through my reasoning as to why I want Desired State Configuration (DSC) and how to build a pull server.  Today and in the next post we are going to look at how to create configurations which describe how our target systems are supposed to work.</p><h2 id="the-high-points" class="ps-heading">The High Points<a class="ps-heading-anchor" href="#the-high-points" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><ul><li><a href="https://powershell.org/2013/10/02/building-a-desired-state-configuration-infrastructure/">Overview</a></li><li><a href="https://powershell.org/2013/10/03/building-a-desired-state-configuration-pull-server/">Configuring the Pull Server (REST version)</a></li><li>Creating Configurations (one of two - this post,<a href="https://powershell.org/2013/10/14/building-a-desired-state-configuration-configuration-part-2/">two of two</a>)</li><li><a href="https://powershell.org/2013/11/06/configuring-a-desired-state-configuration-client/">Configuring Clients</a></li><li><a href="https://powershell.org/2014/03/13/building-desired-state-configuration-custom-resources/">Building Custom Resources</a></li><li>Packaging Custom Resources</li><li>Advanced Client Targeting</li></ul><h2 id="building-configurations" class="ps-heading">Building Configurations<a class="ps-heading-anchor" href="#building-configurations" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Configurations are the driving force for DSC.  A configuration is a<a href="http://msdn.microsoft.com/en-us/library/aa823192(v=vs.85).aspx">Managed Object Format</a> (MOF) document that describes the how a specified server (or servers) should look.</p><h3 id="what-you-see" class="ps-heading">What You See<a class="ps-heading-anchor" href="#what-you-see" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>A basic configuration may look like</p><p><code>/* @TargetNode='8c7bfb10-8540-4a89-904c-5e6759de6d80' @GeneratedBy=svc_build @GenerationDate=10/07/2013 19:43:24 @GenerationHost=OR-WEB01 */ instance of Pagefile as $Pagefile1ref { ResourceID = "[Pagefile]Default::[BaseServer]JustTheBasics::[VirtualServer]VMWare"; InitialSize = 4294967296; SourceInfo = "C:\\windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\SELocalConfiguration\\StackExchangeConfiguration\\StackExchangeConfiguration.psm1::14::5::Pagefile"; ModuleName = "Pagefile"; MaximumSize = 4294967296; ModuleVersion = "1.0"; }; instance of PowerPlan as $PowerPlan1ref { ResourceID = "[PowerPlan]Default::[BaseServer]JustTheBasics::[VirtualServer]VMWare"; SourceInfo = "C:\\windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\SELocalConfiguration\\StackExchangeConfiguration\\StackExchangeConfiguration.psm1::20::5::PowerPlan"; Name = "High performance"; ModuleName = "PowerPlan"; ModuleVersion = "1.0"; }; instance of MSFT_RoleResource as $MSFT_RoleResource1ref { ResourceID = "[WindowsFeature]snmp::[BaseServer]JustTheBasics::[VirtualServer]VMWare"; SourceInfo = "C:\\windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\SELocalConfiguration\\StackExchangeConfiguration\\StackExchangeConfiguration.psm1::25::5::WindowsFeature"; Name = "SNMP-Service"; ModuleName = "MSFT_RoleResource"; ModuleVersion = "1.0"; }; instance of OMI_ConfigurationDocument { Version="1.0.0"; Author="build_service"; GenerationDate="10/07/2013 19:43:24"; GenerationHost="OR-WEB01"; };</code>Each instance of a MOF class (except for the OMI_ConfigurationDocument) refer to a DSC Resource and provides the parameters that resource will be called with when the configuration engine runs.  There are a couple of properties that are not passed to the resource module.  The ResourceID is a unique identifier that indicates the resource and the configuration inheritance tree where it is defined (we&rsquo;ll dig deeper into that shortly).  The ModuleVersion is the version number of the PowerShell module (from the psd1) of the DSC Resource.</p><h3 id="getting-from-here-to-there" class="ps-heading">Getting From Here To There<a class="ps-heading-anchor" href="#getting-from-here-to-there" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>We don&rsquo;t want to write straight MOF files to define configuration, mainly because they are kind of verbose, with a some boilerplate  stuff for each resource.  Fortunately, we&rsquo;ve got a Domain Specific Language (DSL) in PowerShell v4 to generate them.</p><h5 id="the-configuration-keyword" class="ps-heading">The Configuration Keyword<a class="ps-heading-anchor" href="#the-configuration-keyword" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h5><p>PowerShell v4 contains the keyword &ldquo;configuration&rdquo;, which allows us to provide a name for the configuration (like a function name).</p><p><code>configuration MyFirstServerConfig { }</code>It looks just like how you would define a function or workflow. Now let&rsquo;s put something useful inside of it.</p><p><code>configuration MyFirstServerConfig { WindowsFeature snmp { Name = 'SNMP-Service' } }</code>In this most simple of examples, we&rsquo;ve defined a particular feature to be installed on a Windows Server. When we run this snippet, a wrapper function will be generated (kind of like how a workflow wrapper is generated). At this point, no MOF file has been created or applied, this simply creates a function that can generate a configuration based on the resources specified within. If we execute this configuration</p><p><code>PS&gt; MyFirstServerConfig</code>we&rsquo;ll get a file named localhost.mof in a folder at $pwd/MyFirstServerConfig.</p><h5 id="configuration-default-parameters---outputpath" class="ps-heading">Configuration Default Parameters - OutputPath<a class="ps-heading-anchor" href="#configuration-default-parameters---outputpath" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h5><p>If we want to specify the server the configuration applies to, we can wrap the resources in a Node block.</p><p><code>configuration MyFirstServerConfig { Node Server1 { WindowsFeature snmp { Name = 'SNMP-Service' } } }</code>This will create a configuration named Server1. Node names will be important as we move on to talking about targeting via Start-DscConfiguration and using the pull server.<br>
We do have some options as to how the configuration gets generated. We can use the OutputPath to control where the configuration files are deposited.</p><p><code>PS&gt; MyFirstServerConfig -OutputPath c:\Configurations</code>##### Configuration Default Parameters - ConfigurationData</p><p>Our other major parameter is ConfigurationData. ConfigurationData is a way to separate out your environmental concerns from the configuration documents. We&rsquo;ll come back to this one after we explore a few more concepts. ConfigurationData is a hashtable that expects a certain structure. The hashtable should contain an key named AllNodes, which is an array of hashtables that describe the nodes whose data you want to inject. For example</p><p><code>$ConfigurationData = @{ AllNodes = @( @{NodeName = 'Server1';Role='Web'}, @{NodeName = 'Server2';Role='FileShare'} ) }</code>NodeName is a common convention for specifying the node name.  We don&rsquo;t want to use Node, as there are some automatic variables populated in a configuration, one of which is $Node.  All the other keys in the hashtable representing a node are completely up to you.<br><em>Just a quick aside.. the node name does not necessarily equate to the server name.  When we get in to targeting (a bit in this post and more in an upcoming one), we&rsquo;ll see how this is true.</em><br>
After we have some data in our ConfigurationData hashtable (and the variable doesn&rsquo;t need to be called ConfigurationData, I just did for convenience sake), we can use that to help drive our configuration. We&rsquo;ll tweak our configuration function a bit, so that it can take advantage of the extra data being supplied.</p><p><code>configuration MyFirstServerConfig { node $allnodes.NodeName { WindowsFeature snmp { Name = 'SNMP-Service' } switch ($Node.Role) { 'FileShare' { WindowsFeature FileSharing { Name = 'FS-FileServer' } } 'Web' { WindowsFeature Web { Name = 'web-Server' } } } } }</code>Since this is a PowerShell DSL, I can use PowerShell functions, operators, and flow control to manipulate the configuration details. In this case, I&rsquo;m using a switch statement to add roles to my server based on role definitions I&rsquo;m supplying in my ConfigurationData.</p><p>`PS&gt; MyFirstServerConfig -ConfigurationData $ConfigurationData
Directory: C:\scripts\MyFirstServerConfig
Mode LastWriteTime Length Name</p><hr><p>-a&mdash; 10/8/2013 4:03 PM 1494 Server1.mof
-a&mdash; 10/8/2013 4:03 PM 1516 Server2.mof
`If we look at the MOF files generated by this, we&rsquo;ll see that Server1 does not have the FS-FileServer role, but does have the Web-Server role.</p><p><code>/* @TargetNode='Server1' @GeneratedBy=smurawski @GenerationDate=10/08/2013 16:03:51 @GenerationHost=OR-UTIL02 */ instance of MSFT_RoleResource as $MSFT_RoleResource1ref { ResourceID = "[WindowsFeature]snmp"; SourceInfo = "::12::9::WindowsFeature"; Name = "SNMP-Service"; ModuleName = "MSFT_RoleResource"; ModuleVersion = "1.0"; }; instance of MSFT_RoleResource as $MSFT_RoleResource2ref { ResourceID = "[WindowsFeature]Web"; SourceInfo = "::25::29::WindowsFeature"; Name = "web-Server"; ModuleName = "MSFT_RoleResource"; ModuleVersion = "1.0"; }; instance of OMI_ConfigurationDocument { Version="1.0.0"; Author="smurawski"; GenerationDate="10/08/2013 16:03:51"; GenerationHost="OR-UTIL02"; };</code>And Server2 has the reverse.</p><p><code>/* @TargetNode='Server2' @GeneratedBy=smurawski @GenerationDate=10/08/2013 16:06:31 @GenerationHost=OR-UTIL02 */ instance of MSFT_RoleResource as $MSFT_RoleResource1ref { ResourceID = "[WindowsFeature]snmp"; SourceInfo = "::13::9::WindowsFeature"; Name = "SNMP-Service"; ModuleName = "MSFT_RoleResource"; ModuleVersion = "1.0"; }; instance of MSFT_RoleResource as $MSFT_RoleResource2ref { ResourceID = "[WindowsFeature]FileSharing"; SourceInfo = "::20::29::WindowsFeature"; Name = "FS-FileServer"; ModuleName = "MSFT_RoleResource"; ModuleVersion = "1.0"; }; instance of OMI_ConfigurationDocument { Version="1.0.0"; Author="smurawski"; GenerationDate="10/08/2013 16:06:31"; GenerationHost="OR-UTIL02"; };</code>To highlight a neat trick since we are using a switch statement and<a href="http://technet.microsoft.com/en-us/library/ff730937.aspx">switch can process collections</a>, we can specify more than one role in our hashtable and our configuration should be able to add all the required resources.</p><p><code>$ConfigurationData = @{ AllNodes = @( @{NodeName = 'Server1';Role='Web'}, @{NodeName = 'Server2';Role='FileShare'} @{NodeName = 'Server3';Role=@('FileShare','Web')} ) } configuration MyFirstServerConfig { node $allnodes.NodeName { WindowsFeature snmp { Name = 'SNMP-Service' } switch ($Node.Role) { 'FileShare' { WindowsFeature FileSharing { Name = 'FS-FileServer' } } 'Web' { WindowsFeature Web { Name = 'web-Server' } } } } } MyFirstServerConfig -ConfigurationData $ConfigurationData</code>If we look at the configuration generated for Server3, we&rsquo;ll find both Web-Server and FS-FileServer roles described.</p><p><code>/* @TargetNode='Server3' @GeneratedBy=smurawski @GenerationDate=10/08/2013 16:06:31 @GenerationHost=OR-UTIL02 */ instance of MSFT_RoleResource as $MSFT_RoleResource1ref { ResourceID = "[WindowsFeature]snmp"; SourceInfo = "::13::9::WindowsFeature"; Name = "SNMP-Service"; ModuleName = "MSFT_RoleResource"; ModuleVersion = "1.0"; }; instance of MSFT_RoleResource as $MSFT_RoleResource2ref { ResourceID = "[WindowsFeature]FileSharing"; SourceInfo = "::20::29::WindowsFeature"; Name = "FS-FileServer"; ModuleName = "MSFT_RoleResource"; ModuleVersion = "1.0"; }; instance of MSFT_RoleResource as $MSFT_RoleResource3ref { ResourceID = "[WindowsFeature]Web"; SourceInfo = "::26::29::WindowsFeature"; Name = "web-Server"; ModuleName = "MSFT_RoleResource"; ModuleVersion = "1.0"; }; instance of OMI_ConfigurationDocument { Version="1.0.0"; Author="smurawski"; GenerationDate="10/08/2013 16:06:31"; GenerationHost="OR-UTIL02"; };</code>#### Next Up</p><p>In the next post, we&rsquo;ll continue this topic and look at other ways we can parameterize configurations as well as nesting configurations.  We&rsquo;ll also touch on how to apply these configurations from Start-DscConfiguration and via a Pull Server.  Stay tuned!</p>
]]></content:encoded></item><item><title>Building a Desired State Configuration Pull Server</title><link>https://powershell.org/articles/2013-10-03-building-a-desired-state-configuration-pull-server/</link><guid>https://powershell.org/articles/2013-10-03-building-a-desired-state-configuration-pull-server/</guid><pubDate>Thu, 03 Oct 2013 19:40:59 +0000</pubDate><description>&lt;p&gt;Quick recap, I&amp;rsquo;m working through a series of posts about the &lt;a href="http://technet.microsoft.com/en-us/library/dn249912.aspx"&gt;Desired State Configuration&lt;/a&gt; infrastructure that I&amp;rsquo;m building at &lt;a href="http://stackexchange.com"&gt;Stack Exchange&lt;/a&gt;, including some how-to&amp;rsquo;s.&lt;/p&gt;
&lt;h2 id="the-high-points" class="ps-heading"&gt;The High Points&lt;a class="ps-heading-anchor" href="#the-high-points" aria-label="Link to this section" title="Link to this section"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://powershell.org/2013/10/02/building-a-desired-state-configuration-infrastructure/"&gt;Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Configuring the Pull Server (REST version) (this post)&lt;/li&gt;
&lt;li&gt;Creating Configurations (&lt;a href="https://powershell.org/2013/10/08/building-a-desired-state-configuration-configuration/"&gt;one of two&lt;/a&gt;, &lt;a href="https://powershell.org/2013/10/14/building-a-desired-state-configuration-configuration-part-2/"&gt;two of two&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://powershell.org/2013/11/06/configuring-a-desired-state-configuration-client/"&gt;Configuring Clients&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://powershell.org/2014/03/13/building-desired-state-configuration-custom-resources/"&gt;Building Custom Resources&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Packaging Custom Resources&lt;/li&gt;
&lt;li&gt;Advanced Client Targeting&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I started with an overview of &lt;strong&gt;what&lt;/strong&gt; and &lt;strong&gt;why&lt;/strong&gt;.  Today, I&amp;rsquo;m going to start the &lt;strong&gt;how&lt;/strong&gt;.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Quick recap, I&rsquo;m working through a series of posts about the<a href="http://technet.microsoft.com/en-us/library/dn249912.aspx">Desired State Configuration</a> infrastructure that I&rsquo;m building at<a href="http://stackexchange.com">Stack Exchange</a>, including some how-to&rsquo;s.</p><h2 id="the-high-points" class="ps-heading">The High Points<a class="ps-heading-anchor" href="#the-high-points" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><ul><li><a href="https://powershell.org/2013/10/02/building-a-desired-state-configuration-infrastructure/">Overview</a></li><li>Configuring the Pull Server (REST version) (this post)</li><li>Creating Configurations (<a href="https://powershell.org/2013/10/08/building-a-desired-state-configuration-configuration/">one of two</a>,<a href="https://powershell.org/2013/10/14/building-a-desired-state-configuration-configuration-part-2/">two of two</a>)</li><li><a href="https://powershell.org/2013/11/06/configuring-a-desired-state-configuration-client/">Configuring Clients</a></li><li><a href="https://powershell.org/2014/03/13/building-desired-state-configuration-custom-resources/">Building Custom Resources</a></li><li>Packaging Custom Resources</li><li>Advanced Client Targeting</li></ul><p>I started with an overview of<strong>what</strong> and<strong>why</strong>.  Today, I&rsquo;m going to start the<strong>how</strong>.</p><h3 id="building-a-pull-server" class="ps-heading">Building a Pull Server<a class="ps-heading-anchor" href="#building-a-pull-server" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>I&rsquo;m going to describe how to do this with Server 2012 R2 RTM (NOTE: this is not the General Availability  release, so there may be changes at GA), since that&rsquo;s the environment I&rsquo;m working most in.  If there is enough demand, I may follow up with how to do this using the Windows Management Framework on downlevel operating systems after the GA version of WMF 4 is released.<br>
The first step is adding the required roles and features, including the DSC Service.</p><p><code>Add-WindowsFeature Dsc-Service</code>Fortunately, the Dsc-Service feature has the right dependencies configured so IIS, the correct modules, and the Management OData Extension are all enabled.<br>
Next we need to set up the IIS web site:</p><ul><li>Create an directory to serve the web application from (I&rsquo;ll use c:\inetpub\wwwroot\PSDSCPullServer)</li><li>Copy several files from $pshome/modules/psdesiredstateconfiguration/pullserver (Global.asax, PSDSCPullServer.mof, PSDSCPullServer.svc, PSDSCPullServer.xml) to this directory.</li><li>Copy PSDSCPullServer.config and rename it to web.config</li><li>Create a subdirectory named &ldquo;bin&rdquo;.</li><li>Copy one file from $pshome/modules/psdesiredstateconfiguration/pullserver (Microsoft.Powershell.DesiredStateConfiguration.Service.dll) to the &ldquo;bin&rdquo; directory.</li><li>In IIS, create an application pool that runs under the &ldquo;Local System&rdquo; account.</li><li>In, IIS, create a new site (or application in an existing site or just use the existing default site)</li><li>Point the site or application root to the directory you designated as the root of the site.</li><li>Unlock the sections of the web config as below</li></ul><p><code>$appcmd = "$env:windir\system32\inetsrv\appcmd.exe" &amp; $appCmd unlock config -section:access &amp; $appCmd unlock config -section:anonymousAuthentication &amp; $appCmd unlock config -section:basicAuthentication &amp; $appCmd unlock config -section:windowsAuthentication</code>Now we need to set up the location where the pull server content will be served from.  Installing the DSC Service feature creates a default location ( $env:programfiles\WindowsPowerShell\DscService ).  There&rsquo;ll you find sub-directories for configuration and modules.  We can use these folders or we can create another location.  I&rsquo;m going to stick with the defaults for now.  We&rsquo;ve got a few steps left.<br>
First, we need to copy the Devices.mdb from $pshome/modules/psdesiredstateconfiguration/pullserver to the root of our pull server data location (in this case, $env:programfiles\WindowsPowerShell\DscService )<br>
Update the web.config app settings with the following settings:`After that your pull server should be up and running.  You should see something like this if you navigate to http://yourpullserver/psdscpullserver.svc<br><a href="https://powershell.org/wp-content/uploads/2013/10/PullServerDefaultUrl.png"><img src="https://powershell.org/wp-content/uploads/2013/10/PullServerDefaultUrl-300x83.png" alt="PullServerDefaultUrl"/></p>
]]></content:encoded></item><item><title>Building a Desired State Configuration Infrastructure</title><link>https://powershell.org/articles/2013-10-02-building-a-desired-state-configuration-infrastructure/</link><guid>https://powershell.org/articles/2013-10-02-building-a-desired-state-configuration-infrastructure/</guid><pubDate>Wed, 02 Oct 2013 19:35:41 +0000</pubDate><description>&lt;p&gt;This is a the kickoff in a series of posts about building a &lt;a href="http://technet.microsoft.com/en-us/library/dn249912.aspx"&gt;Desired State Configuration (DSC)&lt;/a&gt; infrastructure. I&amp;rsquo;ll be leveraging concepts I&amp;rsquo;ve been working on as I&amp;rsquo;ve been building out our DSC deployment at &lt;a href="http://stackexchange.com"&gt;Stack Exchange&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="the-high-points" class="ps-heading"&gt;The High Points&lt;a class="ps-heading-anchor" href="#the-high-points" aria-label="Link to this section" title="Link to this section"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Overview (this post)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://powershell.org/2013/10/03/building-a-desired-state-configuration-pull-server/"&gt;Configuring the Pull Server (REST version)&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Creating Configurations (&lt;a href="https://powershell.org/2013/10/08/building-a-desired-state-configuration-configuration/"&gt;one of two&lt;/a&gt;, &lt;a href="https://powershell.org/2013/10/14/building-a-desired-state-configuration-configuration-part-2/"&gt;two of two&lt;/a&gt;)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://powershell.org/2013/11/06/configuring-a-desired-state-configuration-client/"&gt;Configuring Clients&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://powershell.org/2014/03/13/building-desired-state-configuration-custom-resources/"&gt;Building Custom Resources&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Packaging Custom Resources&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>This is a the kickoff in a series of posts about building a<a href="http://technet.microsoft.com/en-us/library/dn249912.aspx">Desired State Configuration (DSC)</a> infrastructure. I&rsquo;ll be leveraging concepts I&rsquo;ve been working on as I&rsquo;ve been building out our DSC deployment at<a href="http://stackexchange.com">Stack Exchange</a>.</p><h2 id="the-high-points" class="ps-heading">The High Points<a class="ps-heading-anchor" href="#the-high-points" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><ul><li><p>Overview (this post)</p></li><li><p><a href="https://powershell.org/2013/10/03/building-a-desired-state-configuration-pull-server/">Configuring the Pull Server (REST version)</a></p></li><li><p>Creating Configurations (<a href="https://powershell.org/2013/10/08/building-a-desired-state-configuration-configuration/">one of two</a>,<a href="https://powershell.org/2013/10/14/building-a-desired-state-configuration-configuration-part-2/">two of two</a>)</p></li><li><p><a href="https://powershell.org/2013/11/06/configuring-a-desired-state-configuration-client/">Configuring Clients</a></p></li><li><p><a href="https://powershell.org/2014/03/13/building-desired-state-configuration-custom-resources/">Building Custom Resources</a></p></li><li><p>Packaging Custom Resources</p></li><li><p>Advanced Client Targeting</p></li></ul><p>I&rsquo;m starting today with the general overview of what I&rsquo;m trying to accomplish and why I&rsquo;m trying to accomplish this. The<strong>what</strong> and<strong>why</strong> are critical in determining the<strong>how</strong></p><h2 id="the-overview" class="ps-heading">The Overview<a class="ps-heading-anchor" href="#the-overview" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><h3 id="goal" class="ps-heading">Goal:<a class="ps-heading-anchor" href="#goal" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>All systems have basic and general purpose roles configured and monitored for drift via Desired State Configuration.</p><h3 id="reason" class="ps-heading">Reason:<a class="ps-heading-anchor" href="#reason" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>System configuration is the one of the silent killers for sysadmin (yes, I prefer sysadmin to IT Pro - deal with it). In the case where deployments are not automated, each system is unique, a snowflake that results from the our fallibility as humans.<br>
The more steps involved that require human intervention allow for more potential failure points. Yes, if I make a mistake in my automation, then that mistake can be replicated out. But as Deming teaches with the Wheel of Continuous Improvement (<a href="http://totalqualitymanagement.wordpress.com/2009/02/25/deming-cycle-the-wheel-of-continuous-improvement/">Plan, Do, Check, Act</a>),  we can&rsquo;t correct a process problem until we have a stable process.</p><p><a href="http://totalqualitymanagement.wordpress.com/2009/02/25/deming-cycle-the-wheel-of-continuous-improvement/"><img src="http://totalqualitymanagement.files.wordpress.com/2009/02/deming-wheel4.png?w=459&amp;h=306" alt=""/></p><pre><code>Deming Cycle</code></pre><p>Every intervention by a human adds instability to the equation, so first we need to make the process consistent. We do that by standardizing the location(s) of human intervention.  Those touch points become the areas that we can tweak to further optimize the system.  I&rsquo;m getting a bit ahead of myself though.<br>
Let&rsquo;s continue to look at how organizations tend to deploy systems.  Organizations tend to have several levels of flexibility in their organizations about how systems are built and provided for use.  The three main categories I see are:</p><ul><li>Automated provisioning from a purpose built image</li><li>Install and configure from checklist</li><li>Install and configure on demand</li></ul><p>Usually, the size of the organization tends to indicate to what level they&rsquo;ve automated deployments, but that is less true today.  Larger organizations tend to have more customized and automated deployments.  It&rsquo;s mainly been a matter of scale.  With virtualization and (please forgive me) cloud infrastructures, even smaller organizations can have ever increasing numbers of servers to manage, with admin to server ratios of 1 to hundreds being common and where the number of servers starts to overtake the client OS count.<br>
If we aren&rsquo;t in a fully automated deployment environment, each server has the potential to be subtly (or not so subtly) unique.  Checklists and scripts can help with how varied our initial configurations can start out, but each server is like a unique piece of art (<a href="http://martinfowler.com/bliki/SnowflakeServer.html">or a snowflake</a>).</p><p><a href="http://upload.wikimedia.org/wikipedia/commons/7/7d/Poseidon_sculpture_Copenhagen_2005.jpg"><img src="http://upload.wikimedia.org/wikipedia/commons/7/7d/Poseidon_sculpture_Copenhagen_2005.jpg" alt=""/></p><pre><code>Try to make more than one of me...</code></pre><p>That&rsquo;s kind of appealing to sysadmins who like to think of themselves as crafters of solutions.  However, in terms of maintainability, it is a nightmare.  Every possible deviation in settings can cause problems or irregularities in operations that can be difficult to track down.  It&rsquo;s also much more work overall.<br>
What we want our servers to be is like components fresh off the assembly line.</p><p><a href="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSJmOiGPPMI-4_RYvO-um41VjgVBE6i04TQWKUF83Gc_RhVbE8r7FyJcYCt"><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSJmOiGPPMI-4_RYvO-um41VjgVBE6i04TQWKUF83Gc_RhVbE8r7FyJcYCt" alt=""/></p><pre><code>Keeping it consistent</code></pre><p>Each server should be consistently stamped out, with minimal deviations, so that troubleshooting across like servers is more consistent.  Or, even more exciting, if you are experiencing some local problems, refreshing the OS and configuration to a known good state becomes trivial.  Building the assembly line and work centers can be time consuming up front, but pays off in the long haul.</p><h4 id="my-situation" class="ps-heading">My Situation:<a class="ps-heading-anchor" href="#my-situation" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h4><p>At Stack Exchange, we are a mix of these categories.  All of our OS deployments are driven by PXE boot deployments.  For our Linux systems, we fall into the first group.  We can deploy an OS and make the addition to our<a href="https://puppetlabs.com/puppet/puppet-open-source">Puppet</a> system, which will configure the box for the designated purpose.  For our Windows systems, we operate out of the second and third groups.  We have a basic checklist (about 30-some items) that details the standards our systems should be configured with, but once we get to configuring the server for a specific role, it&rsquo;s been a bit more chaotic.  As we&rsquo;ve migrated to Server 2012 for a web farm and SQL servers, we&rsquo;ve began to script out our installations for those roles, so they were kind of automated, but in a very one-time run way.<br>
Given where we stood with our Windows deployments and the experience we had with Puppet, we looked at using Puppet with our Windows systems (like<a href="https://twitter.com/stack72">Paul Stack</a> -<a href="http://herdingcode.com/herding-code-174-paul-stack-on-automating-windows-configuration-management-with-puppet-and-powershell/">podcast</a>,<a href="https://vimeo.com/68226718">video</a>) and decided not to go that route (why is probably worthy of another post at another time).  That was around the time that DSC was starting to peek it&rsquo;s head out from under the covers of the Server 2012 R2 preview.  Long story made short, we decided to use DSC to standardize our Windows deployments and bring us parity with our Linux infrastructure in terms of configuration management.</p><h4 id="proposed-solution-desired-state-configuration" class="ps-heading">Proposed Solution: Desired State Configuration<a class="ps-heading-anchor" href="#proposed-solution-desired-state-configuration" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h4><p>DSC offers us a pattern for building idempotent scripts (contained in DSC resources) and offers an engine for marshaling parameters from an external source (in my case a DSC Pull Server, but could be a tool like Chef or some other configuration management product) to be executed on the local machine, as well as coordinating the availability of extra functionality (custom resources).  I&rsquo;m building an environment where a deployed server can request it&rsquo;s configuration from the pull server and reduce the number of touch points to improve consistency and velocity in server deployments.<br><strong>Next up, I&rsquo;m going to talk about how I&rsquo;ve configured my pull server, including step by step instructions to set one up on Server 2012 R2.</strong></p>
]]></content:encoded></item><item><title>Seeking Coaches and Judges for the Winter Scripting Games</title><link>https://powershell.org/articles/2013-10-02-seeking-coaches-and-judges-for-the-winter-scripting-games/</link><guid>https://powershell.org/articles/2013-10-02-seeking-coaches-and-judges-for-the-winter-scripting-games/</guid><pubDate>Wed, 02 Oct 2013 17:58:14 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;re now seeking volunteer Coaches and Judges for the Winter Scripting Games!&lt;br&gt;
The Games are tentatively scheduled to run for 4-6 weeks starting January 6th, 2014. There will be 4-6 events, each lasting one week.&lt;/p&gt;
&lt;h2 id="coaches" class="ps-heading"&gt;Coaches&lt;a class="ps-heading-anchor" href="#coaches" aria-label="Link to this section" title="Link to this section"&gt;&lt;i class="fas fa-link" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Coaches have access to all teams&amp;rsquo; entries and private discussion threads for the week while entries are being developed and accepted. Coaches are meant to log in &lt;em&gt;throughout&lt;/em&gt; that one-week period, evaluate what teams have submitted so far, and offer comments and advice in the in-Game discussion thread.&lt;br&gt;
&lt;img src="https://powershell.org/wp-content/uploads/2013/09/6-002.png" alt="6-002"&gt;&lt;br&gt;
Coaches&amp;rsquo; comments receive a special flag, helping teams focus on them quickly. Note that teams are not required to use the in-Game discussion thread - they can discuss via email or elsewhere. Teams are also not required to continually submit entry files for coach review, so for some teams, coaches will have nothing to offer.&lt;br&gt;
Team discussions are private to the team members and coaches; discussions will not be made public.&lt;br&gt;
We&amp;rsquo;ll accept as many coaches as want to participate. Note that you &lt;strong&gt;cannot&lt;/strong&gt; be both a coach and a judge, and coaches are not permitted to participate on a team as a player.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;re now seeking volunteer Coaches and Judges for the Winter Scripting Games!<br>
The Games are tentatively scheduled to run for 4-6 weeks starting January 6th, 2014. There will be 4-6 events, each lasting one week.</p><h2 id="coaches" class="ps-heading">Coaches<a class="ps-heading-anchor" href="#coaches" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Coaches have access to all teams&rsquo; entries and private discussion threads for the week while entries are being developed and accepted. Coaches are meant to log in <em>throughout</em> that one-week period, evaluate what teams have submitted so far, and offer comments and advice in the in-Game discussion thread.<br><img src="https://powershell.org/wp-content/uploads/2013/09/6-002.png" alt="6-002"><br>
Coaches&rsquo; comments receive a special flag, helping teams focus on them quickly. Note that teams are not required to use the in-Game discussion thread - they can discuss via email or elsewhere. Teams are also not required to continually submit entry files for coach review, so for some teams, coaches will have nothing to offer.<br>
Team discussions are private to the team members and coaches; discussions will not be made public.<br>
We&rsquo;ll accept as many coaches as want to participate. Note that you <strong>cannot</strong> be both a coach and a judge, and coaches are not permitted to participate on a team as a player.</p><h2 id="judges" class="ps-heading">Judges<a class="ps-heading-anchor" href="#judges" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>We will accept a small panel of judges. After the event concludes, you&rsquo;ll have several days to review <em>all</em> team entries. You&rsquo;ll complete a scorecard as shown, and offer any comments that justify your scoring.<br><a href="https://powershell.org/wp-content/uploads/2013/09/6-001.png"><img src="https://powershell.org/wp-content/uploads/2013/09/6-001.png" alt="6-001"/><br>
Scorecards may have anything from just a few scoring items to more than a dozen; each scoring item corresponds to a requirement in the event scenario. Keep in mind that teams contain from 2-6 players, and there&rsquo;s only one event per team, so there will be fewer overall entries than in past years. Entries may, however, consist of multiple files. Some scenarios may ask teams to run their scripts, capture a transcript, and include the transcript in the entry - in those cases, judges will be able to see entries&rsquo; output without running the scripts themselves.<br>
We will provide judges the ability to download <em>all</em> event entries for <em>all</em> teams via a single ZIP file. That will enable offline review, if desired; you can then log in to submit your scorecards for each team.<br>
Judge scores and comments, along with the judges&rsquo; names, will be made public after scoring concludes.<br>
Judges <strong>cannot</strong> participate as either players or coaches.</p><h2 id="want-to-volunteer" class="ps-heading">Want to Volunteer?<a class="ps-heading-anchor" href="#want-to-volunteer" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>If you&rsquo;d like to volunteer,<a href="http://powershell.hosted.phplist.com/lists/?p=subscribe&amp;id=6">sign up for the appropriate (coach or judge) mailing list</a>. Note that we will only be accepting a limited number of judges, so not everyone who volunteers may be selected. However, **please do not sign up for both lists. **You need to pick one. If you volunteer to be a judge but aren&rsquo;t selected, you can go back later and sign up for the coach list.<br>
Signing up at this stage **is not a commitment ** - you&rsquo;re just expressing an interest. We&rsquo;ll provide more information closer-in, and you can always opt-out prior to the start of the Games.</p>
]]></content:encoded></item><item><title>More Congrats!</title><link>https://powershell.org/articles/2013-10-01-more-congrats/</link><guid>https://powershell.org/articles/2013-10-01-more-congrats/</guid><pubDate>Tue, 01 Oct 2013 19:29:51 +0000</pubDate><description>&lt;p&gt;Another kudos to Jon Walz, host of the long running PowerScripting Podcast, for his first and well-deserved MVP Award!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Another kudos to Jon Walz, host of the long running PowerScripting Podcast, for his first and well-deserved MVP Award!</p>
]]></content:encoded></item><item><title>Congrats!</title><link>https://powershell.org/articles/2013-10-01-congrats/</link><guid>https://powershell.org/articles/2013-10-01-congrats/</guid><pubDate>Tue, 01 Oct 2013 15:10:03 +0000</pubDate><description>&lt;p&gt;Congrats to our CFO, Jason Helmick, on receiving his first MVP Award!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Congrats to our CFO, Jason Helmick, on receiving his first MVP Award!</p>
]]></content:encoded></item></channel></rss>