&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 2013 on PowerShell.org - Welcome Automaters!</title><link>https://powershell.org/articles/2013/</link><description>Recent content in Articles from 2013 on PowerShell.org - Welcome Automaters!</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://powershell.org/articles/2013/index.xml" rel="self" type="application/rss+xml"/><item><title>State of the Org, ending 2013</title><link>https://powershell.org/articles/2013-12-30-state-of-the-org-ending-2013/</link><guid>https://powershell.org/articles/2013-12-30-state-of-the-org-ending-2013/</guid><pubDate>Mon, 30 Dec 2013 19:24:37 +0000</pubDate><description>&lt;p&gt;I wanted to take a moment and wish everyone a very happy new year, and to do a sort of wrap-up of 2013 from PowerShell.org&amp;rsquo;s perspective.&lt;br&gt;
We started 2013 with a bang, including our first-ever PowerShell Summit North America, held on-campus at Microsoft in Redmond. We&amp;rsquo;ll be returning to the Seattle area in April 2014 for &lt;a href="https://powershell.org/community-events/summit/"&gt;PowerShell Summit North America 2014&lt;/a&gt;, and are planning the first &lt;a href="https://powershell.org/community-events/summit/"&gt;PowerShell Summit Europe 2014&lt;/a&gt; in Amsterdam in September. For the N.A. show, we need about 50 more Summit attendees to break even, and can accommodate about 100 more than we&amp;rsquo;ve currently got registered.&lt;br&gt;
We ran a very successful Scripting Games that kicked off just as the Summit was ending. Thousands participated, tens of thousands of dollars in prizes were handed out, and most importantly the Games made the transition from being a much-loved child of the Microsoft Scripting Guys to being a community-owned event that can hopefully continue forever. We&amp;rsquo;ve got the first Winter Scripting Games in a loooong time starting in just a few days, in fact.&lt;br&gt;
In the wake of The Scripting Games, we ran a summer-long series of &lt;a href="https://powershell.org/category/great-debates/"&gt;Great Debates&lt;/a&gt;, and your comments on those informed the first-ever &lt;a href="https://powershell.org/newsletter/"&gt;Community Book of PowerShell Practices&lt;/a&gt;, now offered as a free ebook.&lt;br&gt;
PowerShell.org, Inc. closed its first fiscal year at the end of June 2013, and financially we lost just a bit of money. Don&amp;rsquo;t worry - that was always more or less the intent; we&amp;rsquo;re not running the corporation to make a buck, but rather to more-or-less break even. At the moment, we have $29,988.25 in our checking account, most of which is earmarked for Summit 2014 expenses.&lt;br&gt;
We&amp;rsquo;re now providing hosting services for about 17 &lt;a href="https://powershell.org/user-groups/"&gt;local and regional user groups&lt;/a&gt;, giving them a spot to post upcoming meeting dates, post-meeting file attachments, and other details. We&amp;rsquo;re hoping this helps raise awareness of the efforts they&amp;rsquo;re all making to have a strong local PowerShell support system in place.&lt;br&gt;
2013 also saw the &lt;a href="https://powershell.org/powerscripting-podcast/"&gt;PowerScripting Podcast&lt;/a&gt; become a welcome part of PowerShell.org. Host Jon Walz also got his first MVP Award, a long-awaited and well-deserved honor that he now shares with co-host Hal Rottenberg. Everyone appreciates the hard work they do, and we at PowerShell.org wanted to make sure they had the resources to keep doing it (equipment ain&amp;rsquo;t free), so we offered to help out when they needed, and they graciously accepted. We&amp;rsquo;re delighted to be working with them.&lt;br&gt;
PowerShell.org played an important role in developing Microsoft&amp;rsquo;s official entry-level PowerShell training, course 10961, by giving the authors (e.g., me) a place to survey folks about topic, level of coverage, and more, and to solicit feedback on the &amp;ldquo;A&amp;rdquo; and &amp;ldquo;B&amp;rdquo; revs while updating the course for PowerShell v4. This site (and all of you) also played an important role in selecting topics for the advanced-level training, course 10962, which will be developed in 2014. Finally, you all helped provide feedback for Microsoft Courseware Marketplace course 55039, which covers PowerShell scripting and toolmaking. When you see a survey posted here, jump in - it makes a very real difference in some very important projects!&lt;br&gt;
2013 was also the year we Moved to Azure, spinning up an Azure-hosted CentOS VM that&amp;rsquo;s now running the site. It&amp;rsquo;s gotten faster, is a bit easier to maintain, and is a heck of a lot more highly available thanks to Microsoft&amp;rsquo;s cloud hosting.&lt;br&gt;
I&amp;rsquo;m extremely proud to have had so many folks jump in and help out this year. Dave Wyatt, Matt Penny, Matt Johnson, Mike Shepard, and Nicholas Getchell have all taken on curator roles for the free ebooks we offer on PowerShell.org. They&amp;rsquo;re doing a wonderful job in making sure those titles stay updated - so much so, that &lt;a href="https://powershell.org/newsletter/"&gt;we&amp;rsquo;re now just linking to the books&amp;rsquo; GitHub repository&lt;/a&gt;, where you can download the DOC files directly. Dave Wyatt has also been &lt;a href="https://powershell.org/author/dlwyatt/"&gt;posting some incredibly detailed and informative blog posts&lt;/a&gt; that I hope you&amp;rsquo;re reading - I really appreciate his contributions here. I also want to thank Matt Tilford, Chris Hunt, and Mark Keisling, who have taken on editorial duties for the &lt;a href="https://powershell.org/newsletter/"&gt;TechLetter newsletter&lt;/a&gt;. Our aim is to put out a solid, informative, technically deep monthly offering and these guys are absolutely on the job. I hope you&amp;rsquo;re subscribed, because if you aren&amp;rsquo;t, you&amp;rsquo;re missing out. Finally, MVP &lt;a href="https://powershell.org/author/stevenmurawski/"&gt;Steven Murawski&lt;/a&gt; has made PowerShell.org his home for Desired State Configuration (DSC) blogs and code, and he&amp;rsquo;s been prolific. His employer, StackExchange, has been an early adopter of the DSC technology, and Steven&amp;rsquo;s been sharing pretty much everything he&amp;rsquo;s learned.&lt;br&gt;
We&amp;rsquo;ve had some transitions in 2013. Board member and co-founder Kirk Munro has had to step away from day-to-day duties with PowerShell.org, although he remains a member of the board. Board member Jason Helmick has stepped into a second-in-command position, and is more or less running the North America Summit from an operational perspective. Jason earned his first MVP Award this year, giving us an all-MVP Board that also includes myself, Jeffery Hicks, and Richard Siddaway.&lt;br&gt;
I&amp;rsquo;m extremely proud of everything we&amp;rsquo;ve accomplished. I&amp;rsquo;m delighted that so many folks are jumping into the &lt;a href="https://powershell.org/forums/"&gt;forums&lt;/a&gt; and offering answers to questions - it&amp;rsquo;s a massive relief on my own workload, and there are some damn smart folks offering their help to the community for free. In fact, we plan to recognize some of them in our first-ever PowerShell Heroes award, scheduled for January 2014. We&amp;rsquo;re also going to make good on a promise I made when we started this site: our above-and-beyond contributors are going to become part-owners of this community with an award of stock in PowerShell.org, Inc. That&amp;rsquo;ll give them some concrete control over the community they&amp;rsquo;re helping to build. Look for that mid-2014, when we near the end of our fiscal year.&lt;br&gt;
For 2014, I&amp;rsquo;d like to thank our returning sponsors, &lt;a href="http://www.sapien.com"&gt;SAPIEN Technologies&lt;/a&gt; and &lt;a href="http://interfacett.com"&gt;Interface Technical Training&lt;/a&gt;. These folks give a lot, financially, to help make this site work. Please show them your appreciation in every way you can. In 2014, my company, &lt;a href="http://concentratedtech.com"&gt;Concentrated Tech&lt;/a&gt;, is also coming aboard as a sponsor, and I&amp;rsquo;ll be offering my first-ever public PowerShell training.&lt;br&gt;
I think 2014 should be a great year, both for PowerShell.org and for the broader PowerShell community that we&amp;rsquo;re trying to serve. If you&amp;rsquo;re new here, or you&amp;rsquo;ve just been lurking, please jump in and help. Write an article about something you learned, answer a question in the forums, or volunteer to help out. We&amp;rsquo;re all in this together, and the stronger a community we all make _together, _the more we&amp;rsquo;ll be able to support each other when needs arise.&lt;br&gt;
I look forward to serving you in 2014!&lt;br&gt;
Don Jones&lt;br&gt;
President and CEO&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I wanted to take a moment and wish everyone a very happy new year, and to do a sort of wrap-up of 2013 from PowerShell.org&rsquo;s perspective.<br>
We started 2013 with a bang, including our first-ever PowerShell Summit North America, held on-campus at Microsoft in Redmond. We&rsquo;ll be returning to the Seattle area in April 2014 for<a href="https://powershell.org/community-events/summit/">PowerShell Summit North America 2014</a>, and are planning the first<a href="https://powershell.org/community-events/summit/">PowerShell Summit Europe 2014</a> in Amsterdam in September. For the N.A. show, we need about 50 more Summit attendees to break even, and can accommodate about 100 more than we&rsquo;ve currently got registered.<br>
We ran a very successful Scripting Games that kicked off just as the Summit was ending. Thousands participated, tens of thousands of dollars in prizes were handed out, and most importantly the Games made the transition from being a much-loved child of the Microsoft Scripting Guys to being a community-owned event that can hopefully continue forever. We&rsquo;ve got the first Winter Scripting Games in a loooong time starting in just a few days, in fact.<br>
In the wake of The Scripting Games, we ran a summer-long series of<a href="https://powershell.org/category/great-debates/">Great Debates</a>, and your comments on those informed the first-ever<a href="https://powershell.org/newsletter/">Community Book of PowerShell Practices</a>, now offered as a free ebook.<br>
PowerShell.org, Inc. closed its first fiscal year at the end of June 2013, and financially we lost just a bit of money. Don&rsquo;t worry - that was always more or less the intent; we&rsquo;re not running the corporation to make a buck, but rather to more-or-less break even. At the moment, we have $29,988.25 in our checking account, most of which is earmarked for Summit 2014 expenses.<br>
We&rsquo;re now providing hosting services for about 17<a href="https://powershell.org/user-groups/">local and regional user groups</a>, giving them a spot to post upcoming meeting dates, post-meeting file attachments, and other details. We&rsquo;re hoping this helps raise awareness of the efforts they&rsquo;re all making to have a strong local PowerShell support system in place.<br>
2013 also saw the<a href="https://powershell.org/powerscripting-podcast/">PowerScripting Podcast</a> become a welcome part of PowerShell.org. Host Jon Walz also got his first MVP Award, a long-awaited and well-deserved honor that he now shares with co-host Hal Rottenberg. Everyone appreciates the hard work they do, and we at PowerShell.org wanted to make sure they had the resources to keep doing it (equipment ain&rsquo;t free), so we offered to help out when they needed, and they graciously accepted. We&rsquo;re delighted to be working with them.<br>
PowerShell.org played an important role in developing Microsoft&rsquo;s official entry-level PowerShell training, course 10961, by giving the authors (e.g., me) a place to survey folks about topic, level of coverage, and more, and to solicit feedback on the &ldquo;A&rdquo; and &ldquo;B&rdquo; revs while updating the course for PowerShell v4. This site (and all of you) also played an important role in selecting topics for the advanced-level training, course 10962, which will be developed in 2014. Finally, you all helped provide feedback for Microsoft Courseware Marketplace course 55039, which covers PowerShell scripting and toolmaking. When you see a survey posted here, jump in - it makes a very real difference in some very important projects!<br>
2013 was also the year we Moved to Azure, spinning up an Azure-hosted CentOS VM that&rsquo;s now running the site. It&rsquo;s gotten faster, is a bit easier to maintain, and is a heck of a lot more highly available thanks to Microsoft&rsquo;s cloud hosting.<br>
I&rsquo;m extremely proud to have had so many folks jump in and help out this year. Dave Wyatt, Matt Penny, Matt Johnson, Mike Shepard, and Nicholas Getchell have all taken on curator roles for the free ebooks we offer on PowerShell.org. They&rsquo;re doing a wonderful job in making sure those titles stay updated - so much so, that<a href="https://powershell.org/newsletter/">we&rsquo;re now just linking to the books&rsquo; GitHub repository</a>, where you can download the DOC files directly. Dave Wyatt has also been<a href="https://powershell.org/author/dlwyatt/">posting some incredibly detailed and informative blog posts</a> that I hope you&rsquo;re reading - I really appreciate his contributions here. I also want to thank Matt Tilford, Chris Hunt, and Mark Keisling, who have taken on editorial duties for the<a href="https://powershell.org/newsletter/">TechLetter newsletter</a>. Our aim is to put out a solid, informative, technically deep monthly offering and these guys are absolutely on the job. I hope you&rsquo;re subscribed, because if you aren&rsquo;t, you&rsquo;re missing out. Finally, MVP<a href="https://powershell.org/author/stevenmurawski/">Steven Murawski</a> has made PowerShell.org his home for Desired State Configuration (DSC) blogs and code, and he&rsquo;s been prolific. His employer, StackExchange, has been an early adopter of the DSC technology, and Steven&rsquo;s been sharing pretty much everything he&rsquo;s learned.<br>
We&rsquo;ve had some transitions in 2013. Board member and co-founder Kirk Munro has had to step away from day-to-day duties with PowerShell.org, although he remains a member of the board. Board member Jason Helmick has stepped into a second-in-command position, and is more or less running the North America Summit from an operational perspective. Jason earned his first MVP Award this year, giving us an all-MVP Board that also includes myself, Jeffery Hicks, and Richard Siddaway.<br>
I&rsquo;m extremely proud of everything we&rsquo;ve accomplished. I&rsquo;m delighted that so many folks are jumping into the<a href="https://powershell.org/forums/">forums</a> and offering answers to questions - it&rsquo;s a massive relief on my own workload, and there are some damn smart folks offering their help to the community for free. In fact, we plan to recognize some of them in our first-ever PowerShell Heroes award, scheduled for January 2014. We&rsquo;re also going to make good on a promise I made when we started this site: our above-and-beyond contributors are going to become part-owners of this community with an award of stock in PowerShell.org, Inc. That&rsquo;ll give them some concrete control over the community they&rsquo;re helping to build. Look for that mid-2014, when we near the end of our fiscal year.<br>
For 2014, I&rsquo;d like to thank our returning sponsors,<a href="http://www.sapien.com">SAPIEN Technologies</a> and<a href="http://interfacett.com">Interface Technical Training</a>. These folks give a lot, financially, to help make this site work. Please show them your appreciation in every way you can. In 2014, my company,<a href="http://concentratedtech.com">Concentrated Tech</a>, is also coming aboard as a sponsor, and I&rsquo;ll be offering my first-ever public PowerShell training.<br>
I think 2014 should be a great year, both for PowerShell.org and for the broader PowerShell community that we&rsquo;re trying to serve. If you&rsquo;re new here, or you&rsquo;ve just been lurking, please jump in and help. Write an article about something you learned, answer a question in the forums, or volunteer to help out. We&rsquo;re all in this together, and the stronger a community we all make _together, _the more we&rsquo;ll be able to support each other when needs arise.<br>
I look forward to serving you in 2014!<br>
Don Jones<br>
President and CEO</p>
]]></content:encoded></item><item><title>Introducing the Judges for Winter 2014 Scripting Games</title><link>https://powershell.org/articles/2013-12-28-introducing-the-judges-for-winter-2014-scripting-games/</link><guid>https://powershell.org/articles/2013-12-28-introducing-the-judges-for-winter-2014-scripting-games/</guid><pubDate>Sat, 28 Dec 2013 15:50:47 +0000</pubDate><description>&lt;p&gt;In the last few years there has been a long list of people judging the Scripting Games. Those people were expected to view as many entries as possible, preferably all, and score the entries as well as providing feedback on the individual entries. That is a ton of work especially when you consider that the judges were all volunteers.&lt;br&gt;
This time round we&amp;rsquo;re attempting to spread the load somewhat. Mike Robbins has done a superb job recruiting coaches for the &lt;a href="https://powershell.org/2013/12/23/introducing-the-coaches-of-the-2014-winter-scripting-games/"&gt;&lt;/a&gt; Its their job to look at the entries and make suggestions and hints to the teams - if the teams wish to take advantage of this option. Looking at the list of coaches - I know I would take advantage of their assistance if I was competing.&lt;br&gt;
That leaves judging. This time we&amp;rsquo;re using a small group of judges. We have prepared scoring criteria for the events with some additional style points available to the judges. This will make MOST of the scoring objective but we&amp;rsquo;ve a bit of subjectivity available for individual judges to pick out, and hopefully comment on, things they like or don&amp;rsquo;t like.&lt;br&gt;
The judges are all very experienced PowerShell practitioners with more books written, talks given, blog posts created and classes taught between them than anyone would want to count. In alphabetical order your judges for the Winter 2014 Scripting Games are:&lt;br&gt;
Don Jones - founder and CEO of powershell.org. Author of several PowerShell books including the highly recommended Learn PowerShell v3 in a Month of Lunches and co-author of PowerShell in Depth. Don is a PowerShell MVP, PowerShell educator, columnist and course creator.&lt;br&gt;
Jason Helmick - Board member of powershell.org. A PowerShell MVP and author of Learn IIS in a Month of Lunches which includes lots of PowerShell. Jason also delivered the recent two-part Introducing PowerShell MVA sessions with Jeffrey Snover. PowerShell educator, columnist and speaker.&lt;br&gt;
Jeffery Hicks - Board member of powershell.org. PowerShell MVP. Co-author of PowerShell in Depth, lead editor of PowerShell Deep Dives and author of other PowerShell books. Jeffrey is also a PowerShell columnist and educator&lt;br&gt;
Ed Wilson - The Scripting Guy. Ed runs the Hey! Scripting Guy &lt;a href="http://blogs.technet.com/b/heyscriptingguy/"&gt;&lt;/a&gt; Author of several PowerShell books including Windows PowerShell Best Practices and Windows PowerShell Scripting Guide. Ed also delivers PowerShell classes and is a much in demand speaker.&lt;br&gt;
The list of judges is completed by&lt;br&gt;
Richard Siddaway - Board member of powershell.org. PowerShell MVP. Co-author of PowerShell in Depth and author of PowerShell in Practice and PowerShell and WMI. Frequent blogger on PowerShell related topics.&lt;br&gt;
Between them the judges have accumulated over 30 years of PowerShell experience that is focussed on judging the Games. They are all looking forward to the Games and hope to see your entries.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>In the last few years there has been a long list of people judging the Scripting Games. Those people were expected to view as many entries as possible, preferably all, and score the entries as well as providing feedback on the individual entries. That is a ton of work especially when you consider that the judges were all volunteers.<br>
This time round we&rsquo;re attempting to spread the load somewhat. Mike Robbins has done a superb job recruiting coaches for the<a href="https://powershell.org/2013/12/23/introducing-the-coaches-of-the-2014-winter-scripting-games/"/> Its their job to look at the entries and make suggestions and hints to the teams - if the teams wish to take advantage of this option. Looking at the list of coaches - I know I would take advantage of their assistance if I was competing.<br>
That leaves judging. This time we&rsquo;re using a small group of judges. We have prepared scoring criteria for the events with some additional style points available to the judges. This will make MOST of the scoring objective but we&rsquo;ve a bit of subjectivity available for individual judges to pick out, and hopefully comment on, things they like or don&rsquo;t like.<br>
The judges are all very experienced PowerShell practitioners with more books written, talks given, blog posts created and classes taught between them than anyone would want to count. In alphabetical order your judges for the Winter 2014 Scripting Games are:<br>
Don Jones - founder and CEO of powershell.org. Author of several PowerShell books including the highly recommended Learn PowerShell v3 in a Month of Lunches and co-author of PowerShell in Depth. Don is a PowerShell MVP, PowerShell educator, columnist and course creator.<br>
Jason Helmick - Board member of powershell.org. A PowerShell MVP and author of Learn IIS in a Month of Lunches which includes lots of PowerShell. Jason also delivered the recent two-part Introducing PowerShell MVA sessions with Jeffrey Snover. PowerShell educator, columnist and speaker.<br>
Jeffery Hicks - Board member of powershell.org. PowerShell MVP. Co-author of PowerShell in Depth, lead editor of PowerShell Deep Dives and author of other PowerShell books. Jeffrey is also a PowerShell columnist and educator<br>
Ed Wilson - The Scripting Guy. Ed runs the Hey! Scripting Guy<a href="http://blogs.technet.com/b/heyscriptingguy/"/> Author of several PowerShell books including Windows PowerShell Best Practices and Windows PowerShell Scripting Guide. Ed also delivers PowerShell classes and is a much in demand speaker.<br>
The list of judges is completed by<br>
Richard Siddaway - Board member of powershell.org. PowerShell MVP. Co-author of PowerShell in Depth and author of PowerShell in Practice and PowerShell and WMI. Frequent blogger on PowerShell related topics.<br>
Between them the judges have accumulated over 30 years of PowerShell experience that is focussed on judging the Games. They are all looking forward to the Games and hope to see your entries.</p>
]]></content:encoded></item><item><title>January Charlotte PowerShell User Group Meeting</title><link>https://powershell.org/articles/2013-12-27-january-charlotte-powershell-user-group-meeting/</link><guid>https://powershell.org/articles/2013-12-27-january-charlotte-powershell-user-group-meeting/</guid><pubDate>Fri, 27 Dec 2013 14:15:39 +0000</pubDate><description>&lt;p&gt;Our monthly meeting will be held on January 2nd, 2014. This years Scripting Games is a team based event. What better place to find/join a team than a User Group meeting? We look forward to seeing you there.&lt;/p&gt;
&lt;p&gt;Here is some additional information about the Winter Scripting Games:&lt;/p&gt;
&lt;h5 id="teams-can-consist-of-between-2-to-6-scripters-and-official-registration-opens-on-jan-2nd" class="ps-heading"&gt;Teams can consist of between 2 to 6 Scripters and official registration opens on Jan 2nd.&lt;a class="ps-heading-anchor" href="#teams-can-consist-of-between-2-to-6-scripters-and-official-registration-opens-on-jan-2nd" 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;/h5&gt;
&lt;p&gt;There will be a total of 4 official events for the Winter Scripting Games:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Our monthly meeting will be held on January 2nd, 2014. This years Scripting Games is a team based event. What better place to find/join a team than a User Group meeting? We look forward to seeing you there.</p><p>Here is some additional information about the Winter Scripting Games:</p><h5 id="teams-can-consist-of-between-2-to-6-scripters-and-official-registration-opens-on-jan-2nd" class="ps-heading">Teams can consist of between 2 to 6 Scripters and official registration opens on Jan 2nd.<a class="ps-heading-anchor" href="#teams-can-consist-of-between-2-to-6-scripters-and-official-registration-opens-on-jan-2nd" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h5><p>There will be a total of 4 official events for the Winter Scripting Games:</p><p><em>January 19th, January 26th, February 2nd, &amp; February 9th</em></p><p>Check out the<a href="https://powershell.org/2013/12/16/2014-winter-scripting-games-schedule/">schedule</a> for all the details. In addition, be sure to follow the<a href="https://twitter.com/search?q=%23pshgames&amp;src=hash">#pshgames</a> hashtag on twitter. There is also<a href="http://mikefrobbins.com/2013/12/23/introducing-the-coaches-of-the-2014-winter-scripting-games/">a list of Coaches</a> who are blogging and<a href="https://twitter.com/mikefrobbins/lists/pshcoaches">tweeting</a> helpful info and tips including this<a href="http://p0w3rsh3ll.wordpress.com/2013/12/26/be-prepared-for-the-winter-scripting-games-3-2-1-go/">excellent preparation guide</a>. Lastly, before you head over to the<a href="http://scriptinggames.org/">scripting games website</a> be sure to read this<a href="https://powershell.org/2013/12/21/important-scripting-games-login-and-operational-information/">Important Scripting Games Login and Operational Information</a> post.</p>
]]></content:encoded></item><item><title>Introducing the Coaches of the 2014 Winter Scripting Games</title><link>https://powershell.org/articles/2013-12-23-introducing-the-coaches-of-the-2014-winter-scripting-games/</link><guid>https://powershell.org/articles/2013-12-23-introducing-the-coaches-of-the-2014-winter-scripting-games/</guid><pubDate>Mon, 23 Dec 2013 17:21:37 +0000</pubDate><description>&lt;p&gt;A few weeks ago, just before the announcement to start recruiting your team for the 2014 Winter Scripting Games, I was contacted by Don Jones and Richard Siddaway about an opportunity to become the Head Coach for the Winter Scripting Games. I was honored to have been contacted and I&amp;rsquo;m a firm believer of taking advantage of opportunities when they emerge, especially when they&amp;rsquo;re PowerShell related, so I graciously accepted.&lt;br&gt;
One of my first responsibilities was to recruit a small team of coaches. I immediately went to work before potential coaches committed themselves to participating on teams. We had a huge number of people in the PowerShell community who had volunteered to be a coach and while we would have liked to have selected everyone who volunteered, we only had a specific number of positions to fill. Without further ado, here is the list of the coaches for the 2014 Winter Scripting Games:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>A few weeks ago, just before the announcement to start recruiting your team for the 2014 Winter Scripting Games, I was contacted by Don Jones and Richard Siddaway about an opportunity to become the Head Coach for the Winter Scripting Games. I was honored to have been contacted and I&rsquo;m a firm believer of taking advantage of opportunities when they emerge, especially when they&rsquo;re PowerShell related, so I graciously accepted.<br>
One of my first responsibilities was to recruit a small team of coaches. I immediately went to work before potential coaches committed themselves to participating on teams. We had a huge number of people in the PowerShell community who had volunteered to be a coach and while we would have liked to have selected everyone who volunteered, we only had a specific number of positions to fill. Without further ado, here is the list of the coaches for the 2014 Winter Scripting Games:</p><pre><code> **Name**
**Twitter**
[Boe Prox](http://learn-powershell.net/)
[@proxb](http://twitter.com/proxb)
[Carlo Mancini](http://www.happysysadm.com/)
[@sysadm2010](http://twitter.com/sysadm2010)
[Claus Nielsen](http://xipher.dk/)
[@claustn](http://twitter.com/claustn)
[Emin Atac](http://p0w3rsh3ll.wordpress.com/)
[@p0w3rsh3ll](http://twitter.com/p0w3rsh3ll)
[Jan Egil Ring](http://blog.powershell.no/)
[@JanEgilRing](http://twitter.com/JanEgilRing)
[Jeff Wouters](http://jeffwouters.nl/)
[@JeffWouters](http://twitter.com/JeffWouters)
[Jonathan Medd](http://www.jonathanmedd.net/)
[@jonathanmedd](http://twitter.com/jonathanmedd/)
[Lido Paglia](http://paglia.org/)
[@nicemarmot](http://twitter.com/nicemarmot)
[Matt Hitchcock](http://sgitpro.com/)
[@hitchysg](http://twitter.com/hitchysg)
[Rob Campbell](http://mjolinor.wordpress.com/)
[@mjolinor](http://twitter.com/mjolinor)
[Rohn Edwards](http://rohnspowershellblog.wordpress.com/)
[@magicrohn](http://twitter.com/magicrohn)
[Sahal Omer](http://www.get-exchange.info/)
[@GetExchange](http://twitter.com/GetExchange)
[Steve Murawski](http://stevenmurawski.com/)
[@StevenMurawski](http://twitter.com/StevenMurawski)</code></pre><p><a href="http://mikefrobbins.com/2013/12/23/introducing-the-coaches-of-the-2014-winter-scripting-games/">Click here</a>
 to be redirected to the original post of this article on the author’s blog site where you can read the remainder of the article.</p><p>µ</p>
]]></content:encoded></item><item><title>My outline for accelerated PowerShell training</title><link>https://powershell.org/articles/2013-12-20-my-outline-for-accelerated-powershell-training/</link><guid>https://powershell.org/articles/2013-12-20-my-outline-for-accelerated-powershell-training/</guid><pubDate>Fri, 20 Dec 2013 22:40:00 +0000</pubDate><description>&lt;p&gt;When I teach PowerShell, either at a private client or in a public class, I tend to use my own outlines. I&amp;rsquo;m comfortable with them, and they work really well. They formed the basis for the Microsoft 10961 and 55039 courses, although I had to make some changes to accommodate Microsoft standards and varying MCT delivery styles. But I&amp;rsquo;m often asked if there&amp;rsquo;s a &amp;ldquo;MOC-equivalent&amp;rdquo; outline that combines the entry-level 10961 with the scripting-focused 55039.&lt;br&gt;
Yup.&lt;br&gt;
First, do understand that I naturally teach at a very concise and accelerated pace. I don&amp;rsquo;t spend much time on slides; I tend to skip right to demos, and use those to explain what I&amp;rsquo;m explaining. If you follow a more common delivery style of around 5min per slide, plus taking your time on demos, my approach might not work well for you. I also tend to not tell a lot of ancillary stories, I tend to make students take break during lab time (rather than individually scheduling breaks), and I tend to be as concise as possible in my lectures.&lt;br&gt;
Also, when accelerating these courses together, you don&amp;rsquo;t do &lt;em&gt;all&lt;/em&gt; of the labs. For labs with multiple components (find these 20 command), I&amp;rsquo;ll do about 1/3 of them. For the 55039 main-sequence labs, I&amp;rsquo;ll tell students to pick the &amp;ldquo;A,&amp;rdquo; &amp;ldquo;B,&amp;rdquo; or &amp;ldquo;C&amp;rdquo; version rather than doing all three; sometimes I&amp;rsquo;ll just have them do the &amp;ldquo;D&amp;rdquo; version (which gives them a pre-done starting point for each module, rather than making them build on their own work from a previous module).&lt;br&gt;
For Day 1, I&amp;rsquo;ll cover modules 1-5, and maybe module 6, from 10961. Day 2 will be modules 7, 9, 11, and 12 (covering 6 first, if I didn&amp;rsquo;t get it done on Day 1). That&amp;rsquo;s the &amp;ldquo;core&amp;rdquo; PowerShell stuff. It&amp;rsquo;s a fast delivery; it&amp;rsquo;s possible to spread those out over three days if you prefer, but I explicitly skip modules 6, 8, and 10 at this stage.&lt;br&gt;
When my students all have strong shell or scripting skills, 2 days often gets me through that. If they&amp;rsquo;re newer, I&amp;rsquo;ll go slower on modules 1-5, do more of the labs, and take 3 days to cover that 10961 material.&lt;br&gt;
The remainder of the course comes from 55039. That&amp;rsquo;ll be 2 or 3 days, depending on how long it took you to do the 10961 material. Regardless, I&amp;rsquo;ll cover modules 2-5. I&amp;rsquo;ll usually skip module 6, and try to end the day with module 7 on debugging. I&amp;rsquo;ll cover module 8, 9, and 10. That&amp;rsquo;s usually 2 days, so it&amp;rsquo;s the last thing I do if I took 3 days to cover the 10961 stuff.&lt;br&gt;
If I got through 10961 in 2 days, I&amp;rsquo;ll finish the 55039 material, covering modules 11, 13, and 16. If students insist on workflows, I&amp;rsquo;ll throw that module in there - I have mixed feelings and results when it comes to workflow, so it&amp;rsquo;s not part of my standard accelerated delivery. If you have extra time, my priority then goes to modules 15, 13, and 14, in that order. 14 gets you some GUI-building experience, so if the class is pushing for that I&amp;rsquo;ll include that module instead of workflow.&lt;br&gt;
If all that seems a little informal - well, it is. I&amp;rsquo;m very good at reading my students, and making sure folks are actually keeping up, so I don&amp;rsquo;t press too hard. This is a &lt;em&gt;lot&lt;/em&gt; of conceptual and practical material to cover in a week.&lt;br&gt;
Price-wise, in the US, I see this kind of accelerated class going for around $3500, although a lot of training centers offer significant discounts. This accelerated outline is absolutely worth it: you&amp;rsquo;re literally taking someone from zero and teaching them how to build their own script modules and tools in PowerShell. It&amp;rsquo;s a &lt;em&gt;lot&lt;/em&gt; to cover; not every class will be up to it.&lt;br&gt;
The labs in both courses are solid, and I&amp;rsquo;m especially happy with the ones in 55039 in terms of what they cover, and in how challenging they are. I&amp;rsquo;ll warn you that the 55039 labs don&amp;rsquo;t do a lot of hand-holding. Students are expected to &lt;em&gt;learn&lt;/em&gt; the material and then execute the labs; the &amp;ldquo;answer keys&amp;rdquo; are outright sample solutions, not hints. But if you teach the material as provided, everything students &lt;em&gt;need&lt;/em&gt; is in there - if they&amp;rsquo;re willing to work hard and retain what you&amp;rsquo;ve shared.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>When I teach PowerShell, either at a private client or in a public class, I tend to use my own outlines. I&rsquo;m comfortable with them, and they work really well. They formed the basis for the Microsoft 10961 and 55039 courses, although I had to make some changes to accommodate Microsoft standards and varying MCT delivery styles. But I&rsquo;m often asked if there&rsquo;s a &ldquo;MOC-equivalent&rdquo; outline that combines the entry-level 10961 with the scripting-focused 55039.<br>
Yup.<br>
First, do understand that I naturally teach at a very concise and accelerated pace. I don&rsquo;t spend much time on slides; I tend to skip right to demos, and use those to explain what I&rsquo;m explaining. If you follow a more common delivery style of around 5min per slide, plus taking your time on demos, my approach might not work well for you. I also tend to not tell a lot of ancillary stories, I tend to make students take break during lab time (rather than individually scheduling breaks), and I tend to be as concise as possible in my lectures.<br>
Also, when accelerating these courses together, you don&rsquo;t do <em>all</em> of the labs. For labs with multiple components (find these 20 command), I&rsquo;ll do about 1/3 of them. For the 55039 main-sequence labs, I&rsquo;ll tell students to pick the &ldquo;A,&rdquo; &ldquo;B,&rdquo; or &ldquo;C&rdquo; version rather than doing all three; sometimes I&rsquo;ll just have them do the &ldquo;D&rdquo; version (which gives them a pre-done starting point for each module, rather than making them build on their own work from a previous module).<br>
For Day 1, I&rsquo;ll cover modules 1-5, and maybe module 6, from 10961. Day 2 will be modules 7, 9, 11, and 12 (covering 6 first, if I didn&rsquo;t get it done on Day 1). That&rsquo;s the &ldquo;core&rdquo; PowerShell stuff. It&rsquo;s a fast delivery; it&rsquo;s possible to spread those out over three days if you prefer, but I explicitly skip modules 6, 8, and 10 at this stage.<br>
When my students all have strong shell or scripting skills, 2 days often gets me through that. If they&rsquo;re newer, I&rsquo;ll go slower on modules 1-5, do more of the labs, and take 3 days to cover that 10961 material.<br>
The remainder of the course comes from 55039. That&rsquo;ll be 2 or 3 days, depending on how long it took you to do the 10961 material. Regardless, I&rsquo;ll cover modules 2-5. I&rsquo;ll usually skip module 6, and try to end the day with module 7 on debugging. I&rsquo;ll cover module 8, 9, and 10. That&rsquo;s usually 2 days, so it&rsquo;s the last thing I do if I took 3 days to cover the 10961 stuff.<br>
If I got through 10961 in 2 days, I&rsquo;ll finish the 55039 material, covering modules 11, 13, and 16. If students insist on workflows, I&rsquo;ll throw that module in there - I have mixed feelings and results when it comes to workflow, so it&rsquo;s not part of my standard accelerated delivery. If you have extra time, my priority then goes to modules 15, 13, and 14, in that order. 14 gets you some GUI-building experience, so if the class is pushing for that I&rsquo;ll include that module instead of workflow.<br>
If all that seems a little informal - well, it is. I&rsquo;m very good at reading my students, and making sure folks are actually keeping up, so I don&rsquo;t press too hard. This is a <em>lot</em> of conceptual and practical material to cover in a week.<br>
Price-wise, in the US, I see this kind of accelerated class going for around $3500, although a lot of training centers offer significant discounts. This accelerated outline is absolutely worth it: you&rsquo;re literally taking someone from zero and teaching them how to build their own script modules and tools in PowerShell. It&rsquo;s a <em>lot</em> to cover; not every class will be up to it.<br>
The labs in both courses are solid, and I&rsquo;m especially happy with the ones in 55039 in terms of what they cover, and in how challenging they are. I&rsquo;ll warn you that the 55039 labs don&rsquo;t do a lot of hand-holding. Students are expected to <em>learn</em> the material and then execute the labs; the &ldquo;answer keys&rdquo; are outright sample solutions, not hints. But if you teach the material as provided, everything students <em>need</em> is in there - if they&rsquo;re willing to work hard and retain what you&rsquo;ve shared.</p>
]]></content:encoded></item><item><title>Coaches and Judges Selected for Winter Scripting Games</title><link>https://powershell.org/articles/2013-12-19-coaches-and-judges-selected-for-winter-scripting-games/</link><guid>https://powershell.org/articles/2013-12-19-coaches-and-judges-selected-for-winter-scripting-games/</guid><pubDate>Thu, 19 Dec 2013 17:32:44 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;ve had an outpouring of support for the upcoming games, with more volunteers than we know what to do with!&lt;br&gt;
At this point, we have our judging panel completely full; we&amp;rsquo;re operating with a fairly small group of celebrity judges this time around. Games Master Richard Siddaway will introduce our judges in a few days.&lt;br&gt;
We&amp;rsquo;ve also filled our roster of Coaches, and Head Coach Mike Robbins will provide that lineup soon also.&lt;br&gt;
If you&amp;rsquo;ve volunteered but not heard from Richard or Mike, then you should definitely start recruiting a team for when registration and team formation opens in a couple of weeks!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;ve had an outpouring of support for the upcoming games, with more volunteers than we know what to do with!<br>
At this point, we have our judging panel completely full; we&rsquo;re operating with a fairly small group of celebrity judges this time around. Games Master Richard Siddaway will introduce our judges in a few days.<br>
We&rsquo;ve also filled our roster of Coaches, and Head Coach Mike Robbins will provide that lineup soon also.<br>
If you&rsquo;ve volunteered but not heard from Richard or Mike, then you should definitely start recruiting a team for when registration and team formation opens in a couple of weeks!</p>
]]></content:encoded></item><item><title>How "Quick and Dirty" Becomes "Permanent and Annoying."</title><link>https://powershell.org/articles/2013-12-10-how-quick-and-dirty-becomes-permanent-and-annoying/</link><guid>https://powershell.org/articles/2013-12-10-how-quick-and-dirty-becomes-permanent-and-annoying/</guid><pubDate>Tue, 10 Dec 2013 22:23:37 +0000</pubDate><description>&lt;p&gt;Consider the following:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;$computers = Get-ADComputer -filter * -searchBase &amp;quot;ou=test,dc=company,dc=pri&amp;quot; foreach ($computer in $computers) { write-host &amp;quot;computer $computer&amp;quot; $result = Do-Something -computername $computer Write-Host &amp;quot;$($result.property) and $($result.value)&amp;quot; } &lt;/code&gt;Would you ever consider that acceptable? Some folks might well say, &amp;ldquo;sure! if I was just testing this, throwing in those Write-Hosts is no big deal. Heck, even if I was the only one who was going to use this, Write-Host isn&amp;rsquo;t bad.&amp;rdquo;&lt;br&gt;
And the point I&amp;rsquo;m going to make doesn&amp;rsquo;t just apply to Write-Host. It applies to &lt;em&gt;anytime&lt;/em&gt; when you&amp;rsquo;re doing something that you &lt;em&gt;know&lt;/em&gt; breaks &amp;ldquo;best practices,&amp;rdquo; but you justify it because it&amp;rsquo;s &amp;ldquo;just for you&amp;rdquo; or because &amp;ldquo;it&amp;rsquo;s just for testing.&amp;rdquo;&lt;br&gt;
To wit: if you need your script to output some status or tracking information, as in the above, use Write-Verbose. Yes, Write-Verbose requires a script or function to have this at the top:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Consider the following:</p><p><code>$computers = Get-ADComputer -filter * -searchBase "ou=test,dc=company,dc=pri" foreach ($computer in $computers) { write-host "computer $computer" $result = Do-Something -computername $computer Write-Host "$($result.property) and $($result.value)" }</code>Would you ever consider that acceptable? Some folks might well say, &ldquo;sure! if I was just testing this, throwing in those Write-Hosts is no big deal. Heck, even if I was the only one who was going to use this, Write-Host isn&rsquo;t bad.&rdquo;<br>
And the point I&rsquo;m going to make doesn&rsquo;t just apply to Write-Host. It applies to <em>anytime</em> when you&rsquo;re doing something that you <em>know</em> breaks &ldquo;best practices,&rdquo; but you justify it because it&rsquo;s &ldquo;just for you&rdquo; or because &ldquo;it&rsquo;s just for testing.&rdquo;<br>
To wit: if you need your script to output some status or tracking information, as in the above, use Write-Verbose. Yes, Write-Verbose requires a script or function to have this at the top:</p><p><code>[CmdletBinding()] Param()</code>Small price to pay for all the functionality it adds, but why not just use Write-Host and be done with it?<br><strong>Begin as you mean to proceed.</strong> That means, from the outset, assume everything is going to be a production-class tool and that it needs to be done right. You don&rsquo;t create output using Write-Host*, or output formatted text instead of objects, or any of a dozen other things because <em>eventually</em> that thing you made &ldquo;just for you&rdquo; will end up copied and pasted into something that everyone in the organization depends upon.<br>
And weren&rsquo;t you the one complaining you never have time to do stuff? So where are you going to find the time to go back and <em>re-do something the right way</em>? You won&rsquo;t. Your quick-and-dirty &ldquo;just for me&rdquo; will end up becoming an ugly pimple for the rest of time.<br>
It is <em>rarely</em><em>harder to do something the right way</em> in PowerShell. Yes, the right way might not be what habitually flies off of your fingertips - but that&rsquo;s not extra time, that&rsquo;s just you changing a habit. And again, Write-Host is just a convenient and easy example. I once was helping someone on a script, and in twelve different places, they had copied-and-pasted a short little logical construct to test connectivity to a computer on a specific protocol. It was maybe four lines of code. Most instances were commented out, indicating they&rsquo;d just been for testing.<br>
&ldquo;Why,&rdquo; I asked, &ldquo;didn&rsquo;t you put that into a function, and build a toggle into the function?&rdquo;<br>
&ldquo;Oh, it was just for testing.&rdquo;<br>
&ldquo;Yes, but this script is running a critical process now. It isn&rsquo;t just for testing. And it&rsquo;s fugly.&rdquo;<br>
&ldquo;I didn&rsquo;t have time to go back and&hellip;&rdquo;<br>
Just stop. Ugh. I know. Well, you had time to copy and paste in a dozen places, which took longer than just making the damn function would have taken in the first place.<br>
So the point: bad practices are always bad. Good practices are always good. And you should stay on the right side of the Force all the time, even when it&rsquo;s &ldquo;just for you,&rdquo; because someday that code is going to wind up being not &ldquo;just for you&rdquo; anymore. Begin coding as you mean to proceed: write as if everything&rsquo;s for posterity.</p><p>*unless you&rsquo;re specifically drawing an on-screen menu or something. Maybe then.</p>
]]></content:encoded></item><item><title>Charlotte Powershell User Group Holiday-themed Scripting Games</title><link>https://powershell.org/articles/2013-12-10-charlotte-powershell-user-group-holiday-themed-scripting-games/</link><guid>https://powershell.org/articles/2013-12-10-charlotte-powershell-user-group-holiday-themed-scripting-games/</guid><pubDate>Tue, 10 Dec 2013 22:16:10 +0000</pubDate><description>&lt;p&gt;The Charlotte Powershell Users Group meeting was held on Dec 5th. Jim put together a nifty challenge related to image manipulation. We started off with this nifty image. Pretty huh?&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/12/stegan1.png"&gt;&lt;img src="https://powershell.org/wp-content/uploads/2013/12/stegan1.png" alt="stegan1"&gt;&lt;/a&gt;&lt;br&gt;
The challenge was to manipulate the image using PowerShell to find the hidden message. After some discussion, the code was cracked and the image was displayed. As is normal with Powershell, there were multiple ways to achieve the end goal. Feel free to stop reading here and grab the image if you want to give this a go yourself. Spoilers are below.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>The Charlotte Powershell Users Group meeting was held on Dec 5th. Jim put together a nifty challenge related to image manipulation. We started off with this nifty image. Pretty huh?<br><a href="https://powershell.org/wp-content/uploads/2013/12/stegan1.png"><img src="https://powershell.org/wp-content/uploads/2013/12/stegan1.png" alt="stegan1"/><br>
The challenge was to manipulate the image using PowerShell to find the hidden message. After some discussion, the code was cracked and the image was displayed. As is normal with Powershell, there were multiple ways to achieve the end goal. Feel free to stop reading here and grab the image if you want to give this a go yourself. Spoilers are below.</p><p>Here is one way to find the hidden message:<br>
add-type -AssemblyName system.drawing<br>
$height = $img.Height - 1<br>
$width = $img.Width - 1<br>
$img = [System.Drawing.Image]::FromFile(&ldquo;c:\temp\stegan1.png&rdquo;)<br>
0..$height | %{<br>
$y=$<em>;<br>
0..$width | %{<br>
$x=$</em>;<br>
$p = $img.GetPixel($x,$y);<br>
if ($p.r -ne 0) {<br>
$img.setpixel($x,$y,[System.Drawing.Color]::Green)<br>
}<br>
}<br>
}<br>
$img.save(&lsquo;c:\temp\update.png&rsquo;)<br>
Merry Christmas and Happy Holidays from your Charlotte Powershell Users Group.</p>
]]></content:encoded></item><item><title>PhillyPoSH 12/05/2013 meeting summary and presentation materials</title><link>https://powershell.org/articles/2013-12-09-phillyposh-12052013-meeting-summary-and-presentation-materials/</link><guid>https://powershell.org/articles/2013-12-09-phillyposh-12052013-meeting-summary-and-presentation-materials/</guid><pubDate>Tue, 10 Dec 2013 03:51:19 +0000</pubDate><description>&lt;ol&gt;
&lt;li&gt;
&lt;p&gt; &lt;a href="https://twitter.com/sunnyc7"&gt;Sunny Chakraborty&lt;/a&gt; gave an in-depth presentation on WMI Eventing using PowerShell. A copy of his presentation and scripts can be found &lt;a href="https://powershell.org/wp-content/uploads/2013/12/PhillyPosh_12_05_2014-Sunny.zip"&gt;here&lt;/a&gt;, and a &lt;a href="http://www.youtube.com/watch?v=h3V6K8ov1Ao"&gt;recording&lt;/a&gt; of his presentation can be found on our &lt;a href="http://www.youtube.com/channel/UCAc_ow5FIJtRpvew__9Iqzg"&gt;YouTube channel&lt;/a&gt;. If you want to learn even more about WMI, Sunny recommends checking out &lt;a href="http://www.lissware.net/"&gt;Alain Lissoir&amp;rsquo;s&lt;/a&gt; webpage and downloading he WSH and VBS scripts hosted on his site for the two books he was written: &amp;ldquo;&lt;a href="http://www.amazon.com/exec/obidos/tg/detail/-/1555582664/qid=1048198398/sr=8-1/ref=sr_8_1/102-5879685-5285706?v=glance&amp;amp;s=books&amp;amp;n=507846"&gt;How to exploit the power of Microsoft&amp;rsquo;s WMI to create mission-critical computing infrastructures&lt;/a&gt;&amp;rdquo; and &amp;ldquo;&lt;a href="http://www.amazon.com/exec/obidos/tg/detail/-/1555582990/qid=1048198398/sr=8-2/ref=sr_8_2/102-5879685-5285706?v=glance&amp;amp;s=books&amp;amp;n=507846"&gt;Leveraging Windows Management Instrumentation (WMI) Scripting&lt;/a&gt;&amp;rdquo;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<ol><li><p> <a href="https://twitter.com/sunnyc7">Sunny Chakraborty</a> gave an in-depth presentation on WMI Eventing using PowerShell. A copy of his presentation and scripts can be found<a href="https://powershell.org/wp-content/uploads/2013/12/PhillyPosh_12_05_2014-Sunny.zip">here</a>, and a <a href="http://www.youtube.com/watch?v=h3V6K8ov1Ao">recording</a> of his presentation can be found on our<a href="http://www.youtube.com/channel/UCAc_ow5FIJtRpvew__9Iqzg">YouTube channel</a>. If you want to learn even more about WMI, Sunny recommends checking out<a href="http://www.lissware.net/">Alain Lissoir&rsquo;s</a> webpage and downloading he WSH and VBS scripts hosted on his site for the two books he was written: &ldquo;<a href="http://www.amazon.com/exec/obidos/tg/detail/-/1555582664/qid=1048198398/sr=8-1/ref=sr_8_1/102-5879685-5285706?v=glance&amp;s=books&amp;n=507846">How to exploit the power of Microsoft&rsquo;s WMI to create mission-critical computing infrastructures</a>&rdquo; and &ldquo;<a href="http://www.amazon.com/exec/obidos/tg/detail/-/1555582990/qid=1048198398/sr=8-2/ref=sr_8_2/102-5879685-5285706?v=glance&amp;s=books&amp;n=507846">Leveraging Windows Management Instrumentation (WMI) Scripting</a>&rdquo;</p></li><li><p>Announcements:</p><ul><li><p>January&rsquo;s meeting will be on the 2nd Thursday (<em><strong>01/09/2014</strong></em>) of January as opposed to the       1st</p></li><li><p>Since we didn&rsquo;t get to last months homework assignment we are pushing it to January&rsquo;s meeting. Here it is again and hopefully this will be a fun task that we can discuss during our next meeting:</p></li></ul></li></ol><pre><code>&gt; **Title**: On This Day in Pictures
&gt; **Description:** You have folder of photos on your computer that you take with your Smartphone or digital camera. From time to time you want to be reminded of the cool and interesting things you snapped photos of years before on this day. Being a PowerShell scripter you imagine that PowerShell would be a quick and easy tool for exploring your photo's meta-data to re-discover some fun memories you had by emailing yourself some pictures you took on this same day last year or any year before. You decide to format the email as HTML including the pictures and some data about them. Finally, using the task scheduler to set your script to run every morning so you can take a trip down memory lane with your photos on this day in history. As a PowerShell scripter you roll up your sleeves and get to work.
&gt; **Requirements:**
&gt;
&gt; 1. Your script should look into a directory that may contain sub folders for image files (you may want to support .jpg, .jpeg, .png, etc.).
&gt; 2. The script should then determine the date a photo was taken. Examining the [EXIF][8] meta-data might be handy.
&gt; 3. Get the date the script runs and find all the photos taken on the same day other than the current year.
&gt; 4.  Finally send an email containing the photos taken on this day in history*</code></pre>
]]></content:encoded></item><item><title>Scheduled site downtime</title><link>https://powershell.org/articles/2013-12-02-scheduled-site-downtime/</link><guid>https://powershell.org/articles/2013-12-02-scheduled-site-downtime/</guid><pubDate>Mon, 02 Dec 2013 22:13:41 +0000</pubDate><description>&lt;p&gt;Windows Azure has advised us of scheduled downtime on Friday, December 6, from approximately 15:00 hours (US Pacific) until approximately midnight Pacific time.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Windows Azure has advised us of scheduled downtime on Friday, December 6, from approximately 15:00 hours (US Pacific) until approximately midnight Pacific time.</p>
]]></content:encoded></item><item><title>Community Book of PowerShell Practices</title><link>https://powershell.org/articles/2013-11-14-community-book-of-powershell-practices/</link><guid>https://powershell.org/articles/2013-11-14-community-book-of-powershell-practices/</guid><pubDate>Thu, 14 Nov 2013 18:36:30 +0000</pubDate><description>&lt;p&gt;Released in our new Git repo: _The Community Book of PowerShell Practices, _an ongoing book started from this past Summer&amp;rsquo;s &amp;ldquo;Great Debates&amp;rdquo; blog post series. Grab it from https://github.com/PowerShellOrg/ebooks/blob/master/Practices/2013Sep_Practices/2013Sep_Practices.doc and enjoy!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Released in our new Git repo: _The Community Book of PowerShell Practices, _an ongoing book started from this past Summer&rsquo;s &ldquo;Great Debates&rdquo; blog post series. Grab it from https://github.com/PowerShellOrg/ebooks/blob/master/Practices/2013Sep_Practices/2013Sep_Practices.doc and enjoy!</p>
]]></content:encoded></item><item><title>Last chance for feedback on PowerShell course 10961A/B</title><link>https://powershell.org/articles/2013-11-14-last-chance-for-feedback-on-powershell-course-10961ab/</link><guid>https://powershell.org/articles/2013-11-14-last-chance-for-feedback-on-powershell-course-10961ab/</guid><pubDate>Thu, 14 Nov 2013 17:45:34 +0000</pubDate><description>&lt;p&gt;I&amp;rsquo;m in the midst of working on 10961C, the Windows Server 2012 R2 / Windows 8.1 / PowerShell 4.0 update of Microsoft&amp;rsquo;s 10961A/B course, &amp;ldquo;Automating Administration with Windows PowerShell.&amp;rdquo; I anticipate this being closed out by the end of November, 2013, so if you&amp;rsquo;ve taken or taught this course and have any feedback - even a typo - now&amp;rsquo;s the time to tell me. Drop a comment below, or e-mail me (if you have my address). Please, no Twitter replies on this one.&lt;br&gt;
The course will not be substantially changed from the B rev; because PowerShell v4 doesn&amp;rsquo;t &lt;em&gt;change&lt;/em&gt; much, especially at the entry-level covered by 10961, there wasn&amp;rsquo;t much to alter. But I&amp;rsquo;m trying to sweep up as many lingering bugs and typos as possible. Kudos to MCT Jason Yoder for firing over a list of fixes!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I&rsquo;m in the midst of working on 10961C, the Windows Server 2012 R2 / Windows 8.1 / PowerShell 4.0 update of Microsoft&rsquo;s 10961A/B course, &ldquo;Automating Administration with Windows PowerShell.&rdquo; I anticipate this being closed out by the end of November, 2013, so if you&rsquo;ve taken or taught this course and have any feedback - even a typo - now&rsquo;s the time to tell me. Drop a comment below, or e-mail me (if you have my address). Please, no Twitter replies on this one.<br>
The course will not be substantially changed from the B rev; because PowerShell v4 doesn&rsquo;t <em>change</em> much, especially at the entry-level covered by 10961, there wasn&rsquo;t much to alter. But I&rsquo;m trying to sweep up as many lingering bugs and typos as possible. Kudos to MCT Jason Yoder for firing over a list of fixes!</p><p>Some fun comments from the &ldquo;A&rdquo; rev feedback:</p><blockquote/><blockquote/><blockquote/><blockquote/><blockquote><pre><code> By day 3 (5 day class) most students felt over-whelmed.</code></pre></blockquote><blockquote/><blockquote/><blockquote/><blockquote/><blockquote><pre><code> There is not enough material.</code></pre></blockquote><blockquote/><blockquote/><blockquote/><blockquote/><blockquote/><blockquote/><blockquote/><pre><code> Probably won't be reconciling those two . Fact is, it's really tough to write the perfect course for *everyone*, which is why having a live instructor who knows the material is so important to a great class.
&gt;</code></pre><blockquote/><blockquote/><blockquote/><blockquote><p>No mention of filtering functions.</p></blockquote><blockquote/><blockquote/><blockquote/><pre><code> Because they're largely "leftovers" that were succeeded by pipeline functions. That said, 10961 isn't a programming course; that's where 55039 picks up. If you've got folks who want programming taking 10961, they were placed into the wrong class.</code></pre>]]></content:encoded></item><item><title>PhillyPoSH 11/07/2013 meeting summary and presentation materials</title><link>https://powershell.org/articles/2013-11-12-phillyposh-11072013-meeting-summary-and-presentation-materials/</link><guid>https://powershell.org/articles/2013-11-12-phillyposh-11072013-meeting-summary-and-presentation-materials/</guid><pubDate>Wed, 13 Nov 2013 02:07:36 +0000</pubDate><description>&lt;ol&gt;
&lt;li&gt;&lt;a href="http://mellositmusings.com/"&gt;John Mello&lt;/a&gt; gave a presentation on a script that searches a mailbox for an email by subject and downloads any attachments it may contain. A copy of his scripts can be obtained &lt;a href="http://mellositmusings.com/2013/10/29/powershell-script-to-download-attachments-from-an-email/"&gt;here.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.jasonhelmick.com/"&gt;Jason Helmick&lt;/a&gt;, Senior Technologist at &lt;a href="http://concentratedtech.com/"&gt;Concentrated Tech&lt;/a&gt; and &lt;a href="http://mvp.microsoft.com/en-us/mvp/Jason%20Helmick-5000354"&gt;Windows PowerShell MVP&lt;/a&gt;, gave a presentation on &amp;ldquo;Understanding the Pipeline &amp;ldquo;“ Getting your one-liners to work!&amp;rdquo; A copy of his script can be found &lt;a href="https://powershell.org/wp-content/uploads/2013/11/PhillyPosh_11_07_2013_Jason_Helmick.zip"&gt;here&lt;/a&gt;.
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=uVsMbxj6188"&gt;A recording of Jason Helmick&amp;rdquo;™s presentation&lt;/a&gt; can be found on our &lt;a href="http://www.youtube.com/channel/UCAc_ow5FIJtRpvew__9Iqzg"&gt;YouTube channel&lt;/a&gt;. Due to audio issues, John Mello&amp;quot;™s portion is not included in the recording.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Announcements
&lt;ol&gt;
&lt;li&gt;Tickets are still available for the &lt;a href="https://powershell.org/community-events/summit/powershell-summit-north-america/"&gt;2014 PowerShell Summit North America&lt;/a&gt;, if you&amp;quot;™re going then make sure to say hi to &lt;a href="http://paglia.org/"&gt;Lido Paglia&lt;/a&gt;!&lt;/li&gt;
&lt;li&gt;We are still trying to arrange for a PowerShell Saturday sometime in 2014, if you are interested in presenting please let us know!&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;We are assigning homework this week! Hopefully this will be a fun task that we can discuss during our next meeting, so try your hand at the following problem:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Title&lt;/strong&gt;: On This Day in Pictures&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<ol><li><a href="http://mellositmusings.com/">John Mello</a> gave a presentation on a script that searches a mailbox for an email by subject and downloads any attachments it may contain. A copy of his scripts can be obtained<a href="http://mellositmusings.com/2013/10/29/powershell-script-to-download-attachments-from-an-email/">here.</a></li><li><a href="http://www.jasonhelmick.com/">Jason Helmick</a>, Senior Technologist at<a href="http://concentratedtech.com/">Concentrated Tech</a> and <a href="http://mvp.microsoft.com/en-us/mvp/Jason%20Helmick-5000354">Windows PowerShell MVP</a>, gave a presentation on &ldquo;Understanding the Pipeline &ldquo;“ Getting your one-liners to work!&rdquo; A copy of his script can be found<a href="https://powershell.org/wp-content/uploads/2013/11/PhillyPosh_11_07_2013_Jason_Helmick.zip">here</a>.<ol><li><a href="https://www.youtube.com/watch?v=uVsMbxj6188">A recording of Jason Helmick&rdquo;™s presentation</a> can be found on our<a href="http://www.youtube.com/channel/UCAc_ow5FIJtRpvew__9Iqzg">YouTube channel</a>. Due to audio issues, John Mello"™s portion is not included in the recording.</li></ol></li><li>Announcements<ol><li>Tickets are still available for the<a href="https://powershell.org/community-events/summit/powershell-summit-north-america/">2014 PowerShell Summit North America</a>, if you"™re going then make sure to say hi to<a href="http://paglia.org/">Lido Paglia</a>!</li><li>We are still trying to arrange for a PowerShell Saturday sometime in 2014, if you are interested in presenting please let us know!</li></ol></li><li>We are assigning homework this week! Hopefully this will be a fun task that we can discuss during our next meeting, so try your hand at the following problem:</li></ol><p><strong>Title</strong>: On This Day in Pictures</p><p><strong>Description:</strong> You have folder of photos on your computer that you take with your Smartphone or digital camera. From time to time you want to be reminded of the cool and interesting things you snapped photos of years before on this day. Being a PowerShell scripter you imagine that PowerShell would be a quick and easy tool for exploring your photo"™s meta-data to re-discover some fun memories you had by emailing yourself some pictures you took on this same day last year or any year before. You decide to format the email as HTML including the pictures and some data about them. Finally, using the task scheduler to set your script to run every morning so you can take a trip down memory lane with your photos on &ldquo;this day in history&rdquo;. As a PowerShell scripter you roll up your sleeves and get to work.</p><p><strong>Requirements:</strong></p><ul><li><p>Your script should look into a directory that may contain sub folders for image files (you may want to support .jpg, .jpeg, .png, etc.).</p></li><li><p>The script should then determine the date a photo was taken. Examining the<a href="http://en.wikipedia.org/wiki/Exchangeable_image_file_format">EXIF</a> meta-data might be handy.</p></li><li><p>Get the date the script runs and find all the photos taken on the same day other than the current year.</p></li><li><p> Finally send an email containing the photos taken on this day in history*</p></li></ul>
]]></content:encoded></item><item><title>Login now required for comments</title><link>https://powershell.org/articles/2013-11-11-login-now-required-for-comments/</link><guid>https://powershell.org/articles/2013-11-11-login-now-required-for-comments/</guid><pubDate>Mon, 11 Nov 2013 14:49:05 +0000</pubDate><description>&lt;p&gt;A quick note and an apology: I&amp;rsquo;ve had to modify the site configuration to require users to be registered and logged in before they can comment. We&amp;rsquo;ve been taking a &lt;em&gt;ridiculous&lt;/em&gt; amount of comment spam, and it&amp;rsquo;s consuming more and more time to weed through it.&lt;br&gt;
You can register using any major social media account, so you don&amp;rsquo;t have to remember yet another username and password with us, so hopefully that&amp;rsquo;ll mitigate the inconvenience.&lt;br&gt;
Have a great week!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>A quick note and an apology: I&rsquo;ve had to modify the site configuration to require users to be registered and logged in before they can comment. We&rsquo;ve been taking a <em>ridiculous</em> amount of comment spam, and it&rsquo;s consuming more and more time to weed through it.<br>
You can register using any major social media account, so you don&rsquo;t have to remember yet another username and password with us, so hopefully that&rsquo;ll mitigate the inconvenience.<br>
Have a great week!</p>
]]></content:encoded></item><item><title>Monitoring SQL Server Backups</title><link>https://powershell.org/articles/2013-11-06-monitoring-sql-server-backups/</link><guid>https://powershell.org/articles/2013-11-06-monitoring-sql-server-backups/</guid><pubDate>Thu, 07 Nov 2013 07:30:31 +0000</pubDate><description>&lt;p&gt;One of the most important tasks for the** **DBAs is to ensure that there is a maintenance plan to recover data from a given disaster.
 
As a DBA we need to design a maintenance plan according to our scenario and business requirements. Do we want to be able to recover data at any point of time? How much data loss can we accept? All these questions and many more must be answered before designing the plan. In this post we will assume a basic daily full backup to keep our data safe, we will assume that there is a job performing full backups to our databases every day at midnight.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>One of the most important tasks for the** **DBAs is to ensure that there is a maintenance plan to recover data from a given disaster.
 
As a DBA we need to design a maintenance plan according to our scenario and business requirements. Do we want to be able to recover data at any point of time? How much data loss can we accept? All these questions and many more must be answered before designing the plan. In this post we will assume a basic daily full backup to keep our data safe, we will assume that there is a job performing full backups to our databases every day at midnight.</p><p>The next step after we have defined and implemented the maintenance plan is to monitor that all backups are being executed. In order to reach our goal it will be necessary to know whether a backup has been done or not and that could be possible by monitoring the backup job or querying the msdb database metadata among many other options. For this post we will use the second option, we will query msdb to check databases backup information. The main reason why we choose this option is because of the variability of backup maintenance plan definitions. The backup job is defined by every DBA and we cannot assume that all databases are included in the maintenance plan, on the other hand by querying msdb we will know for sure the databases which have been backed up and those that have not been backed up.</p><h1 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>Querying msdb database</p><p>As it has been explained before querying msdb database will give us the truth about database backups. Running the following query we will know how many days have happened since the last full backup of every database:</p><p>Use</p><p>msdb
;</p><p> </p><p>with</p><p>backup_info</p><p>as</p><p>(</p><p>   </p><p>select</p><p>       
bck
.
database_name
,</p><p>       
bck
.
database_guid
,</p><p>       
bck
.
backup_start_date
,</p><p>       
bck
.
backup_finish_date
,</p><p>       
bckmf
.
physical_device_name
as
BackupFile_Path
,</p><h1 id="backuptype" class="ps-heading">       
BackupType<a class="ps-heading-anchor" href="#backuptype" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>       </p><p>case</p><p>           </p><h1 id="type" class="ps-heading">when
bck
.
[type]<a class="ps-heading-anchor" href="#type" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>&lsquo;I&rsquo;</p><p>then</p><p>&lsquo;Differential&rsquo;</p><p>           </p><p>when</p><p>type</p><p>=</p><p>&lsquo;D&rsquo;</p><p>then</p><p>&lsquo;Full&rsquo;</p><p>           </p><p>when</p><p>type</p><p>=</p><p>&lsquo;L&rsquo;</p><p>then</p><p>&lsquo;Log&rsquo;</p><p>           </p><p>else</p><p>&lsquo;Unknown&rsquo;</p><p>       </p><p>end</p><p>   </p><p>from
backupset
as
bck</p><p>   </p><p>inner</p><p>join
backupmediafamily
as
bckmf</p><p>       </p><h1 id="media_set_id" class="ps-heading">on
bck
.
media_set_id<a class="ps-heading-anchor" href="#media_set_id" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>bckmf
.
media_set_id</p><p>),</p><p>Last_Backups</p><p>as</p><p>(</p><p>     </p><p>select</p><ul><li/></ul><p>     </p><p>from</p><p>     </p><p>(</p><p>           </p><p>select</p><p>                 </p><p>ROW_NUMBER</p><p>()</p><p>over</p><p>(</p><p>PARTITION</p><p>BY
V
.
database_guid, V.BackupType 
order</p><p>by
V
.
backup_start_date
desc</p><p>)</p><p>as
r
,</p><p>                 </p><ul><li/></ul><p>           </p><p>from
backup_info
as
V</p><p>     </p><p>)</p><p>as
VV</p><p>     </p><h1 id="r" class="ps-heading">where
VV
.
r<a class="ps-heading-anchor" href="#r" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><h1 id="backuptype-1" class="ps-heading">1
and
VV
.
BackupType<a class="ps-heading-anchor" href="#backuptype-1" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>&lsquo;FULL&rsquo;</p><p>),</p><p>dbs</p><p>as</p><p>(</p><p>     </p><p>select</p><p>   
name
,
database_guid
,
state_desc</p><p>     </p><p>from</p><p>sys</p><p>.</p><p>databases</p><p>as
dbs</p><p>     </p><p>inner</p><p>join</p><p>sys</p><p>.</p><p>database_recovery_status</p><p>as
dbrs</p><p>           </p><h1 id="database_id" class="ps-heading">on
dbrs
.
database_id<a class="ps-heading-anchor" href="#database_id" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>dbs
.
database_id</p><p>)</p><p>select</p><p>   
name
,</p><p>   </p><p>case</p><p>when
V
.
database_name
is</p><p>null</p><p>then
365
else</p><p>DATEDIFF</p><p>(</p><p>day</p><p>,
backup_start_date
,</p><p>GETDATE</p><p>())</p><p>end</p><p>as
DaysSinceLastBackup</p><p>from</p><p>dbs</p><p>left</p><p>join
Last_Backups
as
V</p><p>   </p><h1 id="database_guid" class="ps-heading">on
V
.
database_guid<a class="ps-heading-anchor" href="#database_guid" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>dbs
.
database_guid</p><p>where</p><h1 id="state_desc" class="ps-heading">dbs
.
state_desc<a class="ps-heading-anchor" href="#state_desc" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>&lsquo;ONLINE&rsquo;</p><p>and
name
&lt;&gt;</p><p>&lsquo;TempDB&rsquo;</p><p>order</p><p>by
2
desc</p><p>;</p><p> </p><p>Notice that databases that never have been backed up will return 365 days as the number of days since the last full backup.</p><p>This query returns the desired information like follows:</p><p><a href="https://powershell.org/wp-content/uploads/2013/11/image.png"><img src="https://powershell.org/wp-content/uploads/2013/11/image_thumb.png" alt="image"/></p><p>In this case we can see a basic example with system databases with 0 days since last full backup, which means that all databases are up to date with full backups. Another possible result could be:</p><p><a href="https://powershell.org/wp-content/uploads/2013/11/image1.png"><img src="https://powershell.org/wp-content/uploads/2013/11/image_thumb1.png" alt="image"/></p><p>In this case databases last full backup was four days ago. This second example could be a reason to be alarmed because in case of a disaster we only can recover data until four days ago, all changes made during the last four days would be lost.</p><p>Notice that databases that never have been backed up will return 365 days as the number of days since the last full backup.</p><p>As it was shown before, the query could help us to monitor backups in a single instance but what happen when the DBA has to monitor and manage more than one instance? And what if those instances are from different SQL Server Versions? Things start to get complicated and doing it one by one manually is not an option! I"™m currently facing that situation; I"™m managing more than 80 SQL Server instances from different versions. Here is when PowerShell comes to help the DBA.</p><h1 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>PowerShell Solution</p><p>With PowerShell we will be able to query all msdb databases from all the desired SQL Server instances. The solution will have two files:</p><p>              1. Xml file with Server information</p><p>a.
      </p><p>SQL Server instance, user name, password"¦</p><p>              2. PowerShell script</p><p>The idea is to run the query to msdb for every server registered in the xml file. For instance the XML file structure could like follows:</p><p><a href="https://powershell.org/wp-content/uploads/2013/11/image5.png"><img src="https://powershell.org/wp-content/uploads/2013/11/image_thumb5.png" alt="image"/></p><p>For this demonstration we only need to provide the instance name, the SQL Server user name and the password to connect. The reason why I"™m using SQL Server authentication is because not all my SQL Server instances are in the same domain so I need to be able to connect to all of them from a single point (where the script is running). Anyway the script can always be modified to connect with integrated authentication easily.</p><p>With the xml file ready the only thing missing is the script file which will read the xml file and execute the query for every server. The script looks like follows:</p><p>Param</p><p>(</p><p> 
[</p><p>int</p><p>]</p><p>$DaysSinceLastBackup</p><p>=-</p><p>1,</p><p> 
[</p><p>string</p><p>]</p><p>$serversPath</p><p>=</p><p>&ldquo;C:\tmp\Servers.xml&rdquo;</p><p> 
)</p><p> </p><p>Function</p><p>Get-SQLServer-DataTable</p><p>([</p><p>string</p><p>]</p><p>$conn</p><p>, [</p><p>string</p><p>]</p><p>$query</p><p>)</p><p> 
{</p><p>    </p><p>$SqlConnection</p><p>=</p><p>New-Object</p><p>System.Data.SqlClient.SqlConnection</p><p>;</p><p>    </p><p>$SqlConnection</p><p>.</p><p>ConnectionString</p><p>=</p><p>$conn</p><p>    </p><p>$SqlCmd</p><p>=</p><p>New-Object</p><p>System.Data.SqlClient.SqlCommand</p><p>;</p><p>    </p><p>$SqlCmd</p><p>.</p><p>CommandText</p><p>=</p><p>$query</p><p>;</p><p>    </p><p>$SqlCmd</p><p>.</p><p>Connection</p><p>=</p><p>$SqlConnection</p><p>;</p><p>    </p><p>$SqlAdapter</p><p>=</p><p>New-Object</p><p>System.Data.SqlClient.SqlDataAdapter</p><p>;</p><p>    </p><p>$SqlAdapter</p><p>.</p><p>SelectCommand</p><p>=</p><p>$SqlCmd</p><p>;</p><p>    </p><p>$DataTable</p><p>=</p><p>New-Object</p><p>System.Data.DataTable</p><p>;</p><p>    </p><p>$SqlAdapter</p><p>.</p><p>Fill</p><p>(</p><p>$DataTable</p><p>)</p><p>|</p><p>out</p><ul><li/></ul><p>Null;</p><p>    </p><p>$SqlConnection</p><p>.</p><p>Close</p><p>()</p><p>;</p><p>    </p><p>    </p><p>return</p><p>$DataTable</p><p>;</p><p>}</p><p> </p><p>Function</p><p>Get-SQLDatabaseBackupsInfo</p><p>([</p><p>string</p><p>]</p><p>$conn</p><p>)</p><p>{</p><p>     </p><p>$query</p><p>=</p><p>"</p><p>           </p><p>Use</p><p>msdb;</p><p>           </p><p>           </p><p>with</p><p>backup_info</p><p>           </p><p>as</p><p>           
(</p><p>                 </p><p>select</p><p>                       </p><p>bck.database_name</p><p>,</p><p>                       </p><p>bck.database_guid</p><p>,</p><p>                       </p><p>bck.backup_start_date</p><p>,</p><p>                       </p><p>bck.backup_finish_date</p><p>,</p><p>                       </p><p>bckmf.physical_device_name</p><p>as</p><p>BackupFile_Path</p><p>,</p><p>                       </p><p>BackupType</p><p>=</p><p>                       </p><p>case</p><p>                            </p><p>when</p><p>bck</p><p>.[</p><p>type</p><p>]</p><p>=</p><p>&lsquo;I&rsquo;</p><p>then</p><p>&lsquo;Differential&rsquo;</p><p>                            </p><p>when</p><p>type</p><p>=</p><p>&lsquo;D&rsquo;</p><p>then</p><p>&lsquo;Full&rsquo;</p><p>                            </p><p>when</p><p>type</p><p>=</p><p>&lsquo;L&rsquo;</p><p>then</p><p>&lsquo;Log&rsquo;</p><p>                            </p><p>else</p><p>&lsquo;Unknown&rsquo;</p><p>                       </p><p>end</p><p>                 </p><p>from</p><p>backupset</p><p>as</p><p>bck</p><p>                 </p><p>inner</p><p>join</p><p>backupmediafamily</p><p>as</p><p>bckmf</p><p>                       </p><p>on</p><p>bck.media_set_id</p><p>=</p><p>bckmf.media_set_id</p><p>           
),</p><p>Last_Backups</p><p>           </p><p>as</p><p>           
(</p><p>                 </p><p>select</p><ul><li/></ul><p>                 </p><p>from</p><p>                 
(</p><p>                       </p><p>select</p><p>                            </p><p>ROW_NUMBER</p><p>()</p><p>over</p><p>(</p><p>PARTITION </p><p>BY </p><p>V.database_guid, V.BackupType </p><p>order </p><p>by </p><p>V.backup_start_date </p><p>desc</p><p>)</p><p>as</p><p>r</p><p>,</p><p>                            </p><ul><li/></ul><p>                       </p><p>from </p><p>backup_info </p><p>as </p><p>V</p><p>                 
)</p><p>as </p><p>VV</p><p>                 </p><p>where </p><p>VV.r</p><p>=</p><p>1</p><p>and </p><p>VV.BackupType</p><p>=</p><p>&lsquo;FULL&rsquo;</p><p>           
),</p><p>dbs</p><p>           </p><p>as</p><p>           
(</p><p>                 </p><p>select</p><p>                 </p><p>name</p><p>,</p><p>database_guid</p><p>,</p><p>state_desc</p><p>                 </p><p>from </p><p>sys.databases </p><p>as </p><p>dbs</p><p>                 </p><p>inner </p><p>join </p><p>sys.database_recovery_status </p><p>as </p><p>dbrs</p><p>                       </p><p>on </p><p>dbrs.database_id</p><p>=</p><p>dbs.database_id</p><p>           </p><p>)</p><p>           </p><p>select</p><p>                 </p><p>@@</p><p>SERVERNAME </p><p>as </p><p>ServerName</p><p>,</p><p>                 </p><p>name</p><p>as</p><p>DbName</p><p>,</p><p>                 </p><p>case </p><p>when </p><p>V.database_name </p><p>is </p><p>null </p><p>then</p><p>365</p><p>else </p><p>DATEDIFF</p><p>(</p><p>day</p><p>,</p><p>backup_start_date</p><p>,</p><p>GETDATE</p><p>())</p><p>end </p><p>as </p><p>DaysSinceLastBackup</p><p>           </p><p>from </p><p>dbs</p><p>           </p><p>left </p><p>join </p><p>Last_Backups </p><p>as </p><p>V</p><p>                 </p><p>on </p><p>V.database_guid</p><p>=</p><p>dbs.database_guid</p><p>           </p><p>where </p><p>dbs.state_desc</p><p>=</p><p>&lsquo;ONLINE&rsquo; </p><p>and </p><p>name</p><p>&lt;&gt;</p><p>&lsquo;TempDB&rsquo;</p><p>           </p><p>order </p><p>by</p><p>2</p><p>desc;</p><p>                 
"</p><p>;</p><p>     </p><p>return </p><p>Get</p><ul><li/></ul><p>SQLServer</p><ul><li/></ul><p>DataTable </p><p>$conn </p><p>$query</p><p>;</p><p>}</p><p> </p><p>   </p><p> 
[</p><p>xml</p><p>]</p><p>$xml</p><p>=</p><p>Get-Content </p><p>$serversPath</p><p> </p><p>$xml</p><p>.</p><p>Servers</p><p>.</p><p>server</p><p>|</p><p>foreach</p><ul><li/></ul><p>object</p><p>{</p><p>   </p><p>$it</p><p>=</p><p>$_</p><p>;</p><p>   </p><p>$instance</p><p>=</p><p>$it</p><p>.</p><p>InstanceName</p><p>;</p><p>   </p><p>$user</p><p>=</p><p>$it</p><p>.</p><p>username</p><p>;</p><p>   </p><p>$pass</p><p>=</p><p>$it</p><p>.</p><p>password</p><p>;</p><p>   </p><p>   </p><p>$conn</p><p>=</p><p>&ldquo;Server = $instance; Database = master; User=$user;Password=$pass;&rdquo;</p><p>;</p><p>     </p><p>     </p><p>Get-SQLDatabaseBackupsInfo </p><p>$conn
|</p><p>where-object</p><p>{</p><p>$_</p><p>.</p><p>DaysSinceLastBackup </p><p>-gt </p><p>$DaysSinceLastBackup</p><p>}</p><p> </p><p>|</p><p> </p><p>select</p><p>ServerName</p><p>,</p><p>DbName</p><p>,</p><p>DaysSinceLastBackup</p><p>;</p><p> </p><p> </p><p>}</p><p>The script has two parameters:</p><p> 
        </p><p>**
DaysSinceLastBackup
**
: A threshold to filter result. The result will show all databases which latest full backups are older than the parameter value. The value by default is -1, a negative value that will make to show all results.</p><p> 
         </p><dl><dt>**</dt><dt>ServersPath</dt><dt>**</dt><dd>The path where the XML file with all servers is allocated.</dd></dl><p>So we can execute the script like follows:</p><p><a href="https://powershell.org/wp-content/uploads/2013/11/image6.png"><img src="https://powershell.org/wp-content/uploads/2013/11/image_thumb6.png" alt="image"/></p><p>The example shown before executes the script passing the two parameters, the first one is the xml file and the second one is the Threshold. In this case we have used the value 2, which means that the script will return all databases which latest full backups are older than 2 days. In this case only the database<strong>test</strong> matches the condition, the result shows 365 days since the last full backup which means that this database has never been backed up.</p><p>On the other hand, if we execute the script without parameters we will see the information of all databases, this is what it will look like :</p><p><a href="https://powershell.org/wp-content/uploads/2013/11/image7.png"><img src="https://powershell.org/wp-content/uploads/2013/11/image_thumb7.png" alt="image"/></p><h1 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>Conclusion</p><p>As it has been shown during this post, is very easy to monitor SQL Server Backups over different servers in a very fast and efficient way by using PowerShell. Once we have this script we can implement a scheduled task and use it to generate HTML reports or alarms to notify the DBAs and System administrators about the databases backup status. Once again PowerShell comes up to save the day and make our working life easier.</p>
]]></content:encoded></item><item><title>Configuring a Desired State Configuration Client</title><link>https://powershell.org/articles/2013-11-06-configuring-a-desired-state-configuration-client/</link><guid>https://powershell.org/articles/2013-11-06-configuring-a-desired-state-configuration-client/</guid><pubDate>Wed, 06 Nov 2013 23:47:22 +0000</pubDate><description>&lt;p&gt;Once we have our pull server in place and we&amp;rsquo;re starting to create configurations, we need to set up our client nodes to be able to connect to the pull server and how we want the node to behave.&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;, &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;Configuring Clients (this post)&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="examining-the-local-configuration-manager" class="ps-heading"&gt;Examining the Local Configuration Manager&lt;a class="ps-heading-anchor" href="#examining-the-local-configuration-manager" 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;The Desired State Configuration agent included in Windows Management Framework 4 (or natively on Server 2012 R2 / Windows 8.1) is exposed through the Local Configuration Manager.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Once we have our pull server in place and we&rsquo;re starting to create configurations, we need to set up our client nodes to be able to connect to the pull server and how we want the node to behave.</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>,<a href="https://powershell.org/2013/10/14/building-a-desired-state-configuration-configuration-part-2/">two of two</a>)</li><li>Configuring Clients (this post)</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="examining-the-local-configuration-manager" class="ps-heading">Examining the Local Configuration Manager<a class="ps-heading-anchor" href="#examining-the-local-configuration-manager" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>The Desired State Configuration agent included in Windows Management Framework 4 (or natively on Server 2012 R2 / Windows 8.1) is exposed through the Local Configuration Manager.</p><p><code>PS&gt; Get-DscLocalConfigurationManager AllowModuleOverwrite : False CertificateID : ConfigurationID : ConfigurationMode : ApplyAndMonitor ConfigurationModeFrequencyMins : 30 Credential : DownloadManagerCustomData : DownloadManagerName : RebootNodeIfNeeded : False RefreshFrequencyMins : 15 RefreshMode : PUSH PSComputerName :</code>This is where we can configure the behavior of DSC for a particular node.  So, how do we configure it?  With DSC of course!<br>
There is a configuration option LocalConfigurationManager that allows us to set values for the Local Configuration Manager.  A sample configuration looks something like this:</p><p><code>configuration LetsGetConfiguring { param ($NodeId, $PullServer) LocalConfigurationManager { AllowModuleOverwrite = 'True' ConfigurationID = $NodeId ConfigurationModeFrequencyMins = 60 ConfigurationMode = 'ApplyAndAutoCorrect' RebootNodeIfNeeded = 'True' RefreshMode = 'PULL' DownloadManagerName = 'WebDownloadManager' DownloadManagerCustomData = (@{ServerUrl = "https://$PullServer/psdscpullserver.svc"}) } }</code>While this configuration looks similar to other configurations we might create, we need to apply it with a different command - Set-DscLocalConfigurationManager.</p><p><code>LetsGetConfiguring -NodeId 71defb7f-232b-4213-b289-08c3d424e162 -PullServer pullserver.somedomain.com Set-DscLocalConfigurationManager -path LetsGetConfiguring</code>The Local Configuration Manager offers a number of options, which we&rsquo;ll examine.</p><h4 id="allowmoduleoverwrite" class="ps-heading">AllowModuleOverwrite<a class="ps-heading-anchor" href="#allowmoduleoverwrite" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h4><p>This one is pretty straight-forward and only impacts configurations where you are using a pull server.  If you allow module overwrite, newer versions of modules can replace existing modules.  If you don&rsquo;t enable this, you&rsquo;ll have to manually remove modules if you want a new copy to pull down.</p><h4 id="certificateid" class="ps-heading">CertificateID<a class="ps-heading-anchor" href="#certificateid" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h4><p>CertficateID is a thumbprint of a certificate in the machine certificate store that will be used to decrypt any secrets present in the configuration.  DSC allows PSCredential objects to be marshaled through a MOF file, but requires them (without explicit authorization) to be encrypted. (There is another option as well, if you use the ConfigurationData feature, you can also supply the path to a certificate file to use - I&rsquo;ll be blogging that scenario later when I cover some more advanced scenarios.)</p><h4 id="configurationid" class="ps-heading">ConfigurationID<a class="ps-heading-anchor" href="#configurationid" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h4><p>The ConfigurationID is a GUID which uniquely identifies what configuration a node should retrieve from a pull server.  If you haven&rsquo;t had to generate GUIDs before, a really easy way to do so is:</p><p><code>PS&gt; [guid]::NewGuid().Guid</code>#### ConfigurationMode</p><p>ConfigurationMode defines how the DSC client operates.  There are three valid values:</p><ul><li>Apply</li><li>ApplyAndMonitor</li><li>ApplyAndAutoCorrect</li></ul><p>(NOTE:  These descriptions of functionality are based on limited testing - the TechNet documentation is not up to date yet, but should be in the near future.)<br>
Apply will apply the configuration once and after a successful run is logged, it will stop attempting to apply configuration or checking the configuration.  ApplyAndMonitor will apply a configuration as in Apply, but will continue to validate that a node is configured as described.  No corrective action will take place if there is configuration drift.  Finally, ApplyAndAutoCorrect is what most of us think of when looking at DSC as a configuration management tool.  This setting applies a configuration and checks it regularly.  If configuration drift is detected, the configuration manager will attempt to return the machine to the<em>desired state</em> (see how I worked the product name in there..).</p><h4 id="configurationmodefrequencymins" class="ps-heading">ConfigurationModeFrequencyMins<a class="ps-heading-anchor" href="#configurationmodefrequencymins" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h4><p>This setting determines how frequently the configured method (the RefreshMode) will be run.  In the case of a pull server, this is how frequently the pull server will be checked for updated configurations.  The minimum value for this is 30.  This value needs to be a multiple of the RefreshFrequencyMins.  If it is not, the engine will treat it as if it was a multiple (rounded up).</p><h4 id="credential" class="ps-heading">Credential<a class="ps-heading-anchor" href="#credential" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h4><p>The Credential supplied can be used for accessing remote resources.</p><h4 id="downloadmanagercustomdata" class="ps-heading">DownloadManagerCustomData<a class="ps-heading-anchor" href="#downloadmanagercustomdata" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h4><p>DownloadManagerCustomData is a hashtable of values that is passed to the specified download manager.  In the case of a a pull server, the two possible keys are ServerUrl and AllowUnsecureConnection.</p><h4 id="downloadmanagername" class="ps-heading">DownloadManagerName<a class="ps-heading-anchor" href="#downloadmanagername" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h4><p>Here is where we specify which download manager to use.  DSC ships with two options, the WebDownloadManager (for the web-based pull server) and the DSCFileDownloadManager (for using an SMB share).</p><h4 id="rebootnodeifneeded" class="ps-heading">RebootNodeIfNeeded<a class="ps-heading-anchor" href="#rebootnodeifneeded" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h4><p>Here&rsquo;s another pretty self-explanatory setting.  DSC offers a method for resources to request a reboot.  If this setting is $true, then DSC will reboot the node when it is requested.  If it is set to $false, DSC will notify (via the verbose stream and the DSC log) that a reboot is required, but not actually reboot the node.</p><h4 id="refreshfrequencymins" class="ps-heading">RefreshFrequencyMins<a class="ps-heading-anchor" href="#refreshfrequencymins" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h4><p>The RefreshFrequencyMins setting determines how often DSC runs an integrity check against the cached configuration value (or if the check falls on the ConfigurationModeFrequencyMins interval against the pull server if one is configured).  The minimum value for this setting is 15 minutes.</p><h4 id="refreshmode" class="ps-heading">RefreshMode<a class="ps-heading-anchor" href="#refreshmode" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h4><p>RefreshMode is either PUSH or PULL.  If you set the RefreshMode to PULL, you&rsquo;ll need to configure a download manager (via DownloadManagerName).<br>
Next up, we&rsquo;ll look at how we can build custom resources.</p>
]]></content:encoded></item><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><item><title>Winter Scripting Games Tentatively Scheduled</title><link>https://powershell.org/articles/2013-09-29-winter-scripting-games-tentatively-scheduled/</link><guid>https://powershell.org/articles/2013-09-29-winter-scripting-games-tentatively-scheduled/</guid><pubDate>Sun, 29 Sep 2013 16:34:46 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;re tentatively scheduling the 2014 Winter Scripting Games for 4-6 weeks beginning January 6, 2014. Right now, we&amp;rsquo;re running functional tests on the platform (which will be all-new and much-improved), and soliciting scenarios from MVPs and PowerShell celebrities.&lt;br&gt;
As previously announced, players will work in teams of 2-6 in this edition of the Games, and it&amp;rsquo;s never too early to start finding friends to form a team with you. Because you&amp;rsquo;ll be working in teams, and because you&amp;rsquo;ll have a full week to complete each scenario, expect more complex scenarios! You&amp;rsquo;ll have to practice breaking down tasks and assigning them to team members.&lt;br&gt;
You&amp;rsquo;ll also need to think about how you want to collaborate as a team. We&amp;rsquo;ll be providing a very basic private in-Game discussion thread for each team, but you&amp;rsquo;re welcome to use Git, PoshCode, e-mail, MailChimp lists, or &lt;em&gt;whatever&lt;/em&gt; for your collaboration. You&amp;rsquo;ll be able to submit your entries&amp;rsquo; files whenever you like, and revise them to your heart&amp;rsquo;s content right up to the entry submission deadline.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;re tentatively scheduling the 2014 Winter Scripting Games for 4-6 weeks beginning January 6, 2014. Right now, we&rsquo;re running functional tests on the platform (which will be all-new and much-improved), and soliciting scenarios from MVPs and PowerShell celebrities.<br>
As previously announced, players will work in teams of 2-6 in this edition of the Games, and it&rsquo;s never too early to start finding friends to form a team with you. Because you&rsquo;ll be working in teams, and because you&rsquo;ll have a full week to complete each scenario, expect more complex scenarios! You&rsquo;ll have to practice breaking down tasks and assigning them to team members.<br>
You&rsquo;ll also need to think about how you want to collaborate as a team. We&rsquo;ll be providing a very basic private in-Game discussion thread for each team, but you&rsquo;re welcome to use Git, PoshCode, e-mail, MailChimp lists, or <em>whatever</em> for your collaboration. You&rsquo;ll be able to submit your entries&rsquo; files whenever you like, and revise them to your heart&rsquo;s content right up to the entry submission deadline.</p><blockquote><p>As a tip, I&rsquo;ll <em>strongly</em> suggest setting up a free repository on GitHub. It&rsquo;s very easy to use (free GUI tools are available), it&rsquo;s <em>great</em> for version-controlled collaboration (that&rsquo;s the point of it), and we&rsquo;re going to try and set up a way where the Scripting Games system can automatically retrieve your latest files right from Git. That means, if you&rsquo;re using Git, you wouldn&rsquo;t have to manually copy-and-paste your entries into the Games! Git also offers the ability to create issues (bugs), maintain a project wiki, and more. It&rsquo;s a great system to learn to use.</p></blockquote><p>Even if you&rsquo;re collaborating outside the Games system (which we expect many will do), we encourage you to drop your current files into the Games system every day or so. We&rsquo;ll be recruiting expert Coaches to drop in, see what you&rsquo;re doing, and offer commentary using the in-Games discussion thread for your team.<br>
Scoring will be provided by a panel of expert judges, who will be using multi-item scoring rubrics (which you&rsquo;ll be given as part of your scenario). That means you won&rsquo;t have a 1-to-5-star score, but rather a complete &ldquo;scorecard&rdquo; with multiple items, as well as comments from each judge.<br>
Once scoring is complete, you&rsquo;ll be able to see all other teams&rsquo; entries and scores, judge comments, and so on.<br>
More details are still forthcoming, but we hope you&rsquo;re getting amped up about this next edition of the Scripting Games!</p>
]]></content:encoded></item><item><title>The New Look of the Scripting Games</title><link>https://powershell.org/articles/2013-09-24-the-new-look-of-the-scripting-games/</link><guid>https://powershell.org/articles/2013-09-24-the-new-look-of-the-scripting-games/</guid><pubDate>Tue, 24 Sep 2013 16:25:35 +0000</pubDate><description>&lt;p&gt;I&amp;rsquo;ve been busily working on a new interface for the Scripting Games - we&amp;rsquo;re still planning a Winter Games event - and wanted to share progress. You can click this thumbnail to see the full image.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://powershell.org/wp-content/uploads/2013/09/games.png"&gt;&lt;img src="https://powershell.org/wp-content/uploads/2013/09/games-150x150.png" alt="The new Scripting Games features movable, resizable panels"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;The new Scripting Games features movable, resizable panes
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The new layout features movable, resizable panels, allowing you to position them however works best on your screen. No, they&amp;rsquo;re not especially mobile-friendly.&lt;br&gt;
As you can see (at least in implication), entries can consist of multiple files, as in a complex script module. There&amp;rsquo;s a team-level discussion as well as (as shown) discussion threads for each file. Any player on the team can add new files, delete files, or modify existing files by uploading a replacement. This view shows that I joined the team &amp;ldquo;Aliens&amp;rdquo; after the current event had started, which is why I&amp;rsquo;m unable to contribute new files.&lt;br&gt;
Your team won&amp;rsquo;t be restricted to using the Scripting Games Web site. In fact, you can collaborate and communicate however you like. Use Git or PoshCode for your scripts, and e-mail or a discussion list for communications. It&amp;rsquo;s your choice.&lt;br&gt;
We&amp;rsquo;ll be recruiting a team of Coaches, who will browse whatever you&amp;rsquo;ve added to the Scripting Games Web site in advance of the event deadline, offering their own comments - you can see that Coach comments are highlighted for easy recognition. It&amp;rsquo;ll pay to drop code into the Web site every day so our coaches have something to comment upon, and to check in daily for any coach comments that may have been left.&lt;br&gt;
The upcoming Games events will be more complicated - you&amp;rsquo;ve got a team to work with, so we figure you can handle an extra challenge. Event scenarios will be authored by a team of community all-star volunteers, including The Scripting Guys and various MVPs and enthusiasts. That should give each scenario a slightly different flavor, exposing you to a wider variety of real-world challenges.&lt;br&gt;
Judging of team entries will involve a more complex scoring rubric than our past 1-to-5-stars technique - giving you a more detailed scorecard. Keep in mind that each team will be able to submit only one combined entry, which will give our judges fewer to look at - and more time to look at each one. The new rubric will still allow judges to express some personal tastes and opinions, so you shouldn&amp;rsquo;t expect to be able to please everyone every time!&lt;br&gt;
Team assembly will allow you to form your own team, or be automatically assigned to a team that needs players (teams MUST have 2 players to participate). We&amp;rsquo;ve rigged the system to ask for your time zone, and to display the average time zone offset of potential teams. That way, you can look for a team whose players are geographically close to you, helping to facilitate any real-time collaboration you might set up (via YouTube, Google+, or whatever). If you choose auto-assignment, the system looks for a team whose players are geographically close to you, relatively speaking.&lt;br&gt;
Local user groups are encouraged to form their own team, and to have their own members join - that way, the Scripting Games can be the topic of a monthly meeting or two.&lt;br&gt;
Things are still evolving and under development, but wanted to share this early look!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I&rsquo;ve been busily working on a new interface for the Scripting Games - we&rsquo;re still planning a Winter Games event - and wanted to share progress. You can click this thumbnail to see the full image.</p><p><a href="https://powershell.org/wp-content/uploads/2013/09/games.png"><img src="https://powershell.org/wp-content/uploads/2013/09/games-150x150.png" alt="The new Scripting Games features movable, resizable panels"/></p><pre><code>The new Scripting Games features movable, resizable panes</code></pre><p>The new layout features movable, resizable panels, allowing you to position them however works best on your screen. No, they&rsquo;re not especially mobile-friendly.<br>
As you can see (at least in implication), entries can consist of multiple files, as in a complex script module. There&rsquo;s a team-level discussion as well as (as shown) discussion threads for each file. Any player on the team can add new files, delete files, or modify existing files by uploading a replacement. This view shows that I joined the team &ldquo;Aliens&rdquo; after the current event had started, which is why I&rsquo;m unable to contribute new files.<br>
Your team won&rsquo;t be restricted to using the Scripting Games Web site. In fact, you can collaborate and communicate however you like. Use Git or PoshCode for your scripts, and e-mail or a discussion list for communications. It&rsquo;s your choice.<br>
We&rsquo;ll be recruiting a team of Coaches, who will browse whatever you&rsquo;ve added to the Scripting Games Web site in advance of the event deadline, offering their own comments - you can see that Coach comments are highlighted for easy recognition. It&rsquo;ll pay to drop code into the Web site every day so our coaches have something to comment upon, and to check in daily for any coach comments that may have been left.<br>
The upcoming Games events will be more complicated - you&rsquo;ve got a team to work with, so we figure you can handle an extra challenge. Event scenarios will be authored by a team of community all-star volunteers, including The Scripting Guys and various MVPs and enthusiasts. That should give each scenario a slightly different flavor, exposing you to a wider variety of real-world challenges.<br>
Judging of team entries will involve a more complex scoring rubric than our past 1-to-5-stars technique - giving you a more detailed scorecard. Keep in mind that each team will be able to submit only one combined entry, which will give our judges fewer to look at - and more time to look at each one. The new rubric will still allow judges to express some personal tastes and opinions, so you shouldn&rsquo;t expect to be able to please everyone every time!<br>
Team assembly will allow you to form your own team, or be automatically assigned to a team that needs players (teams MUST have 2 players to participate). We&rsquo;ve rigged the system to ask for your time zone, and to display the average time zone offset of potential teams. That way, you can look for a team whose players are geographically close to you, helping to facilitate any real-time collaboration you might set up (via YouTube, Google+, or whatever). If you choose auto-assignment, the system looks for a team whose players are geographically close to you, relatively speaking.<br>
Local user groups are encouraged to form their own team, and to have their own members join - that way, the Scripting Games can be the topic of a monthly meeting or two.<br>
Things are still evolving and under development, but wanted to share this early look!</p>
]]></content:encoded></item><item><title>Seeking Curators for PowerShell eBooks</title><link>https://powershell.org/articles/2013-09-23-seeking-curators-for-powershell-ebooks/</link><guid>https://powershell.org/articles/2013-09-23-seeking-curators-for-powershell-ebooks/</guid><pubDate>Mon, 23 Sep 2013 19:15:22 +0000</pubDate><description>&lt;p&gt;[UPDATE: I think I&amp;rsquo;ve finally gotten all the books under curation - but if you&amp;rsquo;ve an idea for a PowerShell-related ebook, and would like to co-author or even be a principal author (I&amp;rsquo;ll help out with logistics), still hit me up.]&lt;br&gt;
As you may know, PowerShell.org hosts a number of free ebooks that have, to date, been written mainly by me. But I&amp;rsquo;ve recently been delighted to welcome some co-contributors - Forums regular Dave Wyatt has contributed new content to &amp;ldquo;Secrets of PowerShell Remoting,&amp;rdquo; for example, and Matt Penny has volunteered to organize the forthcoming &amp;ldquo;Community Book of PowerShell Practices.&amp;rdquo;&lt;br&gt;
I&amp;rsquo;d like to try and sign up &amp;ldquo;curators&amp;rdquo; for some of our other free ebooks, including the forthcoming &amp;ldquo;Big Book of PowerShell Error Handling&amp;rdquo; and the &amp;ldquo;Creating Trend and Analysis Reports in PowerShell&amp;rdquo; titles, as well as - and this is one I&amp;rsquo;m really interested in getting someone for - the &amp;ldquo;Big Book of PowerShell Gotchas.&amp;rdquo;&lt;br&gt;
What&amp;rsquo;s a curator do?&lt;br&gt;
Mainly, incorporate community feedback (typos, etc) into future editions, as well as integrating new content. That content might be written by the curator, or contributed by someone else. We use a very simple Word template, and you&amp;rsquo;d use Calibre to produce PDF and EPUB from that. I provide cover art images and whatnot - this is mainly an &amp;ldquo;assemble, organize, and deal with the errata&amp;rdquo; process at a minimum. If you are passionate about the topic, you can of course become a co-author with me and add your own content (and I&amp;rsquo;m happy to help you do so). That&amp;rsquo;s especially true for the &amp;ldquo;Gotchas&amp;rdquo; title, which is mainly a series of short articles that cover some of the shell&amp;rsquo;s biggest speed bumps.&lt;br&gt;
A copy of Word, Calibre (free) and a GitHub client (free) are needed, plus a few free hours every few months and the willingness to take on the job. You&amp;rsquo;ll truly be helping: I often can produce extra content now and again, but actually spell-checking it, putting it into the book, making the EPUB version, and so on - believe it or not, that stuff takes me more time and is one reason the ebooks don&amp;rsquo;t get updated more often. Sigh.&lt;br&gt;
&lt;a href="http://concentratedtech.com/contact"&gt;Hit me up if you&amp;rsquo;re interested&lt;/a&gt; in helping out!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>[UPDATE: I think I&rsquo;ve finally gotten all the books under curation - but if you&rsquo;ve an idea for a PowerShell-related ebook, and would like to co-author or even be a principal author (I&rsquo;ll help out with logistics), still hit me up.]<br>
As you may know, PowerShell.org hosts a number of free ebooks that have, to date, been written mainly by me. But I&rsquo;ve recently been delighted to welcome some co-contributors - Forums regular Dave Wyatt has contributed new content to &ldquo;Secrets of PowerShell Remoting,&rdquo; for example, and Matt Penny has volunteered to organize the forthcoming &ldquo;Community Book of PowerShell Practices.&rdquo;<br>
I&rsquo;d like to try and sign up &ldquo;curators&rdquo; for some of our other free ebooks, including the forthcoming &ldquo;Big Book of PowerShell Error Handling&rdquo; and the &ldquo;Creating Trend and Analysis Reports in PowerShell&rdquo; titles, as well as - and this is one I&rsquo;m really interested in getting someone for - the &ldquo;Big Book of PowerShell Gotchas.&rdquo;<br>
What&rsquo;s a curator do?<br>
Mainly, incorporate community feedback (typos, etc) into future editions, as well as integrating new content. That content might be written by the curator, or contributed by someone else. We use a very simple Word template, and you&rsquo;d use Calibre to produce PDF and EPUB from that. I provide cover art images and whatnot - this is mainly an &ldquo;assemble, organize, and deal with the errata&rdquo; process at a minimum. If you are passionate about the topic, you can of course become a co-author with me and add your own content (and I&rsquo;m happy to help you do so). That&rsquo;s especially true for the &ldquo;Gotchas&rdquo; title, which is mainly a series of short articles that cover some of the shell&rsquo;s biggest speed bumps.<br>
A copy of Word, Calibre (free) and a GitHub client (free) are needed, plus a few free hours every few months and the willingness to take on the job. You&rsquo;ll truly be helping: I often can produce extra content now and again, but actually spell-checking it, putting it into the book, making the EPUB version, and so on - believe it or not, that stuff takes me more time and is one reason the ebooks don&rsquo;t get updated more often. Sigh.<br><a href="http://concentratedtech.com/contact">Hit me up if you&rsquo;re interested</a> in helping out!</p>
]]></content:encoded></item><item><title>Nominate Your PowerShell Hero</title><link>https://powershell.org/articles/2013-09-20-nominate-your-powershell-hero/</link><guid>https://powershell.org/articles/2013-09-20-nominate-your-powershell-hero/</guid><pubDate>Fri, 20 Sep 2013 17:02:18 +0000</pubDate><description>&lt;p&gt;PowerShell.org is proud to announce a new community recognition program: &lt;strong&gt;PowerShell Heroes&lt;/strong&gt;. We&amp;rsquo;re looking for your Hero nominations!&lt;br&gt;
A &lt;strong&gt;PowerShell Hero&lt;/strong&gt; is someone who you feel does an outstanding job helping the community, perhaps by answering questions in forums (here or elsewhere), writing useful blog posts, offering education, and more. A &lt;strong&gt;PowerShell Hero&lt;/strong&gt; is someone who 
has not already received formal recognition elsewhere
, meaning past and present MVPs are not eligible. _&lt;br&gt;
_&lt;br&gt;
We are accepting nominations until December 15th, 2013. At that point, the Board of PowerShell.org will review the nominations, and in early 2014 we will announce those we&amp;rsquo;re honoring with this recognition. In subsequent years, past honorees will decide who gets recognized in the following years.&lt;br&gt;
&lt;strong&gt;Who can I nominate?&lt;/strong&gt; Anyone you want, except current or past MVPs, Microsoft employees, Microsoft Regional Directors, or others who have been formally recognized for their community contributions.&lt;br&gt;
**How do I nominate them? **Send us an e-mail (admin@; our domain is powershell.org). We need the person&amp;rsquo;s name or online handle, and some links to their contributions. Also describe in 100-500 words why they&amp;rsquo;re your PowerShell Hero. Please put &amp;ldquo;PowerShell Hero&amp;rdquo; in the subject line of your email.&lt;br&gt;
&lt;strong&gt;How many people will be recognized?&lt;/strong&gt; We don&amp;rsquo;t have a fixed number.&lt;br&gt;
**What will honorees receive? **Online recognition; we&amp;rsquo;ll be publishing an online directory of Heroes. We&amp;rsquo;re looking into making plaques, but it depends a bit on the finances. There are no other benefits to the honoree.&lt;br&gt;
**Must someone re-qualify every year? **This isn&amp;rsquo;t like the MVP program - it&amp;rsquo;s a recognition with no benefits. So there&amp;rsquo;s nothing to &amp;ldquo;qualify&amp;rdquo; for. In future years, the previous year&amp;rsquo;s honorees will select the next year&amp;rsquo;s honorees, so you&amp;rsquo;re prohibited from being recognized in sequential years.&lt;br&gt;
**How can I think of who to nominate? **Think about who has helped &lt;em&gt;you&lt;/em&gt; with PowerShell problems. Did someone help you solve something through a discussion forum? Did someone&amp;rsquo;s blog post give you that &amp;ldquo;aha!&amp;rdquo; moment? Did someone spend a massive amount of time putting together a PowerShell event that really helped you? Those are the heroes we want to recognize. Again, past and present MVP award recipients are not eligible - they&amp;rsquo;ve already been recognized.&lt;br&gt;
We look forward to your nominations!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>PowerShell.org is proud to announce a new community recognition program: <strong>PowerShell Heroes</strong>. We&rsquo;re looking for your Hero nominations!<br>
A <strong>PowerShell Hero</strong> is someone who you feel does an outstanding job helping the community, perhaps by answering questions in forums (here or elsewhere), writing useful blog posts, offering education, and more. A <strong>PowerShell Hero</strong> is someone who 
has not already received formal recognition elsewhere
, meaning past and present MVPs are not eligible. _<br>
_<br>
We are accepting nominations until December 15th, 2013. At that point, the Board of PowerShell.org will review the nominations, and in early 2014 we will announce those we&rsquo;re honoring with this recognition. In subsequent years, past honorees will decide who gets recognized in the following years.<br><strong>Who can I nominate?</strong> Anyone you want, except current or past MVPs, Microsoft employees, Microsoft Regional Directors, or others who have been formally recognized for their community contributions.<br>
**How do I nominate them? **Send us an e-mail (admin@; our domain is powershell.org). We need the person&rsquo;s name or online handle, and some links to their contributions. Also describe in 100-500 words why they&rsquo;re your PowerShell Hero. Please put &ldquo;PowerShell Hero&rdquo; in the subject line of your email.<br><strong>How many people will be recognized?</strong> We don&rsquo;t have a fixed number.<br>
**What will honorees receive? **Online recognition; we&rsquo;ll be publishing an online directory of Heroes. We&rsquo;re looking into making plaques, but it depends a bit on the finances. There are no other benefits to the honoree.<br>
**Must someone re-qualify every year? **This isn&rsquo;t like the MVP program - it&rsquo;s a recognition with no benefits. So there&rsquo;s nothing to &ldquo;qualify&rdquo; for. In future years, the previous year&rsquo;s honorees will select the next year&rsquo;s honorees, so you&rsquo;re prohibited from being recognized in sequential years.<br>
**How can I think of who to nominate? **Think about who has helped <em>you</em> with PowerShell problems. Did someone help you solve something through a discussion forum? Did someone&rsquo;s blog post give you that &ldquo;aha!&rdquo; moment? Did someone spend a massive amount of time putting together a PowerShell event that really helped you? Those are the heroes we want to recognize. Again, past and present MVP award recipients are not eligible - they&rsquo;ve already been recognized.<br>
We look forward to your nominations!</p>
]]></content:encoded></item><item><title>Winter Scripting Games: More Feedback Needed</title><link>https://powershell.org/articles/2013-09-12-winter-scripting-games-more-feedback-needed/</link><guid>https://powershell.org/articles/2013-09-12-winter-scripting-games-more-feedback-needed/</guid><pubDate>Fri, 13 Sep 2013 00:33:29 +0000</pubDate><description>&lt;p&gt;So I&amp;rsquo;m continuing to work through some logistics regarding the Winter Scripting Games (and no, there&amp;rsquo;s no dates set).&lt;br&gt;
The intent of these Games, as I&amp;rsquo;ve written before, is to offer a &lt;em&gt;collaborative&lt;/em&gt; experience. You&amp;rsquo;ll work in teams of (proposed) 2-6. You have two ways to join a team: Pick an existing one that needs players (you&amp;rsquo;ll be shown the average time zone offset, in minutes, of the existing players, so that you can choose a team near you) or create a new team from scratch - which others can then join. You&amp;rsquo;d be welcome to &amp;ldquo;recruit&amp;rdquo; for your team using social media.&lt;br&gt;
NB: &lt;em&gt;Collaborate&lt;/em&gt; does not mean _live online collaboration. _Your team could do a Google Hangout or whatever optionally, but we&amp;rsquo;re only providing asynchronous collaboration.&lt;br&gt;
You will be able to leave your team up to a point. That is, you could always LEAVE your team, but each event within the Games will have a deadline for joining - meaning if you&amp;rsquo;re not on a team when the event starts, you&amp;rsquo;ll have to wait for the next event to re-join a team.&lt;br&gt;
My question right now revolves around the collaborative process. The idea is that the team has a single, shared code repository, meaning everyone on the team can see it. I want you to visualize this in your head, and then describe to me how you think it should work.&lt;br&gt;
The overall idea is that your team works on the assignment together, and then forwards (by the deadline) a final team entry for judging.&lt;br&gt;
Would you start by allowing one team member to upload an entry, and everyone would collaborate on it? Or would every member have the ability to upload a potential entry, and you&amp;rsquo;d all discuss which one you wanted to use as the team&amp;rsquo;s starting point? If there can be multiple parallel entries, how will the team decide, and then indicate to the system, which one is the &amp;ldquo;final&amp;rdquo; one? Remember, the team only sends ONE entry up for judging.&lt;br&gt;
NB: We will provide private team discussion threads within the system. You will not necessarily be able to comment on a given script file _per se, _but we&amp;rsquo;ll provide a means to reference lines of code within the team discussion threads. That keeps the discussion in one place, but allows you to refer to specific wodges of code.&lt;br&gt;
How will the code portion of the collaboration work? That is, when someone wants to provide a revision to the team entry, would they upload/paste an entirely new entry? Or would we provide a text editor so that you could edit the code that already exists? I&amp;rsquo;ll note that we&amp;rsquo;re &lt;em&gt;NOT NOT NOT&lt;/em&gt; providing an ISE experience - so a Web-based text editor might well leave room for unintentional errors. We won&amp;rsquo;t help you with those.&lt;br&gt;
If we use a paste-in text editor, we&amp;rsquo;d enable you to paste in an all-new entry, or to simply make quick changes to an existing entry, right in the Web page. That might be convenient.&lt;br&gt;
The new system will recognize the concept of a given entry consisting of multiple files - e.g., a script module that includes a .psm1, .psd1, and .ps1xml file, all working as a unit.&lt;br&gt;
Do we version-control this? That is, if everyone&amp;rsquo;s uploading revisions, do we just keep &amp;rsquo;em all, and indicate which one was most recent? That way you could always access older versions? Again, if each team gets a single entry, and each member can paste in new code or edit the existing code, this seems workable. We&amp;rsquo;d keep old versions so you could &amp;ldquo;roll back&amp;rdquo; if needed.&lt;br&gt;
If we did that, would you NEED a version-to-version comparison tool? If so, the complexity of that may mean we don&amp;rsquo;t run the Games this Winter. So think real hard about WANT vs. NEED. We COULD provide a way to download, in a ZIPped folder hierarchy, all versions of the entry, meaning you could then use local comparison tools on your computer to compare revisions.&lt;br&gt;
Your thoughts? What do you think is the best workflow for this kind of Games?&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>So I&rsquo;m continuing to work through some logistics regarding the Winter Scripting Games (and no, there&rsquo;s no dates set).<br>
The intent of these Games, as I&rsquo;ve written before, is to offer a <em>collaborative</em> experience. You&rsquo;ll work in teams of (proposed) 2-6. You have two ways to join a team: Pick an existing one that needs players (you&rsquo;ll be shown the average time zone offset, in minutes, of the existing players, so that you can choose a team near you) or create a new team from scratch - which others can then join. You&rsquo;d be welcome to &ldquo;recruit&rdquo; for your team using social media.<br>
NB: <em>Collaborate</em> does not mean _live online collaboration. _Your team could do a Google Hangout or whatever optionally, but we&rsquo;re only providing asynchronous collaboration.<br>
You will be able to leave your team up to a point. That is, you could always LEAVE your team, but each event within the Games will have a deadline for joining - meaning if you&rsquo;re not on a team when the event starts, you&rsquo;ll have to wait for the next event to re-join a team.<br>
My question right now revolves around the collaborative process. The idea is that the team has a single, shared code repository, meaning everyone on the team can see it. I want you to visualize this in your head, and then describe to me how you think it should work.<br>
The overall idea is that your team works on the assignment together, and then forwards (by the deadline) a final team entry for judging.<br>
Would you start by allowing one team member to upload an entry, and everyone would collaborate on it? Or would every member have the ability to upload a potential entry, and you&rsquo;d all discuss which one you wanted to use as the team&rsquo;s starting point? If there can be multiple parallel entries, how will the team decide, and then indicate to the system, which one is the &ldquo;final&rdquo; one? Remember, the team only sends ONE entry up for judging.<br>
NB: We will provide private team discussion threads within the system. You will not necessarily be able to comment on a given script file _per se, _but we&rsquo;ll provide a means to reference lines of code within the team discussion threads. That keeps the discussion in one place, but allows you to refer to specific wodges of code.<br>
How will the code portion of the collaboration work? That is, when someone wants to provide a revision to the team entry, would they upload/paste an entirely new entry? Or would we provide a text editor so that you could edit the code that already exists? I&rsquo;ll note that we&rsquo;re <em>NOT NOT NOT</em> providing an ISE experience - so a Web-based text editor might well leave room for unintentional errors. We won&rsquo;t help you with those.<br>
If we use a paste-in text editor, we&rsquo;d enable you to paste in an all-new entry, or to simply make quick changes to an existing entry, right in the Web page. That might be convenient.<br>
The new system will recognize the concept of a given entry consisting of multiple files - e.g., a script module that includes a .psm1, .psd1, and .ps1xml file, all working as a unit.<br>
Do we version-control this? That is, if everyone&rsquo;s uploading revisions, do we just keep &rsquo;em all, and indicate which one was most recent? That way you could always access older versions? Again, if each team gets a single entry, and each member can paste in new code or edit the existing code, this seems workable. We&rsquo;d keep old versions so you could &ldquo;roll back&rdquo; if needed.<br>
If we did that, would you NEED a version-to-version comparison tool? If so, the complexity of that may mean we don&rsquo;t run the Games this Winter. So think real hard about WANT vs. NEED. We COULD provide a way to download, in a ZIPped folder hierarchy, all versions of the entry, meaning you could then use local comparison tools on your computer to compare revisions.<br>
Your thoughts? What do you think is the best workflow for this kind of Games?</p>
]]></content:encoded></item><item><title>My New PowerShell Video Series, Covering v2/v3/v4, Launches</title><link>https://powershell.org/articles/2013-09-11-my-new-powershell-video-series-covering-v2v3v4-launches/</link><guid>https://powershell.org/articles/2013-09-11-my-new-powershell-video-series-covering-v2v3v4-launches/</guid><pubDate>Wed, 11 Sep 2013 17:35:25 +0000</pubDate><description>&lt;p&gt;It&amp;rsquo;s finally starting to be published - my &lt;a href="http://cbtnuggets.com/it-training-videos/course/cbtn_pwrshl_master"&gt;Ultimate PowerShell Video Training Series&lt;/a&gt;, covering versions 2 and onward.&lt;br&gt;
This series will initially consist of 90 chunks of roughly 20 minutes each, adding up to more than 30 hours total. I&amp;rsquo;m building each individual video to CLEARLY differentiate between PowerShell v2, v3, and v4; for the most part, I switch to Windows 7, Windows 8, and Windows 8.1 to demonstrate specifics in each version. That means you can clearly tell what features and techniques go with each version. It also means the series can be extended as new versions are released in the future.&lt;br&gt;
This is going to cover &lt;em&gt;everything&lt;/em&gt; - think of it as a &amp;ldquo;PowerShell In Depth&amp;rdquo; done in video. And, whatever I forget, if there is anything, can be easily added to the series. In other words, this will be my new, permanent video training for PowerShell. It&amp;rsquo;ll cover every version from v2, be extended to cover new version techniques and features, and be expanded to cover new topics as they become of interest.&lt;br&gt;
It&amp;rsquo;s being built with hands-on labs, too. I describe a lab environment you can set up (super-simple), and provide written lab documents for you to work through. Each is then covered in a standalone video, so that you can see sample solutions.&lt;br&gt;
Best of all, you can watch the whole thing for under $100. CBT Nuggets&amp;rsquo; program gives you monthly access to their entire library for that price, including my entire PowerShell series, their hundreds of titles related to certification and technology, _everything. _Or pay $1000 for an entire year - which also gets you access to practice certification exams from Transcender.&lt;br&gt;
I&amp;rsquo;ll be publishing 5-10 videos per week in this series, until it&amp;rsquo;s done - and we&amp;rsquo;ll then be tackling domain-specific PowerShell management, including Exchange, AD, SQL Server, System Center, &lt;em&gt;all&lt;/em&gt; of it. It&amp;rsquo;ll take some time to build out all of that, but I&amp;rsquo;m committed to building the most comprehensive PowerShell video training offering in the universe!&lt;br&gt;
If you get a chance to check out the new series, let me know what you think.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>It&rsquo;s finally starting to be published - my<a href="http://cbtnuggets.com/it-training-videos/course/cbtn_pwrshl_master">Ultimate PowerShell Video Training Series</a>, covering versions 2 and onward.<br>
This series will initially consist of 90 chunks of roughly 20 minutes each, adding up to more than 30 hours total. I&rsquo;m building each individual video to CLEARLY differentiate between PowerShell v2, v3, and v4; for the most part, I switch to Windows 7, Windows 8, and Windows 8.1 to demonstrate specifics in each version. That means you can clearly tell what features and techniques go with each version. It also means the series can be extended as new versions are released in the future.<br>
This is going to cover <em>everything</em> - think of it as a &ldquo;PowerShell In Depth&rdquo; done in video. And, whatever I forget, if there is anything, can be easily added to the series. In other words, this will be my new, permanent video training for PowerShell. It&rsquo;ll cover every version from v2, be extended to cover new version techniques and features, and be expanded to cover new topics as they become of interest.<br>
It&rsquo;s being built with hands-on labs, too. I describe a lab environment you can set up (super-simple), and provide written lab documents for you to work through. Each is then covered in a standalone video, so that you can see sample solutions.<br>
Best of all, you can watch the whole thing for under $100. CBT Nuggets&rsquo; program gives you monthly access to their entire library for that price, including my entire PowerShell series, their hundreds of titles related to certification and technology, _everything. _Or pay $1000 for an entire year - which also gets you access to practice certification exams from Transcender.<br>
I&rsquo;ll be publishing 5-10 videos per week in this series, until it&rsquo;s done - and we&rsquo;ll then be tackling domain-specific PowerShell management, including Exchange, AD, SQL Server, System Center, <em>all</em> of it. It&rsquo;ll take some time to build out all of that, but I&rsquo;m committed to building the most comprehensive PowerShell video training offering in the universe!<br>
If you get a chance to check out the new series, let me know what you think.</p>
]]></content:encoded></item><item><title>Great Debate: The Conclusion</title><link>https://powershell.org/articles/2013-09-10-great-debate-the-conclusion/</link><guid>https://powershell.org/articles/2013-09-10-great-debate-the-conclusion/</guid><pubDate>Tue, 10 Sep 2013 20:23:57 +0000</pubDate><description>&lt;p&gt;All this Summer, we&amp;rsquo;ve been encouraging your feedback in a &lt;a href="https://powershell.org/category/great-debates/"&gt;series of Great Debate posts&lt;/a&gt;. Most of the topics came from the 2013 Scripting Games, where we definitely saw people coming down on both sides of these topics. My goal was to pull everyone&amp;rsquo;s thoughts together into a kind of community consensus, and to offer a living book of community-accepted practices for PowerShell. This&amp;rsquo;ll be a neverending story, likely adapting and growing to include more topics as the years wind on.&lt;br&gt;
But here&amp;rsquo;s the start: &lt;a href="https://powershell.org/wp-content/uploads/2013/08/DRAFT-2013Sep_Practices.pdf"&gt;DRAFT-2013Sep_Practices&lt;/a&gt; is the first draft, officially a Request For Comments, based on the comments you&amp;rsquo;ve all contributed to the Great Debate posts over these past few weeks. I tried to capture consensus where I saw it, and to outline both sides of the great back-and-forth we&amp;rsquo;ve seen.&lt;br&gt;
&lt;strong&gt;NOTE:&lt;/strong&gt; The cover image in this draft is just a placeholder; this book is NOT dedicated to error handling. Its working title is correctly shown on the page following the cover image.&lt;br&gt;
I&amp;rsquo;m going to leave &lt;em&gt;this&lt;/em&gt; post in place until October 1st. Please drop any comments you&amp;rsquo;d like to offer to the final first edition of this ebook, and let me know if there are any topics you&amp;rsquo;d like to see debated in the future. After October 1st, I&amp;rsquo;ll publish the final edition of this Practices guide as one of PowerShell.org&amp;rsquo;s free ebooks. The final first edition will also become part of the next iteration of The Scripting Games, as its official &amp;ldquo;best practices&amp;rdquo; guide. In fact, you&amp;rsquo;ll notice in this draft that there are a couple of Games-specific comments, since the Games sometimes have different drivers than a production environment.&lt;br&gt;
Thanks again to everyone who participated!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>All this Summer, we&rsquo;ve been encouraging your feedback in a<a href="https://powershell.org/category/great-debates/">series of Great Debate posts</a>. Most of the topics came from the 2013 Scripting Games, where we definitely saw people coming down on both sides of these topics. My goal was to pull everyone&rsquo;s thoughts together into a kind of community consensus, and to offer a living book of community-accepted practices for PowerShell. This&rsquo;ll be a neverending story, likely adapting and growing to include more topics as the years wind on.<br>
But here&rsquo;s the start: <a href="https://powershell.org/wp-content/uploads/2013/08/DRAFT-2013Sep_Practices.pdf">DRAFT-2013Sep_Practices</a> is the first draft, officially a Request For Comments, based on the comments you&rsquo;ve all contributed to the Great Debate posts over these past few weeks. I tried to capture consensus where I saw it, and to outline both sides of the great back-and-forth we&rsquo;ve seen.<br><strong>NOTE:</strong> The cover image in this draft is just a placeholder; this book is NOT dedicated to error handling. Its working title is correctly shown on the page following the cover image.<br>
I&rsquo;m going to leave <em>this</em> post in place until October 1st. Please drop any comments you&rsquo;d like to offer to the final first edition of this ebook, and let me know if there are any topics you&rsquo;d like to see debated in the future. After October 1st, I&rsquo;ll publish the final edition of this Practices guide as one of PowerShell.org&rsquo;s free ebooks. The final first edition will also become part of the next iteration of The Scripting Games, as its official &ldquo;best practices&rdquo; guide. In fact, you&rsquo;ll notice in this draft that there are a couple of Games-specific comments, since the Games sometimes have different drivers than a production environment.<br>
Thanks again to everyone who participated!</p>
]]></content:encoded></item><item><title>PhillyPoSH 09/05/2013 meeting summary</title><link>https://powershell.org/articles/2013-09-08-phillyposh-09052013-meeting-summary/</link><guid>https://powershell.org/articles/2013-09-08-phillyposh-09052013-meeting-summary/</guid><pubDate>Mon, 09 Sep 2013 03:05:10 +0000</pubDate><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.manning.com/hicks/"&gt;Author&lt;/a&gt;, &lt;a href="http://scriptinggames.org/"&gt;Scripting Games 2013 winner&lt;/a&gt;, and founder of the &lt;a href="http://mspsug.com/"&gt;Mississippi PowerShell User Group&lt;/a&gt;, &lt;a href="http://mikefrobbins.com"&gt;Mike Robbins&lt;/a&gt;, gave a presentation entitled &amp;ldquo;Using CIM Cmdlets and CIM Sessions&amp;rdquo; via Lync.
&lt;ul&gt;
&lt;li&gt;Afterwards various group members participated in script and tell.&lt;/li&gt;
&lt;li&gt;A &lt;a href="https://www.youtube.com/edit?video_id=KUw10Dc_igs&amp;amp;video_referrer=watch&amp;amp;ns=1"&gt;recording of the meeting is available&lt;/a&gt; on our &lt;a href="https://www.youtube.com/channel/UCAc_ow5FIJtRpvew__9Iqzg"&gt;YouTube channel&lt;/a&gt;, please note that half way through our script club we had an issue with a duplicate audio track.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</description><content:encoded>&lt;![CDATA[<ul><li><a href="http://www.manning.com/hicks/">Author</a>,<a href="http://scriptinggames.org/">Scripting Games 2013 winner</a>, and founder of the<a href="http://mspsug.com/">Mississippi PowerShell User Group</a>,<a href="http://mikefrobbins.com">Mike Robbins</a>, gave a presentation entitled &ldquo;Using CIM Cmdlets and CIM Sessions&rdquo; via Lync.<ul><li>Afterwards various group members participated in script and tell.</li><li>A<a href="https://www.youtube.com/edit?video_id=KUw10Dc_igs&amp;video_referrer=watch&amp;ns=1">recording of the meeting is available</a> on our<a href="https://www.youtube.com/channel/UCAc_ow5FIJtRpvew__9Iqzg">YouTube channel</a>, please note that half way through our script club we had an issue with a duplicate audio track.</li></ul></li></ul>
]]></content:encoded></item><item><title>Writing Courseware: 10961 PowerShell Class</title><link>https://powershell.org/articles/2013-09-05-writing-courseware-10961-powershell-class/</link><guid>https://powershell.org/articles/2013-09-05-writing-courseware-10961-powershell-class/</guid><pubDate>Thu, 05 Sep 2013 15:36:56 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;re in the process of working on a 10961C revision to the Microsoft PowerShell course, and I&amp;rsquo;ve been reviewing the anonymous comments submitted by MCTs and students on 10961A (the &amp;ldquo;B&amp;rdquo; rev, which is what was produced after our beta teach, is just now orderable so we don&amp;rsquo;t have comments yet).&lt;br&gt;
**By the way - if you&amp;rsquo;re a student or MCT who has taken/delivered 10961A, you&amp;rsquo;re welcome to &lt;a href="http://concentratedtech.com/contact"&gt;contact me directly&lt;/a&gt; if you want to share any info on typos you found. Would like to fix those. **Microsoft unfortunately didn&amp;rsquo;t bill 10961A as &amp;ldquo;pre-beta,&amp;rdquo; which it was, and I think that may have not properly set some expectations.&lt;br&gt;
Anyway, if you&amp;rsquo;ve ever taken a course and thought anything bad about the &lt;em&gt;courseware&lt;/em&gt; (not necessarily the instructor), take a look at these comment excerpts from this one course:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;re in the process of working on a 10961C revision to the Microsoft PowerShell course, and I&rsquo;ve been reviewing the anonymous comments submitted by MCTs and students on 10961A (the &ldquo;B&rdquo; rev, which is what was produced after our beta teach, is just now orderable so we don&rsquo;t have comments yet).<br>
**By the way - if you&rsquo;re a student or MCT who has taken/delivered 10961A, you&rsquo;re welcome to<a href="http://concentratedtech.com/contact">contact me directly</a> if you want to share any info on typos you found. Would like to fix those. **Microsoft unfortunately didn&rsquo;t bill 10961A as &ldquo;pre-beta,&rdquo; which it was, and I think that may have not properly set some expectations.<br>
Anyway, if you&rsquo;ve ever taken a course and thought anything bad about the <em>courseware</em> (not necessarily the instructor), take a look at these comment excerpts from this one course:</p><p>By day 3 (5 day class) most students felt over-whelmed. I had to move some of the chapters around to give them time to acclimate to the product before continuing onto more advanced topics. Students agreed that this shifting around of material was essential, allowing them to absorb what was covered in the first 2 days.</p><p>There was not nearly enough material to fill a 5 day class. Students ended up leaving very early on the last two days.</p><p>The class had too much repetition of some concepts.</p><p>Students were not given enough time or repetition on core fundamentals.</p><p>Right. Same class. No idea what to do with that, as a courseware designer.<br>
(and by the way, this is after parsing through <em>hundreds</em> of comments from students who took the class remotely and were extremely dissatisfied with the experience. Believe me, you want to take training live and in-person.)<br>
There&rsquo;s also a question of, &ldquo;what the heck were you expecting?&rdquo;</p><p>was looking for more examples and understanding of using exchange and AD comandlet.</p><p>Missed basic knowledge of Workflows and Web Access.</p><p>Should include Flowchart among new features released in Version 3 [as soon as I figure out what feature &lsquo;flowchart&rsquo; is, I&rsquo;ll get right on it]</p><p>There was nothing geared toward using PowerShell with SQL Server.</p><p>Some material and labs not as relevant for me specifically without a networking/server background. I will likely use exclusively for SharePoint.</p><p>The book should have covered creating functions that utilize pipeline content coming in, and Filtering commandlets. Discussion about creating Gui components or a reference to it in the book would be helpful.</p><p>Astonishing, because _none of these things are mentioned in the course description. _Can you imagine writing a generic PowerShell course that included examples specific to [<strong>insert technology here</strong>]? Everyone else in the room would be bored and hate it. Look, you&rsquo;ve got one comment from a SharePoint admin with no networking/server experience. Goodness. A few folks suggested more AD examples - which I&rsquo;d used in 10325, the predecessor course, and gotten tons of comments along the lines of, &ldquo;I don&rsquo;t do AD in my organization so all of the examples were useless to me.&rdquo; O-kay! Can&rsquo;t win &rsquo;em all, I guess.<br>
I think a lot of <em>instructors</em> miss the point on teaching PowerShell, which is to focus on teaching the shell and its discoverability mechanisms. I think setting expectations with students is key, too - let them know you&rsquo;re <em>not</em> covering Exchange or SQL or SharePoint or Lync or whatever, but instead focusing on the core shell. And not even <em>everything the shell does</em> - 5 days isn&rsquo;t enough time. In fact, that&rsquo;s why 55039 is being offered - to provide the functions/programming side of the class.<br>
Anywho - love your feedback if you&rsquo;ve taught or taken the class! We have a few weeks in which to decide what we&rsquo;re doing with 10961C.</p>
]]></content:encoded></item><item><title>Regular Expressions are a -replace's best friend</title><link>https://powershell.org/articles/2013-08-29-regular-expressions-are-a-replaces-best-friend/</link><guid>https://powershell.org/articles/2013-08-29-regular-expressions-are-a-replaces-best-friend/</guid><pubDate>Thu, 29 Aug 2013 17:31:13 +0000</pubDate><description>&lt;p&gt;Are you familiar with PowerShell&amp;rsquo;s -replace operator?&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;quot;John Jones&amp;quot; -replace &amp;quot;Jones&amp;quot;,&amp;quot;Smith&amp;quot; &lt;/code&gt;Most folks are aware of it, and rely on it for straightforward string replacements like this one. But not very many people know that -replace also does some amazing stuff using regular expressions.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;quot;192.168.15.12,192.168.22.8&amp;quot; -replace &amp;quot;\.\d{2}\.&amp;quot;,&amp;quot;10&amp;quot; &lt;/code&gt;That&amp;rsquo;d change the input string to &amp;ldquo;192.168.10.12,192.168.10.8,&amp;rdquo; replacing all occurrences of two digits, between periods, to 10. The 12 would be skipped because it isn&amp;rsquo;t followed by a period, as specified in the pattern. Note that &lt;em&gt;all&lt;/em&gt; occurrences are replaced, in keeping with the usual operation of -replace.&lt;br&gt;
The operator can also do capturing expressions, and this is where it gets really neat-o.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Are you familiar with PowerShell&rsquo;s -replace operator?</p><p><code>"John Jones" -replace "Jones","Smith"</code>Most folks are aware of it, and rely on it for straightforward string replacements like this one. But not very many people know that -replace also does some amazing stuff using regular expressions.</p><p><code>"192.168.15.12,192.168.22.8" -replace "\.\d{2}\.","10"</code>That&rsquo;d change the input string to &ldquo;192.168.10.12,192.168.10.8,&rdquo; replacing all occurrences of two digits, between periods, to 10. The 12 would be skipped because it isn&rsquo;t followed by a period, as specified in the pattern. Note that <em>all</em> occurrences are replaced, in keeping with the usual operation of -replace.<br>
The operator can also do capturing expressions, and this is where it gets really neat-o.</p><p><code>"Don Jones" -replace "([a-z]+)\s([a-z]+)",'$2, $1'</code>Here, I&rsquo;ve specified two capturing expressions in parentheses, with a space character between them. PowerShell will capture the first to $1, and the second to $2. Those aren&rsquo;t actually variables, which is important. In my replacement string, I put $2 first, followed by a comma, a space, and $1. The resulting string will be &ldquo;Jones, Don&rdquo;. It&rsquo;s important that my replacement string be in single quotes. In double quotes, the shell will try and treat $1 and $2 as variables, instead of using them as captured regex placeholders. I kinda wish they&rsquo;d used something other than a $ for the captured placeholders, so that they didn&rsquo;t look like variables, but the syntax is in keeping with regex standards.<br>
I think it&rsquo;s cool to see all the places a regex can be put to use. The -split operator also supports regex syntax as a way of specifying the separator that will be used to break a string into components, so you&rsquo;re not limited to splitting just on a single character like a comma.<br>
Apart from the well-known -match operator and the Select-String command, where else have you used a regex in PowerShell?</p>
]]></content:encoded></item><item><title>PowerShell Great Debate: "Fixing" Output</title><link>https://powershell.org/articles/2013-08-27-powershell-great-debate-fixing-output/</link><guid>https://powershell.org/articles/2013-08-27-powershell-great-debate-fixing-output/</guid><pubDate>Tue, 27 Aug 2013 14:11:31 +0000</pubDate><description>&lt;p&gt;When should a script (or more likely, function) output raw data, and when should it &amp;ldquo;massage&amp;rdquo; its output?&lt;br&gt;
The classic example is something like disk space. You&amp;rsquo;re querying WMI, and it&amp;rsquo;s giving you disk space in bytes. Nobody cares about bytes. Should your function output bytes anyway, or output megabytes or gigabytes?&lt;br&gt;
If you output raw data, how would you expect a user to get a more-useful version? Would you expect someone running your command to use Select-Object on their own to do the math, or would you perhaps provide a default formatting view (a la what Get-Process does) that manages the math?&lt;br&gt;
The &amp;ldquo;Microsoft Way&amp;rdquo; is to use a default view - again, it&amp;rsquo;s what Get-Process does. But views are separate files, and they&amp;rsquo;re only really practical (many say) when they&amp;rsquo;re part of a module that can auto-load them.&lt;br&gt;
What do you think?&lt;br&gt;
[boilerplate greatdebate]&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>When should a script (or more likely, function) output raw data, and when should it &ldquo;massage&rdquo; its output?<br>
The classic example is something like disk space. You&rsquo;re querying WMI, and it&rsquo;s giving you disk space in bytes. Nobody cares about bytes. Should your function output bytes anyway, or output megabytes or gigabytes?<br>
If you output raw data, how would you expect a user to get a more-useful version? Would you expect someone running your command to use Select-Object on their own to do the math, or would you perhaps provide a default formatting view (a la what Get-Process does) that manages the math?<br>
The &ldquo;Microsoft Way&rdquo; is to use a default view - again, it&rsquo;s what Get-Process does. But views are separate files, and they&rsquo;re only really practical (many say) when they&rsquo;re part of a module that can auto-load them.<br>
What do you think?<br>
[boilerplate greatdebate]</p>
]]></content:encoded></item><item><title>PowerShell.org's Azure Journey, Part 4: Incoming Advice and Fun Facts</title><link>https://powershell.org/articles/2013-08-23-powershell-orgs-azure-journey-part-4-incoming-advice-and-fun-facts/</link><guid>https://powershell.org/articles/2013-08-23-powershell-orgs-azure-journey-part-4-incoming-advice-and-fun-facts/</guid><pubDate>Fri, 23 Aug 2013 14:40:43 +0000</pubDate><description>&lt;p&gt;Had an opportunity to speak with some folks on the Azure team yesterday - Mark Russinovich was kind enough to make a contact for me.&lt;br&gt;
First of all, fun fact: Azure only charges you for &lt;em&gt;used pages&lt;/em&gt; in VHDs. That is, if you create a 100GB VHD and load 1GB of data on it, you&amp;rsquo;re paying for 1GB of data. Very clever. So it&amp;rsquo;s charging you as if it was a dynamically expanding VHD, but of course it&amp;rsquo;s a fixed VHD with all of the related performance improvements. Nice.&lt;br&gt;
Second, they basically confirmed something I&amp;rsquo;d suspected. Azure&amp;rsquo;s &amp;ldquo;website model&amp;rdquo; tends to appeal more to smaller businesses or personal Web sites; most &amp;ldquo;serious&amp;rdquo; players (my word) are using the IaaS model, meaning they&amp;rsquo;re hosting VMs in the cloud, not just hosting a Web site. Having a full VM under your control obviously has advantages in terms of management, along with the ability to run things like in-memory caching software, load additional Web extensions, and so on. IaaS is absolutely the right model for PowerShell.org for many of those reasons.&lt;br&gt;
That said, they also confirmed that the Web site model and the IaaS model cost about the same, at least as you get started. So it&amp;rsquo;s really - for a smaller Web site - a matter of what you want to do. Again, there are specifics about the IaaS model that work well for us, so that&amp;rsquo;s what we&amp;rsquo;re looking to do.&lt;br&gt;
Azure also costs about the same, in an apples-to-apples comparison, as Amazon Web Services. That&amp;rsquo;s probably somewhat deliberate on Microsoft&amp;rsquo;s part, but Azure has advantages. For one, their virtualization layer has been approved by the various Microsoft product teams, so if you&amp;rsquo;re running SharePoint or SQL Server in an Azure VM, the team will support you. Not the case with AWS. Also, I frankly found Azure&amp;rsquo;s presentation of the costs easier to grok.&lt;br&gt;
Fifth (I love numbered lists, sorry), I confirmed that the IaaS option charges you for (a) the VM&amp;rsquo;s you&amp;rsquo;re running, by the minute; (b) the storage used by all VM VHDs&amp;rsquo; used pages, and (c) outbound bandwidth. This can potentially make IaaS more expensive than the &amp;ldquo;website&amp;rdquo; model because Azure won&amp;rsquo;t spin down an IaaS VM, so you run 24x7 unless you&amp;rsquo;re manually deallocating. With a website, Azure only spins up worker processes when they&amp;rsquo;re needed, so your site isn&amp;rsquo;t &amp;ldquo;running&amp;rdquo; 24x7, so you might pay less if it&amp;rsquo;s not being &amp;ldquo;hit&amp;rdquo; 24x7. Again, though, the website model offers us less control and flexibility.&lt;br&gt;
Just thought you&amp;rsquo;d enjoy some of those details!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Had an opportunity to speak with some folks on the Azure team yesterday - Mark Russinovich was kind enough to make a contact for me.<br>
First of all, fun fact: Azure only charges you for <em>used pages</em> in VHDs. That is, if you create a 100GB VHD and load 1GB of data on it, you&rsquo;re paying for 1GB of data. Very clever. So it&rsquo;s charging you as if it was a dynamically expanding VHD, but of course it&rsquo;s a fixed VHD with all of the related performance improvements. Nice.<br>
Second, they basically confirmed something I&rsquo;d suspected. Azure&rsquo;s &ldquo;website model&rdquo; tends to appeal more to smaller businesses or personal Web sites; most &ldquo;serious&rdquo; players (my word) are using the IaaS model, meaning they&rsquo;re hosting VMs in the cloud, not just hosting a Web site. Having a full VM under your control obviously has advantages in terms of management, along with the ability to run things like in-memory caching software, load additional Web extensions, and so on. IaaS is absolutely the right model for PowerShell.org for many of those reasons.<br>
That said, they also confirmed that the Web site model and the IaaS model cost about the same, at least as you get started. So it&rsquo;s really - for a smaller Web site - a matter of what you want to do. Again, there are specifics about the IaaS model that work well for us, so that&rsquo;s what we&rsquo;re looking to do.<br>
Azure also costs about the same, in an apples-to-apples comparison, as Amazon Web Services. That&rsquo;s probably somewhat deliberate on Microsoft&rsquo;s part, but Azure has advantages. For one, their virtualization layer has been approved by the various Microsoft product teams, so if you&rsquo;re running SharePoint or SQL Server in an Azure VM, the team will support you. Not the case with AWS. Also, I frankly found Azure&rsquo;s presentation of the costs easier to grok.<br>
Fifth (I love numbered lists, sorry), I confirmed that the IaaS option charges you for (a) the VM&rsquo;s you&rsquo;re running, by the minute; (b) the storage used by all VM VHDs&rsquo; used pages, and (c) outbound bandwidth. This can potentially make IaaS more expensive than the &ldquo;website&rdquo; model because Azure won&rsquo;t spin down an IaaS VM, so you run 24x7 unless you&rsquo;re manually deallocating. With a website, Azure only spins up worker processes when they&rsquo;re needed, so your site isn&rsquo;t &ldquo;running&rdquo; 24x7, so you might pay less if it&rsquo;s not being &ldquo;hit&rdquo; 24x7. Again, though, the website model offers us less control and flexibility.<br>
Just thought you&rsquo;d enjoy some of those details!</p>
]]></content:encoded></item><item><title>PowerShell.org's Azure Journey, Part 3: Load Testing [UPDATED]</title><link>https://powershell.org/articles/2013-08-21-powershell-orgs-azure-journey-part-3-load-testing/</link><guid>https://powershell.org/articles/2013-08-21-powershell-orgs-azure-journey-part-3-load-testing/</guid><pubDate>Wed, 21 Aug 2013 17:43:58 +0000</pubDate><description>&lt;p&gt;So, I&amp;rsquo;ve gotten a two-VM version of PowerShell.org running in Azure. Yay, me! My *nix skills are unaccountably rusty (go fig), but it didn&amp;rsquo;t take too long. Restoring the WordPress installation was the toughest, as a number of settings had to be tweaked since the site is no longer under the same URL (the  test site that is).&lt;/p&gt;
&lt;h2 id="baseline" class="ps-heading"&gt;Baseline&lt;a class="ps-heading-anchor" href="#baseline" 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;I ran a load test against the existing production site yesterday; you can view the results at &lt;a href="http://loadimpact.com/load-test/powershell.org-1aa960e59c5972af12898b745de9ec49"&gt;http://loadimpact.com/load-test/powershell.org-1aa960e59c5972af12898b745de9ec49&lt;/a&gt;. This simulated a 50-person concurrent load from three US locations and on UK location, which approximates our real-world traffic. The results are what they are; we&amp;rsquo;re looking for the delta between these and the Azure-based system. In this test, the green line is the number of concurrent connections, and the blue is the time it took each page to load. The test ran for 10 minutes total, with each simulated user hitting three different pages on the site (home page, a forums topic, and a blog post).&lt;br&gt;
A key fact is that the site currently runs under a shared hosting plan; I don&amp;rsquo;t have any details on how much RAM, how much CPU, or what kind of bandwidth exists for the site. It&amp;rsquo;s also important to note that the production Web site uses a Content Delivery Network, or CDN, which offloads a good amount of traffic from the site proper. Because that costs, we didn&amp;rsquo;t implement a CDN for the test site. I&amp;rsquo;d therefore expect it to be somewhat slower.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>So, I&rsquo;ve gotten a two-VM version of PowerShell.org running in Azure. Yay, me! My *nix skills are unaccountably rusty (go fig), but it didn&rsquo;t take too long. Restoring the WordPress installation was the toughest, as a number of settings had to be tweaked since the site is no longer under the same URL (the  test site that is).</p><h2 id="baseline" class="ps-heading">Baseline<a class="ps-heading-anchor" href="#baseline" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>I ran a load test against the existing production site yesterday; you can view the results at <a href="http://loadimpact.com/load-test/powershell.org-1aa960e59c5972af12898b745de9ec49">http://loadimpact.com/load-test/powershell.org-1aa960e59c5972af12898b745de9ec49</a>. This simulated a 50-person concurrent load from three US locations and on UK location, which approximates our real-world traffic. The results are what they are; we&rsquo;re looking for the delta between these and the Azure-based system. In this test, the green line is the number of concurrent connections, and the blue is the time it took each page to load. The test ran for 10 minutes total, with each simulated user hitting three different pages on the site (home page, a forums topic, and a blog post).<br>
A key fact is that the site currently runs under a shared hosting plan; I don&rsquo;t have any details on how much RAM, how much CPU, or what kind of bandwidth exists for the site. It&rsquo;s also important to note that the production Web site uses a Content Delivery Network, or CDN, which offloads a good amount of traffic from the site proper. Because that costs, we didn&rsquo;t implement a CDN for the test site. I&rsquo;d therefore expect it to be somewhat slower.</p><h2 id="azure-1-xsxs" class="ps-heading">Azure 1: XS+XS<a class="ps-heading-anchor" href="#azure-1-xsxs" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>The first Azure test is at <a href="http://loadimpact.com/load-test/powershellorg.cloudapp.net-715a0a249934417d3d3b51dd6109ca86">http://loadimpact.com/load-test/powershellorg.cloudapp.net-715a0a249934417d3d3b51dd6109ca86</a>. This uses an extra-small instance for both the Web server and the database server (separate VMs; that reflects the fact that the current site runs the DB on a separate shared server). As you can see, the results weren&rsquo;t promising. By around 40 users, page load times exceeded 3 minutes, at which point they started timing out. So the test clearly overwhelmed the instance. That wasn&rsquo;t unexpected; an XS instance runs on a shared core with 768MB of RAM. That ain&rsquo;t much. I think it&rsquo;s also powered by a 9-volt battery. But I wanted a baseline; XS instances are super-cheap.<br>
(As an aside, scaling out the Web tier of PowerShell.org isn&rsquo;t trivial, due mainly to the presence of user uploads. We&rsquo;d need to make some tweaks to have all uploads sent to, and downloaded from, a single server; if we just scale-out by load-balancing in a second Web server, user-uploaded content won&rsquo;t work correctly. Also, doubling the instance size - e.g., from XS to S - costs the same as adding a second XS instance. Scale-out isn&rsquo;t off the table, but since it&rsquo;s more complicated to set up, I&rsquo;m not testing it right now.)</p><h2 id="azure-2-sxs" class="ps-heading">Azure 2: S+XS<a class="ps-heading-anchor" href="#azure-2-sxs" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>The third test moved the Web server to a Small instance, which offers a dedicated core and 1.75GB of RAM. The DB server remained at an XS instance size. It was super-cool that you can upsize the instances whenever you want. You pay by the minute based on instance size, and the Azure Price Calculator rolls that up into a monthly estimate based on 24x7 usage. One thing I&rsquo;ve learned is that when the Azure Web console says it&rsquo;s done with something, like starting a VM, you really still need to wait a few minutes before all the bits and bobs are in place to make the Web site work. Another PITA is that, when you shut down a VM, you lose both your public IP (no problem, since they handle DNS for you) and private IP (a bit of a pain since there&rsquo;s no DNS for it, so I had to re-point the Web server at the database server&rsquo;s new private IP).<br>
(As another aside, Azure also offers the option of just moving the Web site and the database into the cloud, using PaaS rather than IaaS. We get to select the kind of instance our site runs on, but it&rsquo;s potentially shared with other sites. MySQL gets outsourced to ClearDB. There&rsquo;s some more complexity in that model from the perspective of getting the site working, and having our own VMs gives us some additional performance-improving abilities, like in-memory opcode caching. Either model costs about the same, so we&rsquo;re playing with the VM model at present.)<br>
Anyway, the third test results are at<a href="http://loadimpact.com/load-test/powershellorg.cloudapp.net-ee5ffaba02b4adcd7a7e1d70f6525176">http://loadimpact.com/load-test/powershellorg.cloudapp.net-ee5ffaba02b4adcd7a7e1d70f6525176</a>. I&rsquo;ll mention that the S instance size allows a lot more room for opcode caching, which can help tremendously, as well as having more RAM and CPU for handling the concurrent requests. Because the simulated users are all asking for the same pages, the caching should go a long way toward helping. For this test, response times held pretty well under 20s for the majority of the test, excluding some spikes (likely due to cached items expiring and being re-generated). Things started to get dicey at 40 concurrent users, but still held about the same average performance that the current production site offers. Using the test site interactively while this load test was underway was slow, but not utterly painful.<br>
(Real-world note: We disable a number of caching mechanisms for logged-in site users, because we don&rsquo;t want to serve a cached page form a logged-in user to an anonymous user. So logged-in users will get somewhat different results. For the purposes of this test, we&rsquo;re comparing apples to apples with anonymous simulated users.)</p><h2 id="azure-3-ss" class="ps-heading">Azure 3: S+S<a class="ps-heading-anchor" href="#azure-3-ss" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Now the database server has also been upgraded to a small instance, featuring a dedicated CPU core and 1.75GB of RAM. Having to update the database server&rsquo;s private IP address each time it restarts is a PITA. I need to find out if there&rsquo;s any way to use a DNS name for that instead - something Azure updates for me when it reassigns the IP. I don&rsquo;t want to use the public IP/DNS, because I&rsquo;d pay for bandwidth - with the internal IP, the traffic stays inside the Azure datacenter, so I don&rsquo;t pay for it.<br>
Anyway, this test result is at <a href="http://loadimpact.com/load-test/powershellorg.cloudapp.net-8b824df0db0a9ea67c2329150068200b">http://loadimpact.com/load-test/powershellorg.cloudapp.net-8b824df0db0a9ea67c2329150068200b</a>. Can I tell you how much I love LoadImpact for doing these tests? Set up the test once, run it over and over against different configurations. Awesome.<br>
As you&rsquo;re comparing the charts, pay close attention to the scale on the sides. They&rsquo;re not necessarily the same - you actually have to look at the numbers, not just the height of the blue line.  This time, although the blue line climbed high, it was actually under 1m for the entire test. That&rsquo;s a marked improvement over the XS+XS test! In addition, a S+S configuration is pretty affordable. It&rsquo;s about $180/mo in VMs, plus about $35 for storage and estimated bandwidth. That&rsquo;s less than two dedicated rackmount servers would cost, for sure.</p><h2 id="conclusion" class="ps-heading">Conclusion<a class="ps-heading-anchor" href="#conclusion" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>I need to do a bit of analysis - LoadImpact lets me download CSVs, which will let me make some direct-comparison charts - but Azure&rsquo;s looking like a good option for us, especially in the S+S option. I may also run a Medium+Small test (I have one credit left with LoadImpact for the month, so why not) just to see the difference. **UPDATE: **I did. The M+S test is at <a href="http://loadimpact.com/load-test/powershellorg.cloudapp.net-89328e1adfb4afa6af8b7c409dfa687f">http://loadimpact.com/load-test/powershellorg.cloudapp.net-89328e1adfb4afa6af8b7c409dfa687f</a>.</p>
]]></content:encoded></item><item><title>So your company doesn't want to enable PowerShell Remoting?</title><link>https://powershell.org/articles/2013-08-20-so-your-company-doesnt-want-to-enable-powershell-remoting/</link><guid>https://powershell.org/articles/2013-08-20-so-your-company-doesnt-want-to-enable-powershell-remoting/</guid><pubDate>Wed, 21 Aug 2013 00:37:04 +0000</pubDate><description>&lt;p&gt;But I bet they&amp;rsquo;re okay with Remote Desktop Protocol, right? And all those Remote Procedure Calls?&lt;br&gt;
And I bet they never even thought about why &lt;em&gt;every *nix&lt;/em&gt; _system, ever, _has SSH enabled by default? But practically nothing else (by default)?&lt;br&gt;
Hmm.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>But I bet they&rsquo;re okay with Remote Desktop Protocol, right? And all those Remote Procedure Calls?<br>
And I bet they never even thought about why <em>every *nix</em> _system, ever, _has SSH enabled by default? But practically nothing else (by default)?<br>
Hmm.</p>
]]></content:encoded></item><item><title>PowerShell Great Debate: What's Write-Verbose For?</title><link>https://powershell.org/articles/2013-08-20-powershell-great-debate-whats-write-verbose-for/</link><guid>https://powershell.org/articles/2013-08-20-powershell-great-debate-whats-write-verbose-for/</guid><pubDate>Tue, 20 Aug 2013 18:07:32 +0000</pubDate><description>&lt;p&gt;This was a fascinating thing to see throughout The Scripting Games this year: _When exactly should you use Write-Verbose, and why? _The same question applies to Write-Debug.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;ldquo;I use Write-Debug to provide developer-level comments in my scripts, since I can turn it on with -Debug to see variable contents.&amp;rdquo;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;ldquo;I use Write-Verbose to provide developer-level comments in my scripts, since I can turn it on with -Debug to see variable contents.&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See what I mean? Some folks will suggest that Verbose is for &amp;ldquo;user-friendly status messages;&amp;rdquo; others eschew Debug entirely and prefer PSBreakpoints for that functionality.&lt;br&gt;
What guidance would &lt;em&gt;you&lt;/em&gt; offer for using Write-Verbose and Write-Debug in a script?&lt;br&gt;
[boilerplate greatdebate]&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>This was a fascinating thing to see throughout The Scripting Games this year: _When exactly should you use Write-Verbose, and why? _The same question applies to Write-Debug.</p><ul><li/></ul><p>&ldquo;I use Write-Debug to provide developer-level comments in my scripts, since I can turn it on with -Debug to see variable contents.&rdquo;</p><ul><li>&ldquo;I use Write-Verbose to provide developer-level comments in my scripts, since I can turn it on with -Debug to see variable contents.&rdquo;</li></ul><p>See what I mean? Some folks will suggest that Verbose is for &ldquo;user-friendly status messages;&rdquo; others eschew Debug entirely and prefer PSBreakpoints for that functionality.<br>
What guidance would <em>you</em> offer for using Write-Verbose and Write-Debug in a script?<br>
[boilerplate greatdebate]</p>
]]></content:encoded></item><item><title>PowerShell.org's Azure Journey: Part 2</title><link>https://powershell.org/articles/2013-08-19-powershell-orgs-azure-journey-part-2/</link><guid>https://powershell.org/articles/2013-08-19-powershell-orgs-azure-journey-part-2/</guid><pubDate>Tue, 20 Aug 2013 01:10:01 +0000</pubDate><description>&lt;p&gt;I had no idea Azure gives MSDN subscribers a huge free monthly credit - $200 for the first month, and then on the Ultimate subscription level (which is what I get as an MVP) you get  $175 per month thereafter. That starts to really justify the MSDN pricing. You want a lab in the cloud? Free Azure!&lt;br&gt;
Given the free-ness of it, I decided to set up a PowerShell.org in the sky to see how it went. Configuring dual CentOS VMs was a bit of an all-day affair; I have less experience with RHEL (which is what CentOS is based on) and it took me a while to figure out that the built-in firewall was causing all my grief. Fixed now.&lt;br&gt;
Microsoft publishes some pretty good guides for getting a LAMP stack running on CentOS in Azure. Not great guides, but good. They lack a decent guide on getting Passive FTP working - and it&amp;rsquo;s a PITA because Azure only lets you configure incoming ports on a one-at-a-time basis (not ranges), and you can only have 25. So that&amp;rsquo;s kind of a pain. But I got it working, got MySQL installed and working, and I&amp;rsquo;m presently waiting on VaultPress to smush up our latest site backup and spew it onto the Azure server. Remember: you don&amp;rsquo;t pay for bandwidth going &lt;em&gt;into&lt;/em&gt; Azure, so I can load the backup in as many times as I want without incurring bandwidth.&lt;br&gt;
This VaultPress thing is neat, if it works. It continually pulls changes from our WordPress installation and backs them up, timestamped, a la Apple Time Machine. Allegedly, if you give them the FTP info on you new server, and you have a base WordPress install working on the new server, they can &amp;ldquo;push&amp;rdquo; your whole site down to the new server. Given my fits and starts with FTP on CentOS today, we&amp;rsquo;ll see how well it works, but I&amp;rsquo;m optimistic. Dunno. It&amp;rsquo;s been saying &amp;ldquo;Testing Connection&amp;rdquo; for a long time now. Sigh.&lt;br&gt;
Anyway, I&amp;rsquo;m starting both VMs in extra-small instances. Part of what I want to play with is whether or not I can upgrade those to bigger instances without breaking the universe. Depends on how CentOS behaves when it suddenly finds itself running on &amp;ldquo;new hardware.&amp;rdquo; We shall see! If it works, then it&amp;rsquo;ll truly be killer in terms of scaling. I also want to see if we get more &amp;ldquo;juice&amp;rdquo; running two load-balanced extra-small instances vs. a small instance (which is technically twice as big as an extra-small). Common logic suggests that more, smaller servers is better - a la every web farm, ever. But it&amp;rsquo;ll be fun to test.&lt;br&gt;
&lt;strong&gt;Question:&lt;/strong&gt; anyone have any Web site load-testing software they&amp;rsquo;re fond of? Mac or Windows is fine, or even both. I&amp;rsquo;ll enlist some folks to help with that, since I know my DSL line&amp;rsquo;s upstream side will chokepoint long before the Azure server does. Ooo, maybe we can have a PowerShell.org botnet that I could control&amp;hellip; bwaa haa haa!&lt;br&gt;
Meantime, Eric Courville, our new volunteer Webmaster, is setting up a similar Azure-based VM set with his own MSDN subscription. In addition to documenting the setup process, we&amp;rsquo;re going to try and do some load-testing and see what kind of instances we need to run in to get solid performance out of the site. PowerShell.org currently peaks at fewer than 50-60 concurrent connections (and even that day was a rare peak), so we&amp;rsquo;ll load test to that number.&lt;br&gt;
Stay tuned!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I had no idea Azure gives MSDN subscribers a huge free monthly credit - $200 for the first month, and then on the Ultimate subscription level (which is what I get as an MVP) you get  $175 per month thereafter. That starts to really justify the MSDN pricing. You want a lab in the cloud? Free Azure!<br>
Given the free-ness of it, I decided to set up a PowerShell.org in the sky to see how it went. Configuring dual CentOS VMs was a bit of an all-day affair; I have less experience with RHEL (which is what CentOS is based on) and it took me a while to figure out that the built-in firewall was causing all my grief. Fixed now.<br>
Microsoft publishes some pretty good guides for getting a LAMP stack running on CentOS in Azure. Not great guides, but good. They lack a decent guide on getting Passive FTP working - and it&rsquo;s a PITA because Azure only lets you configure incoming ports on a one-at-a-time basis (not ranges), and you can only have 25. So that&rsquo;s kind of a pain. But I got it working, got MySQL installed and working, and I&rsquo;m presently waiting on VaultPress to smush up our latest site backup and spew it onto the Azure server. Remember: you don&rsquo;t pay for bandwidth going <em>into</em> Azure, so I can load the backup in as many times as I want without incurring bandwidth.<br>
This VaultPress thing is neat, if it works. It continually pulls changes from our WordPress installation and backs them up, timestamped, a la Apple Time Machine. Allegedly, if you give them the FTP info on you new server, and you have a base WordPress install working on the new server, they can &ldquo;push&rdquo; your whole site down to the new server. Given my fits and starts with FTP on CentOS today, we&rsquo;ll see how well it works, but I&rsquo;m optimistic. Dunno. It&rsquo;s been saying &ldquo;Testing Connection&rdquo; for a long time now. Sigh.<br>
Anyway, I&rsquo;m starting both VMs in extra-small instances. Part of what I want to play with is whether or not I can upgrade those to bigger instances without breaking the universe. Depends on how CentOS behaves when it suddenly finds itself running on &ldquo;new hardware.&rdquo; We shall see! If it works, then it&rsquo;ll truly be killer in terms of scaling. I also want to see if we get more &ldquo;juice&rdquo; running two load-balanced extra-small instances vs. a small instance (which is technically twice as big as an extra-small). Common logic suggests that more, smaller servers is better - a la every web farm, ever. But it&rsquo;ll be fun to test.<br><strong>Question:</strong> anyone have any Web site load-testing software they&rsquo;re fond of? Mac or Windows is fine, or even both. I&rsquo;ll enlist some folks to help with that, since I know my DSL line&rsquo;s upstream side will chokepoint long before the Azure server does. Ooo, maybe we can have a PowerShell.org botnet that I could control&hellip; bwaa haa haa!<br>
Meantime, Eric Courville, our new volunteer Webmaster, is setting up a similar Azure-based VM set with his own MSDN subscription. In addition to documenting the setup process, we&rsquo;re going to try and do some load-testing and see what kind of instances we need to run in to get solid performance out of the site. PowerShell.org currently peaks at fewer than 50-60 concurrent connections (and even that day was a rare peak), so we&rsquo;ll load test to that number.<br>
Stay tuned!</p>
]]></content:encoded></item><item><title>PowerShell.org's Azure Journey, Part 1</title><link>https://powershell.org/articles/2013-08-19-powershell-orgs-azure-journey-part-1/</link><guid>https://powershell.org/articles/2013-08-19-powershell-orgs-azure-journey-part-1/</guid><pubDate>Mon, 19 Aug 2013 16:19:50 +0000</pubDate><description>&lt;p&gt;When we started PowerShell.org, my company (Concentrated Tech) donated shared hosting space to get the site up and running. We knew it wouldn&amp;rsquo;t be a permanent solution, but it let us start out for free. We&amp;rsquo;re coming to the point where a move to dedicated hosting will be desirable, and we&amp;rsquo;re looking at the options. Azure and Amazon Web Services are priced roughly the same for what we need, so as a Microsoft-centric community Azure&amp;rsquo;s obviously the way to go.&lt;br&gt;
Azure Technical Fellow Mark Russinovich is having someone on his team connect with me to discuss some of the models in which we could use Azure. What makes the discussion interesting is that PowerShell.org runs on a LAMP (Linux, Apache, MySQL, and PHP) stack. We&amp;rsquo;re not looking to change that; WordPress requires PHP, and the Windows builds of PHP typically lack some of the key PHP extensions we use. I&amp;rsquo;m not interested in compiling my own PHP build, either - I want off-the-shelf. WordPress more or less requires MySQL; while there&amp;rsquo;s a SQL Server adapter available, it can&amp;rsquo;t handle plugins that don&amp;rsquo;t use WordPress&amp;rsquo; database abstraction layer, and I just don&amp;rsquo;t want to take the chance of needing such a plugin at some point and not being able to use it.&lt;br&gt;
What&amp;rsquo;s neat about Azure is that it doesn&amp;rsquo;t care. I adore Microsoft for selling a service and not caring what I do with it. Azure runs Linux _just fine. _Huzzah!&lt;br&gt;
So, we&amp;rsquo;ve got two basic models that could work for us. Model 1 is to just buy virtual machines in Azure. We&amp;rsquo;re planning one for the database and another for the Web site itself, so that we can scale-out the Web end if we want to in the future. We&amp;rsquo;re not going to do an availability set; that means we risk some short downtime if Azure experiences hardware problems and needs to move our VM, but we&amp;rsquo;re fine with that because right now we can&amp;rsquo;t afford better availability. We&amp;rsquo;d probably build CentOS machines using Azure&amp;rsquo;s provided base image (again, &lt;em&gt;adore&lt;/em&gt; Microsoft for making this easy for Linux hosting and not just Windows). We know we tend to top out at 250GB of bandwidth a month, and that we need about 1GB of disk space for the Web site. 500MB of space for the database will last us a long time, but we&amp;rsquo;d probably get 1GB for that, too. It&amp;rsquo;s only like $3 a month. We could probably start with Small VM instances and upgrade later if needed. All-in, we&amp;rsquo;re probably looking at about $125/mo, less any prepay discounts.&lt;br&gt;
Model 2 is to just run a _Website. _We still get to pick the kind of instance that hosts our site, so if we went with Small and a single instance, we&amp;rsquo;d be at about $110 including bandwidth and storage. That doesn&amp;rsquo;t include MySQL, though. Interestingly, Microsoft doesn&amp;rsquo;t host MySQL themselves as they do with SQL Azure. Instead, they outsource to ClearDB.com, which provides an Azure-like service for hosted MySQL. Unfortunately, the Azure price calculator doesn&amp;rsquo;t cover the resold ClearDB service. Looking at ClearDB&amp;rsquo;s own pricing, it&amp;rsquo;d probably push us to about $120-$125 a month - or about the same as having our own virtual machines. The difference is that, with Model 2, Microsoft can float our Web site to whatever virtual hosts they need to at the time to balance performance; with Model 1, they can potentially move our entire VM - although they&amp;rsquo;re unlikely to do so routinely, since it&amp;rsquo;d involve taking us offline for a brief period. A super-neat part of this model is its integration with Git: I can run a local test version of the site, and as I make changes and commit them to our GitHub repository, Azure can execute a pull and get the latest version of the site code right from Git. Awesome and automated. I love automated.&lt;br&gt;
An appeal of Model 1 is that I can build out the proposed CentOS environment on my own Hyper-V server, hit it with some test traffic loads, and size the machine appropriately. I can then deploy the VHDs right to Azure, knowing that the instance size I picked will be suitable for the traffic we need to handle. It also give me an opportunity to validate the fact that a dedicated VM will be faster than our current shared hosting system, and to play around with the more advanced caching and optimization options available on a dedicated VM. I can get everything dialed in perfectly, and then deploy.&lt;br&gt;
Azure has other usage models, but these are the two applicable to us. I think it&amp;rsquo;s great that we get these options, and that the pricing is more or less the same regardless. And again, I think it&amp;rsquo;s pure genius that Azure&amp;rsquo;s in the business of &lt;em&gt;making money&lt;/em&gt; for Microsoft, and that they&amp;rsquo;re happy to do so running whatever OS I want them to.&lt;br&gt;
I&amp;rsquo;ll continue this series of posts as we move through the process, just for the benefit of anyone who&amp;rsquo;s interested in seeing Azure-ification from start to finish. Let me know if you have any questions or feedback!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>When we started PowerShell.org, my company (Concentrated Tech) donated shared hosting space to get the site up and running. We knew it wouldn&rsquo;t be a permanent solution, but it let us start out for free. We&rsquo;re coming to the point where a move to dedicated hosting will be desirable, and we&rsquo;re looking at the options. Azure and Amazon Web Services are priced roughly the same for what we need, so as a Microsoft-centric community Azure&rsquo;s obviously the way to go.<br>
Azure Technical Fellow Mark Russinovich is having someone on his team connect with me to discuss some of the models in which we could use Azure. What makes the discussion interesting is that PowerShell.org runs on a LAMP (Linux, Apache, MySQL, and PHP) stack. We&rsquo;re not looking to change that; WordPress requires PHP, and the Windows builds of PHP typically lack some of the key PHP extensions we use. I&rsquo;m not interested in compiling my own PHP build, either - I want off-the-shelf. WordPress more or less requires MySQL; while there&rsquo;s a SQL Server adapter available, it can&rsquo;t handle plugins that don&rsquo;t use WordPress&rsquo; database abstraction layer, and I just don&rsquo;t want to take the chance of needing such a plugin at some point and not being able to use it.<br>
What&rsquo;s neat about Azure is that it doesn&rsquo;t care. I adore Microsoft for selling a service and not caring what I do with it. Azure runs Linux _just fine. _Huzzah!<br>
So, we&rsquo;ve got two basic models that could work for us. Model 1 is to just buy virtual machines in Azure. We&rsquo;re planning one for the database and another for the Web site itself, so that we can scale-out the Web end if we want to in the future. We&rsquo;re not going to do an availability set; that means we risk some short downtime if Azure experiences hardware problems and needs to move our VM, but we&rsquo;re fine with that because right now we can&rsquo;t afford better availability. We&rsquo;d probably build CentOS machines using Azure&rsquo;s provided base image (again, <em>adore</em> Microsoft for making this easy for Linux hosting and not just Windows). We know we tend to top out at 250GB of bandwidth a month, and that we need about 1GB of disk space for the Web site. 500MB of space for the database will last us a long time, but we&rsquo;d probably get 1GB for that, too. It&rsquo;s only like $3 a month. We could probably start with Small VM instances and upgrade later if needed. All-in, we&rsquo;re probably looking at about $125/mo, less any prepay discounts.<br>
Model 2 is to just run a _Website. _We still get to pick the kind of instance that hosts our site, so if we went with Small and a single instance, we&rsquo;d be at about $110 including bandwidth and storage. That doesn&rsquo;t include MySQL, though. Interestingly, Microsoft doesn&rsquo;t host MySQL themselves as they do with SQL Azure. Instead, they outsource to ClearDB.com, which provides an Azure-like service for hosted MySQL. Unfortunately, the Azure price calculator doesn&rsquo;t cover the resold ClearDB service. Looking at ClearDB&rsquo;s own pricing, it&rsquo;d probably push us to about $120-$125 a month - or about the same as having our own virtual machines. The difference is that, with Model 2, Microsoft can float our Web site to whatever virtual hosts they need to at the time to balance performance; with Model 1, they can potentially move our entire VM - although they&rsquo;re unlikely to do so routinely, since it&rsquo;d involve taking us offline for a brief period. A super-neat part of this model is its integration with Git: I can run a local test version of the site, and as I make changes and commit them to our GitHub repository, Azure can execute a pull and get the latest version of the site code right from Git. Awesome and automated. I love automated.<br>
An appeal of Model 1 is that I can build out the proposed CentOS environment on my own Hyper-V server, hit it with some test traffic loads, and size the machine appropriately. I can then deploy the VHDs right to Azure, knowing that the instance size I picked will be suitable for the traffic we need to handle. It also give me an opportunity to validate the fact that a dedicated VM will be faster than our current shared hosting system, and to play around with the more advanced caching and optimization options available on a dedicated VM. I can get everything dialed in perfectly, and then deploy.<br>
Azure has other usage models, but these are the two applicable to us. I think it&rsquo;s great that we get these options, and that the pricing is more or less the same regardless. And again, I think it&rsquo;s pure genius that Azure&rsquo;s in the business of <em>making money</em> for Microsoft, and that they&rsquo;re happy to do so running whatever OS I want them to.<br>
I&rsquo;ll continue this series of posts as we move through the process, just for the benefit of anyone who&rsquo;s interested in seeing Azure-ification from start to finish. Let me know if you have any questions or feedback!</p>
]]></content:encoded></item><item><title>Two PowerShell Books 50% off TODAY ONLY</title><link>https://powershell.org/articles/2013-08-16-two-powershell-books-50-off-today-only/</link><guid>https://powershell.org/articles/2013-08-16-two-powershell-books-50-off-today-only/</guid><pubDate>Fri, 16 Aug 2013 17:59:11 +0000</pubDate><description>&lt;p&gt;&lt;em&gt;PowerShell in Depth&lt;/em&gt; and &lt;em&gt;Learn Windows PowerShell 3 in a Month of Lunches&lt;/em&gt; are on half-price August 25th, 2013.&lt;br&gt;
Use code dotd0825au at &lt;a href="http://www.manning.com/jones2/"&gt;www.manning.com/jones2/&lt;/a&gt;&lt;br&gt;
or&lt;br&gt;
Use code dotd0825au at &lt;a href="http://www.manning.com/jones3/"&gt;www.manning.com/jones3/&lt;/a&gt;&lt;br&gt;
Tell a friend who needs to start learning PowerShell - two great books at 50% off. All print books come with a voucher for free ebook versions (MOBI, EPUB, PDF), and the ebook-only version is also 50% off.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p><em>PowerShell in Depth</em> and <em>Learn Windows PowerShell 3 in a Month of Lunches</em> are on half-price August 25th, 2013.<br>
Use code dotd0825au at <a href="http://www.manning.com/jones2/">www.manning.com/jones2/</a><br>
or<br>
Use code dotd0825au at <a href="http://www.manning.com/jones3/">www.manning.com/jones3/</a><br>
Tell a friend who needs to start learning PowerShell - two great books at 50% off. All print books come with a voucher for free ebook versions (MOBI, EPUB, PDF), and the ebook-only version is also 50% off.</p>
]]></content:encoded></item><item><title>Site Maintenance this Weekend (Aug 17-18 2013)</title><link>https://powershell.org/articles/2013-08-16-site-maintenance-this-weekend-aug-17-18-2013/</link><guid>https://powershell.org/articles/2013-08-16-site-maintenance-this-weekend-aug-17-18-2013/</guid><pubDate>Fri, 16 Aug 2013 14:54:19 +0000</pubDate><description>&lt;p&gt;This weekend, we&amp;rsquo;ll be conducting maintenance on PowerShell.org. We have several goals:&lt;br&gt;
**New visual theme. **We&amp;rsquo;ll be installing a new visual theme. While we hope to catch everything, you may run across something goofy-looking. Please use the Community Discussion forum to report that, so we can ask the designers to take a look.&lt;br&gt;
**Performance. &lt;strong&gt;We&amp;rsquo;re going to continue to work on performance, with a goal of getting specified pages to have an &amp;ldquo;A&amp;rdquo; on the Page Test and YSlow tests. That&amp;rsquo;s not the entirety of performance, but it&amp;rsquo;s what we can address now without moving to a different hosting environment (which is planned). During this phase of our maintenance, the site may not function correctly, or certain features may come and go as we test different configurations.&lt;br&gt;
&lt;strong&gt;Cleanup&lt;/strong&gt;&lt;/strong&gt;. **We&amp;rsquo;ll be condensing certain features of the site, rearranging menus, and so on, to provide a better visual experience across a wider variety of devices.&lt;br&gt;
We appreciate your patience!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>This weekend, we&rsquo;ll be conducting maintenance on PowerShell.org. We have several goals:<br>
**New visual theme. **We&rsquo;ll be installing a new visual theme. While we hope to catch everything, you may run across something goofy-looking. Please use the Community Discussion forum to report that, so we can ask the designers to take a look.<br>
**Performance. <strong>We&rsquo;re going to continue to work on performance, with a goal of getting specified pages to have an &ldquo;A&rdquo; on the Page Test and YSlow tests. That&rsquo;s not the entirety of performance, but it&rsquo;s what we can address now without moving to a different hosting environment (which is planned). During this phase of our maintenance, the site may not function correctly, or certain features may come and go as we test different configurations.<br><strong>Cleanup</strong></strong>. **We&rsquo;ll be condensing certain features of the site, rearranging menus, and so on, to provide a better visual experience across a wider variety of devices.<br>
We appreciate your patience!</p>
]]></content:encoded></item><item><title>New PowerShell.org Visual Design Draft, Pt 2</title><link>https://powershell.org/articles/2013-08-15-new-powershell-org-visual-design-draft-pt-2/</link><guid>https://powershell.org/articles/2013-08-15-new-powershell-org-visual-design-draft-pt-2/</guid><pubDate>Thu, 15 Aug 2013 17:09:36 +0000</pubDate><description>&lt;p&gt;Spoke too soon in the morning&amp;rsquo;s updates; my designer buddies worked last night and took their first stab at the forums pages. They also changed their mind about the big black boxes, which I appreciate ;). The forums material is denser now, meaning more info per page, which should please some folks.&lt;br&gt;
Samples below - and comments welcome. Just keep in mind these folks aren&amp;rsquo;t being paid, so be nice ;).&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/08/new-forum-list.png"&gt;&lt;img src="https://powershell.org/wp-content/uploads/2013/08/new-forum-list-150x150.png" alt="new-forum-list"&gt;&lt;/a&gt; &lt;a href="https://powershell.org/wp-content/uploads/2013/08/new-single-topic.png"&gt;&lt;img src="https://powershell.org/wp-content/uploads/2013/08/new-single-topic-150x150.png" alt="new-single-topic"&gt;&lt;/a&gt; &lt;a href="https://powershell.org/wp-content/uploads/2013/08/new-topic-list.png"&gt;&lt;img src="https://powershell.org/wp-content/uploads/2013/08/new-topic-list-150x150.png" alt="new-topic-list"&gt;&lt;/a&gt; &lt;a href="https://powershell.org/wp-content/uploads/2013/08/new-article.png"&gt;&lt;img src="https://powershell.org/wp-content/uploads/2013/08/new-article-150x150.png" alt="new-article"&gt;&lt;/a&gt; &lt;a href="https://powershell.org/wp-content/uploads/2013/08/new-article-comments.png"&gt;&lt;img src="https://powershell.org/wp-content/uploads/2013/08/new-article-comments-150x150.png" alt="new-article-comments"&gt;&lt;/a&gt; &lt;a href="https://powershell.org/wp-content/uploads/2013/08/new-front.png"&gt;&lt;img src="https://powershell.org/wp-content/uploads/2013/08/new-front-150x150.png" alt="new-front"&gt;&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Spoke too soon in the morning&rsquo;s updates; my designer buddies worked last night and took their first stab at the forums pages. They also changed their mind about the big black boxes, which I appreciate ;). The forums material is denser now, meaning more info per page, which should please some folks.<br>
Samples below - and comments welcome. Just keep in mind these folks aren&rsquo;t being paid, so be nice ;).<br><a href="https://powershell.org/wp-content/uploads/2013/08/new-forum-list.png"><img src="https://powershell.org/wp-content/uploads/2013/08/new-forum-list-150x150.png" alt="new-forum-list"/><a href="https://powershell.org/wp-content/uploads/2013/08/new-single-topic.png"><img src="https://powershell.org/wp-content/uploads/2013/08/new-single-topic-150x150.png" alt="new-single-topic"/><a href="https://powershell.org/wp-content/uploads/2013/08/new-topic-list.png"><img src="https://powershell.org/wp-content/uploads/2013/08/new-topic-list-150x150.png" alt="new-topic-list"/><a href="https://powershell.org/wp-content/uploads/2013/08/new-article.png"><img src="https://powershell.org/wp-content/uploads/2013/08/new-article-150x150.png" alt="new-article"/><a href="https://powershell.org/wp-content/uploads/2013/08/new-article-comments.png"><img src="https://powershell.org/wp-content/uploads/2013/08/new-article-comments-150x150.png" alt="new-article-comments"/><a href="https://powershell.org/wp-content/uploads/2013/08/new-front.png"><img src="https://powershell.org/wp-content/uploads/2013/08/new-front-150x150.png" alt="new-front"/></p><p>Whatcha think? They said they&rsquo;re tweaking the smaller-screen version still, but I&rsquo;ll update this post and add those examples once they&rsquo;re ready. I know getting the forums working on a smartphone is something people have kvetched about, but it&rsquo;s fairly tricky. They said they might just end up <em>not</em> making a smartphone version, but instead focus on dropping unnecessary elements and letting the phone scale the page. The text input box is apparently giving them a lot of grief when it&rsquo;s sized too small. Anyway&hellip;</p>
]]></content:encoded></item><item><title>State of the Org: Website, Games, Summit, and More</title><link>https://powershell.org/articles/2013-08-15-state-of-the-org-website-games-summit-and-more/</link><guid>https://powershell.org/articles/2013-08-15-state-of-the-org-website-games-summit-and-more/</guid><pubDate>Thu, 15 Aug 2013 14:39:23 +0000</pubDate><description>&lt;p&gt;I wanted to share a quick update on PowerShell.org, Inc.&lt;br&gt;
First, a couple of Web designer friends of mine have volunteered to do a visual re-theme of the site. Below is some of their early work, and you&amp;rsquo;re welcome to comment; I&amp;rsquo;ll just remind you that they&amp;rsquo;re &lt;em&gt;volunteers&lt;/em&gt; and doing this _as a favor. _So be nice! You&amp;rsquo;ll notice that one of these reflects the layout a smartphone would use, which trims much of the &amp;ldquo;chrome&amp;rdquo; in favor of the content. They haven&amp;rsquo;t tackled the forums yet - that&amp;rsquo;s harder, and will probably come last.&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/08/3-001.png"&gt;&lt;img src="https://powershell.org/wp-content/uploads/2013/08/3-001-150x150.png" alt="3-001"&gt;&lt;/a&gt; &lt;a href="https://powershell.org/wp-content/uploads/2013/08/3-002.png"&gt;&lt;img src="https://powershell.org/wp-content/uploads/2013/08/3-002-150x150.png" alt="3-002"&gt;&lt;/a&gt; &lt;a href="https://powershell.org/wp-content/uploads/2013/08/3-003.png"&gt;&lt;img src="https://powershell.org/wp-content/uploads/2013/08/3-003-150x150.png" alt="3-003"&gt;&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I wanted to share a quick update on PowerShell.org, Inc.<br>
First, a couple of Web designer friends of mine have volunteered to do a visual re-theme of the site. Below is some of their early work, and you&rsquo;re welcome to comment; I&rsquo;ll just remind you that they&rsquo;re <em>volunteers</em> and doing this _as a favor. _So be nice! You&rsquo;ll notice that one of these reflects the layout a smartphone would use, which trims much of the &ldquo;chrome&rdquo; in favor of the content. They haven&rsquo;t tackled the forums yet - that&rsquo;s harder, and will probably come last.<br><a href="https://powershell.org/wp-content/uploads/2013/08/3-001.png"><img src="https://powershell.org/wp-content/uploads/2013/08/3-001-150x150.png" alt="3-001"/><a href="https://powershell.org/wp-content/uploads/2013/08/3-002.png"><img src="https://powershell.org/wp-content/uploads/2013/08/3-002-150x150.png" alt="3-002"/><a href="https://powershell.org/wp-content/uploads/2013/08/3-003.png"><img src="https://powershell.org/wp-content/uploads/2013/08/3-003-150x150.png" alt="3-003"/></p><p>Second, in the last quarter of the year we&rsquo;re planning a move from our current shared hosting plan (my company is actually hosting the site for free) to a more dedicated plan - likely in Azure, since that offers us redundancy without the need to actually pay for two servers. We&rsquo;ll set up a 2-server system with one server dedicated to the database, and the other the Web site, which reflects what we have now under the shared plan. We&rsquo;ll remain on the current LAMP stack, just running inside Azure. That takes a lot of work to set up and test, and the schedule will depend largely on our volunteers&rsquo; time, but it&rsquo;s in the works. The move should help a bit with some of the performance. It&rsquo;s crazy expensive compared to &ldquo;free&rdquo; (around $3600/year max, although obviously it&rsquo;s based on usage so that&rsquo;s kind of a worst-case guess), but we&rsquo;re growing to the point where we need it and it isn&rsquo;t any more expensive than a dedicated server. I love that the Azure folks are smart enough to offer a LAMP stack. Own the back end, who cares what people do with it!<br>
Third, we&rsquo;ve disabled a few site features that were really eating up page load times. Most you won&rsquo;t notice, but the &ldquo;badges&rdquo; functionality is presently turned off. We haven&rsquo;t deleted any data, so we can bring that back, but for right now it&rsquo;s unavailable.<br>
Fourth&hellip; and off of the Web site&hellip; the PowerShell Summit North America 2014 is about 12% sold out. As of today, our 2013 alumni and shareholders no longer have a reserved block; our TechLetter subscribers still have a reserved block through September 15th, at which point everything goes on sale to the public. The velocity of sales has been good, and we should be able to hit our next scheduled payment to the event venue. We <em>are</em> still holding back about 50 slots for 2014Q1, for those of you who <em>can&rsquo;t</em> register until next year. But I wouldn&rsquo;t hold out for those if you don&rsquo;t have to. It does <em>not</em> look, at present, like we&rsquo;ll have many (if any) additional discounted memberships - in order to hit our numbers, it&rsquo;s likely everything will hold to full price. If we do offer any discounts, it&rsquo;ll be absolutely last-minute. Also, our team is getting going on content, and you should see a Call for Topics real soon, now.<br>
Fifth, the PowerShell Summit Europe 2014 is coming along, but not really going anywhere. Ha! By that, I mean we&rsquo;re simply too far out (more than a year) for venues to be able to talk to us. So we&rsquo;re holding tight until September and October this year, when we can start checking pricing and availability. Madrid snuck on to our short-list of cities, along with Munich, Milan, and Amsterdam, due to the presence of a large MS conference facility there. If anyone lives in Europe and speaks Spanish, and wants to be our liaison to communicate with MS Madrid, please contact me (via the Site Info menu above). It&rsquo;d be nice to have someone local who can contact the office and see what we can do there, or at least put us in touch with an evangelist over there who could work on our behalf.<br>
Sixth, don&rsquo;t forget that Mark Schill has announced<a href="http://powershellsaturday.com">PowerShell Saturday 005</a> for Atlanta. Mark&rsquo;s also been tasked to help one or two other organizations put on their own PowerShell Saturday, so if you think you&rsquo;d be interested, please contact him. Having done this four times already, he&rsquo;s got a good grip on how to go about it.<br>
Seventh, we&rsquo;ve got some great new guys acting as editors for the TechLetter, and the September issue will be their first go at it. Wish them luck and give them your support! We&rsquo;re also looking to launch free online TechSession webinars next month; I&rsquo;ll probably run the first one, and there will be a required (and free) registration process, and it may be bumpy. But we&rsquo;re going to try and do those monthly. They&rsquo;ll supplement the new MVA offerings from MS, and get back to the days with TechNet did a whole series of different free webinars. Once we start, please help spread the word - if we&rsquo;re not getting good attendance or recording views, we won&rsquo;t keep doing it.<br>
Eighth, I&rsquo;m unsure if we&rsquo;ll be doing a Winter Games event or not. We had someone volunteer to coordinate it, but I haven&rsquo;t heard any details from them, and I&rsquo;m kinda getting overbooked on my end, which will make it tough to do up whatever Web site they might need. We&rsquo;re going to play this one by ear.<br>
Ninth&hellip; and before I make it to a full strike&hellip; I want to express my deep gratitude for everyone that&rsquo;s helping make this community work. The Forums are obviously a big piece, and it&rsquo;s been fantastic to see so many of you jumping in and volunteering your time to help answer questions. Truly, I feel that this whole thing is finally taking off and that it&rsquo;s a real _community. _Along those lines, in Q4 this year, we&rsquo;re going to announce (so start thinking about it) a PowerShell Heroes award. This will be for folks who have <em>not</em> already received some kind of recognition (like MVP) for helping out in the community, so that we can formally offer them a thank-you. Awards will be by nomination, and will carry no benefits whatsoever (grin). But start thinking of who you&rsquo;d like to thank, and why.<br>
OK - that&rsquo;s probably enough for the morning. Thanks for coming along for the ride, and have a great rest of the week!<br>
Don</p>
]]></content:encoded></item><item><title>PowerShell Great Debate: Can You Have Too Much Help?</title><link>https://powershell.org/articles/2013-08-13-powershell-great-debate-can-you-have-too-much-help/</link><guid>https://powershell.org/articles/2013-08-13-powershell-great-debate-can-you-have-too-much-help/</guid><pubDate>Tue, 13 Aug 2013 14:44:06 +0000</pubDate><description>&lt;p&gt;In The Scripting Games this year, more than a few folks took the time to write detailed comment-based help. Awesome. No debating it - comment-based help _is a good thing. _&lt;br&gt;
But some folks felt that others took it too far. There were definitely scripts where the authors used, for example, the .NOTES section to explain their thinking and approach. Some commenters felt it was excessive, while others have pointed out, &amp;ldquo;wow, what if every programmer gave us some idea what the heck he/she was thinking at the time?&amp;rdquo; Some felt these extensive comments were just at attempt to get a better score by &amp;ldquo;convincing&amp;rdquo; the reviewer of an approach or tactic; others felt, &amp;ldquo;so what?&amp;rdquo;&lt;br&gt;
So let&amp;rsquo;s leave the Games out of this debate - in a &lt;em&gt;production&lt;/em&gt; environment, where do you come down on extensive notes in a script? When is it not enough, and when is it going too far? Where&amp;rsquo;s the value, and where&amp;rsquo;s the annoyance?&lt;br&gt;
[boilerplate greatdebate]&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>In The Scripting Games this year, more than a few folks took the time to write detailed comment-based help. Awesome. No debating it - comment-based help _is a good thing. _<br>
But some folks felt that others took it too far. There were definitely scripts where the authors used, for example, the .NOTES section to explain their thinking and approach. Some commenters felt it was excessive, while others have pointed out, &ldquo;wow, what if every programmer gave us some idea what the heck he/she was thinking at the time?&rdquo; Some felt these extensive comments were just at attempt to get a better score by &ldquo;convincing&rdquo; the reviewer of an approach or tactic; others felt, &ldquo;so what?&rdquo;<br>
So let&rsquo;s leave the Games out of this debate - in a <em>production</em> environment, where do you come down on extensive notes in a script? When is it not enough, and when is it going too far? Where&rsquo;s the value, and where&rsquo;s the annoyance?<br>
[boilerplate greatdebate]</p>
]]></content:encoded></item><item><title>PhillyPoSH 08/01/2013 meeting summary and presentation materials</title><link>https://powershell.org/articles/2013-08-12-phillyposh-08012013-meeting-summary-and-presentation-materials/</link><guid>https://powershell.org/articles/2013-08-12-phillyposh-08012013-meeting-summary-and-presentation-materials/</guid><pubDate>Tue, 13 Aug 2013 04:11:24 +0000</pubDate><description>&lt;ol&gt;
&lt;li&gt;&lt;a href="http://mellositmusings.com/"&gt;John Mello&lt;/a&gt; gave a presentation on Tips and Tricks learned from the 2013 Scripting Games, a copy of his presentation and scripts can be obtained &lt;a href="https://powershell.org/wp-content/uploads/2013/08/PhillyPosh_2013-08-01_ScriptingGamesTipsandTricksLearned.zip"&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Various group members contributed to a Script and Tell, scripts and participant names are forthcoming.&lt;/li&gt;
&lt;li&gt;A &lt;a href="http://www.youtube.com/watch?v=mRS2275zUMk&amp;amp;feature=youtu.be"&gt;recording of the meeting is available&lt;/a&gt; on our &lt;a href="https://www.youtube.com/channel/UCAc_ow5FIJtRpvew__9Iqzg"&gt;YouTube channel&lt;/a&gt;, please note that the recording ends about 5 minutes before our meeting was done.&lt;/li&gt;
&lt;/ol&gt;</description><content:encoded>&lt;![CDATA[<ol><li><a href="http://mellositmusings.com/">John Mello</a> gave a presentation on Tips and Tricks learned from the 2013 Scripting Games, a copy of his presentation and scripts can be obtained<a href="https://powershell.org/wp-content/uploads/2013/08/PhillyPosh_2013-08-01_ScriptingGamesTipsandTricksLearned.zip">here</a></li><li>Various group members contributed to a Script and Tell, scripts and participant names are forthcoming.</li><li>A<a href="http://www.youtube.com/watch?v=mRS2275zUMk&amp;feature=youtu.be">recording of the meeting is available</a> on our<a href="https://www.youtube.com/channel/UCAc_ow5FIJtRpvew__9Iqzg">YouTube channel</a>, please note that the recording ends about 5 minutes before our meeting was done.</li></ol>
]]></content:encoded></item><item><title>Need Desired State Configuration Modules?</title><link>https://powershell.org/articles/2013-08-12-need-desired-state-configuration-modules/</link><guid>https://powershell.org/articles/2013-08-12-need-desired-state-configuration-modules/</guid><pubDate>Mon, 12 Aug 2013 23:59:59 +0000</pubDate><description>&lt;p&gt;You&amp;rsquo;ve probably been hearing about Desired State Configuration from a number of sources (&lt;a href="http://runasradio.com/default.aspx?showNum=328"&gt;Runas Radio&lt;/a&gt;, the &lt;a href="http://powerscripting.wordpress.com/2013/07/30/episode-236-powerscripting-podcast-mvp-don-jones-on-powershell-desired-state-configuration/"&gt;PowerScripting Podcast&lt;/a&gt;, or the &lt;a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/MDC-B302#fbid=FsVi_S7Re5G"&gt;Channel 9 TechEd video&lt;/a&gt; for example).  If you haven&amp;rsquo;t go check out those previously mentioned resources, I&amp;rsquo;ll wait&amp;hellip;&lt;br&gt;
Ok, now that you have a basic understanding of what Desired State Configuration (DSC) is, I have an announcement.&lt;/p&gt;
&lt;h3 id="powershellorg-is-building-a-repository-of-dsc-modules-for-the-community-to-use-and-contribute-to" class="ps-heading"&gt;PowerShell.Org is building a &lt;a href="http://bit.ly/13fDxns"&gt;repository of DSC modules &lt;/a&gt;for the community to use and contribute to.&lt;a class="ps-heading-anchor" href="#powershellorg-is-building-a-repository-of-dsc-modules-for-the-community-to-use-and-contribute-to" 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;As I&amp;rsquo;ve started working with Desired State Configuration, I began building up a repository of modules I would use in configuring my systems.  I started to round them out with some basic documentation and decent logging messages and began pushing them to GitHub.&lt;br&gt;
I&amp;rsquo;ve also seen several others starting to post some DSC modules on Github and elsewhere.  Since we are very early in the Desired State Configuration lifecycle (it&amp;rsquo;s still not RTM yet), I would like our community to come together on a central location for our community contributions.  I reached out to Don and the PowerShell.Org team and they graciously offered to host the contributions on the PowerShell.Org GitHub repository.  What that means is that this effort is no longer under the control of one person (me), but owned by the community, by PowerShell.Org.&lt;br&gt;
There&amp;rsquo;s not much in the repository yet, so if you&amp;rsquo;ve been experimenting with DSC and would like to share your efforts with the community, feel free to send a pull request (if you&amp;rsquo;re into the whole GitHub thing) or file an issue on the GitHub site and we&amp;rsquo;ll figure something out.&lt;br&gt;
There is some basic &lt;a href="https://github.com/PowerShellOrg/DSC#powershell-community-dsc-modules"&gt;&amp;ldquo;Getting Started With Developing DSC Modules&amp;rdquo; information at the GitHub repository&lt;/a&gt; as well.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>You&rsquo;ve probably been hearing about Desired State Configuration from a number of sources (<a href="http://runasradio.com/default.aspx?showNum=328">Runas Radio</a>, the<a href="http://powerscripting.wordpress.com/2013/07/30/episode-236-powerscripting-podcast-mvp-don-jones-on-powershell-desired-state-configuration/">PowerScripting Podcast</a>, or the<a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/MDC-B302#fbid=FsVi_S7Re5G">Channel 9 TechEd video</a> for example).  If you haven&rsquo;t go check out those previously mentioned resources, I&rsquo;ll wait&hellip;<br>
Ok, now that you have a basic understanding of what Desired State Configuration (DSC) is, I have an announcement.</p><h3 id="powershellorg-is-building-a-repository-of-dsc-modules-for-the-community-to-use-and-contribute-to" class="ps-heading">PowerShell.Org is building a<a href="http://bit.ly/13fDxns">repository of DSC modules</a>for the community to use and contribute to.<a class="ps-heading-anchor" href="#powershellorg-is-building-a-repository-of-dsc-modules-for-the-community-to-use-and-contribute-to" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h3><p>As I&rsquo;ve started working with Desired State Configuration, I began building up a repository of modules I would use in configuring my systems.  I started to round them out with some basic documentation and decent logging messages and began pushing them to GitHub.<br>
I&rsquo;ve also seen several others starting to post some DSC modules on Github and elsewhere.  Since we are very early in the Desired State Configuration lifecycle (it&rsquo;s still not RTM yet), I would like our community to come together on a central location for our community contributions.  I reached out to Don and the PowerShell.Org team and they graciously offered to host the contributions on the PowerShell.Org GitHub repository.  What that means is that this effort is no longer under the control of one person (me), but owned by the community, by PowerShell.Org.<br>
There&rsquo;s not much in the repository yet, so if you&rsquo;ve been experimenting with DSC and would like to share your efforts with the community, feel free to send a pull request (if you&rsquo;re into the whole GitHub thing) or file an issue on the GitHub site and we&rsquo;ll figure something out.<br>
There is some basic<a href="https://github.com/PowerShellOrg/DSC#powershell-community-dsc-modules">&ldquo;Getting Started With Developing DSC Modules&rdquo; information at the GitHub repository</a> as well.</p>
]]></content:encoded></item><item><title>Coming Soon: 55039 "PowerShell Scripting and Toolmaking" Course</title><link>https://powershell.org/articles/2013-08-12-coming-soon-55039-powershell-scripting-and-toolmaking-course/</link><guid>https://powershell.org/articles/2013-08-12-coming-soon-55039-powershell-scripting-and-toolmaking-course/</guid><pubDate>Mon, 12 Aug 2013 15:23:53 +0000</pubDate><description>&lt;p&gt;Later this month, Jason Helmick will be offering a revised &amp;ldquo;PowerShell Scripting and Toolmaking&amp;rdquo; course at &lt;a href="http://interfacett.com"&gt;Interface Technical Training&lt;/a&gt; in Phoenix. This new course carries the Microsoft Courseware Marketplace number 55039 - that&amp;rsquo;s right, this is an official, unofficial course that will be available to all Microsoft training partners!&lt;br&gt;
(Courseware Marketplace offerings are not written or endorsed by Microsoft, but they are equivalent to Official Curriculum in many ways, including being eligible for Software Assurance voucher programs. Marketplace offerings supplement Official offerings by providing courses that Microsoft doesn&amp;rsquo;t have the time or resources to generate themselves.)&lt;br&gt;
This course is based &lt;em&gt;directly&lt;/em&gt; on &lt;em&gt;Learn PowerShell Toolmaking in a Month of Lunches&lt;/em&gt;, and incorporates much of that book&amp;rsquo;s actual text (in fact, a portion of the course&amp;rsquo;s sale price goes to the book publisher, with a portion of &lt;em&gt;that&lt;/em&gt; going to the book authors as royalties). That&amp;rsquo;s combined with a full slide deck, some awesome brand-new labs, lab answer key, &amp;ldquo;starting points&amp;rdquo; (for lab students who fall behind), and a complete inventory of demo scripts for the instructor to use. It walks through a quick PowerShell review, and moves all the way through creating modules, advanced functions, custom views, and much more. It&amp;rsquo;s a pretty handy course, and even dives into creating &amp;ldquo;controller&amp;rdquo; scripts, such as scripts that automate processes or generate HTML reports. We provide a complete 3-VM build guide, and a simple ISO image containing all of the instructor and student files. Students are even welcome to download that ISO themselves for later reference! That URL will be provided in the student manual.&lt;br&gt;
I&amp;rsquo;m especially proud of the labs, and thankful to Mike Robbins and Jason Helmick for debugging them for me. Through the main part of the course, students have &lt;em&gt;three&lt;/em&gt; lab tracks (A, B, and C) to choose from - and overachievers can work on more than one track. Through each module, the labs gradually build from a basic command to a complete, fleshed-out &amp;ldquo;script cmdlet&amp;rdquo; packaged in a module, with a custom view and more. It&amp;rsquo;s extremely realistic, and it means much of the classroom time is spent on hands-on labs, where students will get the most value for their money.&lt;br&gt;
This course is designed to complement Microsoft&amp;rsquo;s official 10961 course, which covers substantially the same material as &lt;em&gt;Learn Windows PowerShell in a Month of Lunches&lt;/em&gt;, meaning 55039 is kind of a &amp;ldquo;sequel&amp;rdquo; course. Training centers are welcome to offer a 5-day accelerated class that combines both courses; that&amp;rsquo;s pretty much the class I teach myself. I don&amp;rsquo;t personally categorize 55039 as &amp;ldquo;advanced;&amp;rdquo; rather, it&amp;rsquo;s more of a specific application of PowerShell - building reusable tools. I do offer an &lt;a href="http://itpro.concentratedtech.com/training"&gt;advanced course of my own&lt;/a&gt;, and there&amp;rsquo;s a chance for that to become a packaged course in the future.&lt;br&gt;
After the beta is complete, the course will be orderable in the Marketplace with a suggested price of $150 per student. It&amp;rsquo;s a full 5-day course, with &lt;em&gt;multiple&lt;/em&gt; lab tracks per module, so I felt that was a pretty fair price, especially since students basically get the &lt;em&gt;Toolmaking&lt;/em&gt; book &amp;ldquo;included&amp;rdquo; in their manual!&lt;br&gt;
If any other trainers would like to know more about the course, they&amp;rsquo;re welcome to &lt;a href="http://concentratedtech.com/contact"&gt;contact me&lt;/a&gt;. We will be selling it directly as well, for trainers who can&amp;rsquo;t access the Marketplace.&lt;br&gt;
Download the table of contents: &lt;a href="https://powershell.org/wp-content/uploads/2013/08/55039-TOC.pdf"&gt;55039-TOC&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Later this month, Jason Helmick will be offering a revised &ldquo;PowerShell Scripting and Toolmaking&rdquo; course at<a href="http://interfacett.com">Interface Technical Training</a> in Phoenix. This new course carries the Microsoft Courseware Marketplace number 55039 - that&rsquo;s right, this is an official, unofficial course that will be available to all Microsoft training partners!<br>
(Courseware Marketplace offerings are not written or endorsed by Microsoft, but they are equivalent to Official Curriculum in many ways, including being eligible for Software Assurance voucher programs. Marketplace offerings supplement Official offerings by providing courses that Microsoft doesn&rsquo;t have the time or resources to generate themselves.)<br>
This course is based <em>directly</em> on <em>Learn PowerShell Toolmaking in a Month of Lunches</em>, and incorporates much of that book&rsquo;s actual text (in fact, a portion of the course&rsquo;s sale price goes to the book publisher, with a portion of<em>that</em> going to the book authors as royalties). That&rsquo;s combined with a full slide deck, some awesome brand-new labs, lab answer key, &ldquo;starting points&rdquo; (for lab students who fall behind), and a complete inventory of demo scripts for the instructor to use. It walks through a quick PowerShell review, and moves all the way through creating modules, advanced functions, custom views, and much more. It&rsquo;s a pretty handy course, and even dives into creating &ldquo;controller&rdquo; scripts, such as scripts that automate processes or generate HTML reports. We provide a complete 3-VM build guide, and a simple ISO image containing all of the instructor and student files. Students are even welcome to download that ISO themselves for later reference! That URL will be provided in the student manual.<br>
I&rsquo;m especially proud of the labs, and thankful to Mike Robbins and Jason Helmick for debugging them for me. Through the main part of the course, students have <em>three</em> lab tracks (A, B, and C) to choose from - and overachievers can work on more than one track. Through each module, the labs gradually build from a basic command to a complete, fleshed-out &ldquo;script cmdlet&rdquo; packaged in a module, with a custom view and more. It&rsquo;s extremely realistic, and it means much of the classroom time is spent on hands-on labs, where students will get the most value for their money.<br>
This course is designed to complement Microsoft&rsquo;s official 10961 course, which covers substantially the same material as <em>Learn Windows PowerShell in a Month of Lunches</em>, meaning 55039 is kind of a &ldquo;sequel&rdquo; course. Training centers are welcome to offer a 5-day accelerated class that combines both courses; that&rsquo;s pretty much the class I teach myself. I don&rsquo;t personally categorize 55039 as &ldquo;advanced;&rdquo; rather, it&rsquo;s more of a specific application of PowerShell - building reusable tools. I do offer an<a href="http://itpro.concentratedtech.com/training">advanced course of my own</a>, and there&rsquo;s a chance for that to become a packaged course in the future.<br>
After the beta is complete, the course will be orderable in the Marketplace with a suggested price of $150 per student. It&rsquo;s a full 5-day course, with <em>multiple</em> lab tracks per module, so I felt that was a pretty fair price, especially since students basically get the <em>Toolmaking</em> book &ldquo;included&rdquo; in their manual!<br>
If any other trainers would like to know more about the course, they&rsquo;re welcome to<a href="http://concentratedtech.com/contact">contact me</a>. We will be selling it directly as well, for trainers who can&rsquo;t access the Marketplace.<br>
Download the table of contents: <a href="https://powershell.org/wp-content/uploads/2013/08/55039-TOC.pdf">55039-TOC</a></p>
]]></content:encoded></item><item><title>My PowerShell Workflow Series on TechNet Magazine</title><link>https://powershell.org/articles/2013-08-12-my-powershell-workflow-series-on-technet-magazine/</link><guid>https://powershell.org/articles/2013-08-12-my-powershell-workflow-series-on-technet-magazine/</guid><pubDate>Mon, 12 Aug 2013 13:51:33 +0000</pubDate><description>&lt;p&gt;As most folks are aware, I&amp;rsquo;ve been writing the &lt;a href="http://technet.microsoft.com/en-us/magazine/ff628337.aspx?sdmr=windowspowershell&amp;amp;sdmi=columns"&gt;&lt;em&gt;Windows PowerShell&lt;/em&gt; column&lt;/a&gt; for Microsoft&amp;rsquo;s _TechNet Magazine _for&amp;hellip; wow, going on 7 years now. For 2013, I was doing a serialized column on PowerShell Workflow, introducing a bit of the technology at a time in each month&amp;rsquo;s article. Eagle-eyed observers will note that the series has &amp;ldquo;paused,&amp;rdquo; with no new articles in July or August.&lt;br&gt;
First, I&amp;rsquo;m sorry for the interruption. Unfortunately, right now Microsoft is re-evaluating and re-positioning TechNet Magazine (perhaps in line with a larger re-considering of the TechNet brand, where they recently discontinued the subscription product), and for the time being the company is sticking with internally generated content for TechNet Magazine. I&amp;rsquo;m hopeful the company will come to a decision soon, and I&amp;rsquo;ll try and keep you posted here.&lt;br&gt;
My past columns (all 77 of them) are still online and accessible, along with hundreds of other articles stretching back almost 8 years.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>As most folks are aware, I&rsquo;ve been writing the <a href="http://technet.microsoft.com/en-us/magazine/ff628337.aspx?sdmr=windowspowershell&amp;sdmi=columns"><em>Windows PowerShell</em> column</a> for Microsoft&rsquo;s _TechNet Magazine _for&hellip; wow, going on 7 years now. For 2013, I was doing a serialized column on PowerShell Workflow, introducing a bit of the technology at a time in each month&rsquo;s article. Eagle-eyed observers will note that the series has &ldquo;paused,&rdquo; with no new articles in July or August.<br>
First, I&rsquo;m sorry for the interruption. Unfortunately, right now Microsoft is re-evaluating and re-positioning TechNet Magazine (perhaps in line with a larger re-considering of the TechNet brand, where they recently discontinued the subscription product), and for the time being the company is sticking with internally generated content for TechNet Magazine. I&rsquo;m hopeful the company will come to a decision soon, and I&rsquo;ll try and keep you posted here.<br>
My past columns (all 77 of them) are still online and accessible, along with hundreds of other articles stretching back almost 8 years.</p>
]]></content:encoded></item><item><title>A Quick #PowerShell #PSHSummit Update (Europe &amp; NA)</title><link>https://powershell.org/articles/2013-08-08-a-quick-powershell-pshsummit-update-europe-na/</link><guid>https://powershell.org/articles/2013-08-08-a-quick-powershell-pshsummit-update-europe-na/</guid><pubDate>Thu, 08 Aug 2013 20:44:11 +0000</pubDate><description>&lt;p&gt;&lt;strong&gt;PowerShell Summit North America 2014&lt;/strong&gt;, April 28-30 (special precon on April 27) is open for registration to our 2013 alumni, shareholders, and to TechLetter subscribers. The alumni block will be released on August 15, and the subscriber block on September 15th; shortly after, sales will be open to the public. If you&amp;rsquo;re a shareholder, alumni, or subscriber, and you didn&amp;rsquo;t get your registration in e-mail, drop me a line (use the Contact link in the Site Info menu). Please only contact me if you&amp;rsquo;re anxious to register right now, so I don&amp;rsquo;t get swamped.&lt;br&gt;
North America will be in Bellevue, WA, adjacent to Microsoft offices up there; we will
investigate
a move East for the 2015 show, just to perhaps spread the love a bit. We know SEA isn&amp;rsquo;t the cheapest travel destination.&lt;br&gt;
North America&amp;rsquo;s &lt;strong&gt;call for topics&lt;/strong&gt; should start fairly soon, and that information will be posted here, along with information on how to submit prospective sessions. I won&amp;rsquo;t be taking the lead on that process, but some of my fellow Board members will be, so watch for their posts.&lt;br&gt;
&lt;strong&gt;PowerShell Summit Europe 2014&lt;/strong&gt; is being tentatively scheduled for September or October 2014. Our city shortlist includes Munich, Milan, and Amsterdam; we&amp;rsquo;re too far out at this point to make inquiries with prospective venues (they usually work only 8-12 months out), but we&amp;rsquo;ve assembled a list to contact over the next couple of months. Venue pricing and availability (and suitability) will be a significant set of factors in the final city selection, and we&amp;rsquo;ll post details right here.&lt;br&gt;
You&amp;rsquo;ll notice a &amp;ldquo;PowerShell Summit&amp;rdquo; post category here on PowerShell.org; that&amp;rsquo;s your one and official source for news and info, with our Summit Page being your one and official source for more static information on both events. You can follow &lt;a href="http://twitter.com/pshsummit"&gt;@PSHSummit&lt;/a&gt; on Twitter, which will be a good way to receive notifications of new posts here, but which will not contain any information not available on this site. We also try to hashtag #PSHSummit on Twitter, if you&amp;rsquo;d like to watch out for that.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p><strong>PowerShell Summit North America 2014</strong>, April 28-30 (special precon on April 27) is open for registration to our 2013 alumni, shareholders, and to TechLetter subscribers. The alumni block will be released on August 15, and the subscriber block on September 15th; shortly after, sales will be open to the public. If you&rsquo;re a shareholder, alumni, or subscriber, and you didn&rsquo;t get your registration in e-mail, drop me a line (use the Contact link in the Site Info menu). Please only contact me if you&rsquo;re anxious to register right now, so I don&rsquo;t get swamped.<br>
North America will be in Bellevue, WA, adjacent to Microsoft offices up there; we will
investigate
a move East for the 2015 show, just to perhaps spread the love a bit. We know SEA isn&rsquo;t the cheapest travel destination.<br>
North America&rsquo;s<strong>call for topics</strong> should start fairly soon, and that information will be posted here, along with information on how to submit prospective sessions. I won&rsquo;t be taking the lead on that process, but some of my fellow Board members will be, so watch for their posts.<br><strong>PowerShell Summit Europe 2014</strong> is being tentatively scheduled for September or October 2014. Our city shortlist includes Munich, Milan, and Amsterdam; we&rsquo;re too far out at this point to make inquiries with prospective venues (they usually work only 8-12 months out), but we&rsquo;ve assembled a list to contact over the next couple of months. Venue pricing and availability (and suitability) will be a significant set of factors in the final city selection, and we&rsquo;ll post details right here.<br>
You&rsquo;ll notice a &ldquo;PowerShell Summit&rdquo; post category here on PowerShell.org; that&rsquo;s your one and official source for news and info, with our Summit Page being your one and official source for more static information on both events. You can follow<a href="http://twitter.com/pshsummit">@PSHSummit</a> on Twitter, which will be a good way to receive notifications of new posts here, but which will not contain any information not available on this site. We also try to hashtag #PSHSummit on Twitter, if you&rsquo;d like to watch out for that.</p>
]]></content:encoded></item><item><title>Is this list "Everything" in PowerShell?</title><link>https://powershell.org/articles/2013-08-06-is-this-list-everything-in-powershell/</link><guid>https://powershell.org/articles/2013-08-06-is-this-list-everything-in-powershell/</guid><pubDate>Tue, 06 Aug 2013 20:11:04 +0000</pubDate><description>&lt;p&gt;Soooo&amp;hellip;. it&amp;rsquo;s time for me to start looking at updating my various training materials (books, videos, courses, whatnot) for v4.&lt;br&gt;
I&amp;rsquo;m going to, with at least some of these, take an all-versions approach. I&amp;rsquo;ll teach what&amp;rsquo;s in v2, then cover what v3 added, then cover v4, etc. It&amp;rsquo;ll be easier to maintain over the upcoming years.&lt;br&gt;
For right now, I&amp;rsquo;m trying to assemble an organized topic list of &amp;ldquo;everything&amp;rdquo; the shell does. Now, I need to wrap that in an important caveat: I&amp;rsquo;m aiming at &lt;em&gt;admins&lt;/em&gt;. Not developers. I&amp;rsquo;m not saying devs aren&amp;rsquo;t a great audience, but for this project I need to constrain my scope to just the admin audience. I&amp;rsquo;m also focused mainly on what the shell does _natively, _with only a few diversions into external or underlying technologies. Those are fixed caveats for this project - no exceptions.&lt;br&gt;
Right now I&amp;quot;m kind of chunking the list into what I feel can be taught (by me) in 20-30 minutes, or a book chapter, or something like that. This isn&amp;rsquo;t necessarily how the material will be presented - this is just me organizing my thoughts so as to not miss important stuff.&lt;br&gt;
So, given the list below, what do you feel is missing?&lt;br&gt;
(Numbers are major topics; letters are basically my mental notes about what the topic might include that I might otherwise forget; like I said, this isn&amp;rsquo;t meant to be a real book outline - it&amp;rsquo;s just a topic list)&lt;br&gt;
PowerShell Core&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Soooo&hellip;. it&rsquo;s time for me to start looking at updating my various training materials (books, videos, courses, whatnot) for v4.<br>
I&rsquo;m going to, with at least some of these, take an all-versions approach. I&rsquo;ll teach what&rsquo;s in v2, then cover what v3 added, then cover v4, etc. It&rsquo;ll be easier to maintain over the upcoming years.<br>
For right now, I&rsquo;m trying to assemble an organized topic list of &ldquo;everything&rdquo; the shell does. Now, I need to wrap that in an important caveat: I&rsquo;m aiming at <em>admins</em>. Not developers. I&rsquo;m not saying devs aren&rsquo;t a great audience, but for this project I need to constrain my scope to just the admin audience. I&rsquo;m also focused mainly on what the shell does _natively, _with only a few diversions into external or underlying technologies. Those are fixed caveats for this project - no exceptions.<br>
Right now I"m kind of chunking the list into what I feel can be taught (by me) in 20-30 minutes, or a book chapter, or something like that. This isn&rsquo;t necessarily how the material will be presented - this is just me organizing my thoughts so as to not miss important stuff.<br>
So, given the list below, what do you feel is missing?<br>
(Numbers are major topics; letters are basically my mental notes about what the topic might include that I might otherwise forget; like I said, this isn&rsquo;t meant to be a real book outline - it&rsquo;s just a topic list)<br>
PowerShell Core</p><ol><li>Series Introduction and Lab Setup</li><li>Windows PowerShell Introduction and Requirements</li><li>Finding and Discovering Commands<br>
a. Importing modules and snapins</li><li>Interpreting Command Help</li><li>Running Commands</li><li>Running External Commands: Tips and Tricks<br>
a. $Lastexitcode</li><li>Working with PSProviders and PSDrives</li><li>Variables, Strings, Hashtables, and Core Operators<br>
a. Double quote tricks, subexpressions<br>
b. Here-strings<br>
c. Escapes<br>
d. Variable types<br>
e. Arrays<br>
f. Math operators</li><li>Regular Expression Basics<br>
a. Basic regex language<br>
b. &ldquo;“Match<br>
c. Select-String</li><li>Learning the Pipeline: Exporting and Converting Data</li><li>Understanding Objects in PowerShell</li><li>Core Commands: Selecting, Sorting, Meauring, and More</li><li>How the PowerShell Pipeline Works</li><li>Formatting Command Output</li><li>Comparison Operators and Filtering</li><li>Advanced Operators</li><li>Setting Default Values for Command Parameters</li><li>Enumerating Objects in the Pipeline<br>
a. Working with object methods</li><li>Advanced Date and String Manipulation</li><li>Soup to Nuts: Completing a New Task<br>
PowerShell Remoting</li><li>PowerShell Remoting Basics</li><li>Persistent Remoting: PSSessions</li><li>Implicit Remoting: Using Commands on Another Computer</li><li>Advanced Remoting: Passing Data and Working with Output</li><li>Advanced Remoting: Crossing Domain Boundaries</li><li>Advanced Remoting: Custom Session Configurations</li><li>Web Remoting: PowerShell Web Access<br>
WMI and CIM</li><li>WMI and CIM: WMI, Docs, and the Repository</li><li>WMI and CIM: Using WMI to Commands Query Data</li><li>WMI and CIM: Using CIM Commands to Query Data</li><li>WMI and CIM: Filtering and WMI Query Language</li><li>WMI and CIM: Associations</li><li>WMI and CIM: Working with CIM Sessions</li><li>WMI and CIM: Executing Instance Methods<br>
Jobs</li><li>Background Job Basics: Local, WMI, and Remoting Jobs</li><li>Scheduled Background Jobs<br>
Scripting in PowerShell</li><li>PowerShell Script Security</li><li>Prompting for Input, Producing Output</li><li>Creating Basic Parameterized Scripts</li><li>PowerShell Scripting: Logical Constructs</li><li>PowerShell Scripting: Looping Constructs<br>
a. Break and Continue</li><li>PowerShell Scripting: Basic Functions, Filters, and Pipeline Functions</li><li>PowerShell Scripting: Best Practices<br>
a. Line breaking<br>
b. Splatting<br>
c. Formatting<br>
d. Source Control<br>
e. Etc.</li><li>PowerShell Scripting: From Command to Script to Function to Module</li><li>PowerShell Scripting: Scope</li><li>PowerShell Scripting: Combining Data from Multiple Sources<br>
a. Ordered hashtables<br>
Advanced Functions (&ldquo;Script Cmdlets&rdquo;)</li><li>Advanced Functions: Adding Help</li><li>Advanced Functions: Parameter Attributes</li><li>Advanced Functions: Pipeline Input</li><li>Advanced Functions: Parameter Sets<br>
Advanced Scripting Techniques</li><li>Creating Private Utility Functions and Preference Variables</li><li>Adding Error Capturing and Handling to a Function</li><li>Advanced Error Handling<br>
a. Variety of error capturing options<br>
b. Catching multiple exceptions<br>
c. Etc.</li><li>Error Handling the Old Way: Trap</li><li>Debugging Techniques</li><li>Creating Custom Formatting Views</li><li>Creating Custom Type Extensions</li><li>Working with SQL Server (and other) Databases</li><li>Working with XML Data Files</li><li>Supporting &ldquo;“WhatIf and &ldquo;“Confirm in Functions</li><li>Troubleshooting and Tracing the Pipeline</li><li>Using Object Hierarchies for Complex Output</li><li>Creating a Proxy Function<br>
PowerShell in the Field</li><li>From the Field: Enhanced HTML Reporting</li><li>From the Field: Trend Analysis Reporting</li><li>From the Field: Scraping HTML Pages<br>
PowerShell Workflow</li><li>Introduction to PowerShell Workflow<br>
Desired State Configuration</li><li>Desired State Configuration: The Basics</li><li>Desired State Configuration: Configuration Scripts</li><li>Desired State Configuration: Writing Resources</li><li>Globalizing a Function or Script</li><li>Discovering and Using COM Objects</li><li>Discovering and Using .NET Classes and Instances<br>
Writing Scripts for Other People</li><li>Controller Scripts: Automating Business Processes</li><li>Controller Scripts: A Menu of Tools</li><li>Creating a GUI Tool: The GUI</li><li>Creating a GUI Tool: The Code</li><li>Creating a GUI Tool: The Output</li><li>Creating a GUI Tool: Using Data Tables<br>
Advanced Core Techniques, Tricks, and Tips</li><li>Using Type Accelerators<br>
a. [ADSI]<br>
b. [XML]<br>
c. [VOID]<br>
d. where they&rdquo;™re documented</li><li>The Big Gotchas in PowerShell<br>
a. (from the ebook list)</li><li>Fun with Profiles<br>
a. Profiles and hosts<br>
b. Prompt<br>
c. Colors<br>
d. Get a credential</li><li>Random Tips and Tricks<br>
a. Redirection changing pipelines<br>
b. $$<br>
c. $?<br>
d. Dot sourcing</li></ol>
]]></content:encoded></item><item><title>PowerShell Great Debate: Script or Function?</title><link>https://powershell.org/articles/2013-08-06-powershell-great-debate-script-or-function/</link><guid>https://powershell.org/articles/2013-08-06-powershell-great-debate-script-or-function/</guid><pubDate>Tue, 06 Aug 2013 14:31:41 +0000</pubDate><description>&lt;p&gt;One of the most frequent comments in The Scripting Games this year was along the lines of, &amp;ldquo;you should have submitted this as a function, not a script.&amp;rdquo; Of course, the second-most frequent comment was something like, &amp;ldquo;you shouldn&amp;rsquo;t have submitted this as a function.&amp;rdquo;&lt;br&gt;
Let&amp;rsquo;s be clear: if an assignment explicitly asks for a function, you should write one. What we&amp;rsquo;re debating are the pros and cons of a &lt;em&gt;single tool&lt;/em&gt; being written one way or another. Read that again: _a single tool. _If you&amp;rsquo;re writing a library of tools, it&amp;rsquo;s obvious that writing them as functions for inclusion in a single file (like a script module) is beneficial.&lt;br&gt;
Some argue that any tool is potentially going to be included in a function&amp;hellip; so why not write it that way to begin with? Others argue that functions are a smidge harder to test, so why not just write a script?&lt;br&gt;
This is a debate I don&amp;rsquo;t personally have a strong stake in. I mean, we&amp;rsquo;re literally talking about a _single keyword. _Take &lt;em&gt;any&lt;/em&gt; script, add the &lt;strong&gt;function&lt;/strong&gt; keyword, a function name, and a couple of curly brackets, and you&amp;rsquo;ve got a function. This really shouldn&amp;rsquo;t be a criteria when you&amp;rsquo;re looking at a contest entry&amp;hellip; or even when you&amp;rsquo;re looking at something a colleague offered to you.&lt;br&gt;
Or should it?&lt;br&gt;
[boilerplate greatdebate]&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>One of the most frequent comments in The Scripting Games this year was along the lines of, &ldquo;you should have submitted this as a function, not a script.&rdquo; Of course, the second-most frequent comment was something like, &ldquo;you shouldn&rsquo;t have submitted this as a function.&rdquo;<br>
Let&rsquo;s be clear: if an assignment explicitly asks for a function, you should write one. What we&rsquo;re debating are the pros and cons of a <em>single tool</em> being written one way or another. Read that again: _a single tool. _If you&rsquo;re writing a library of tools, it&rsquo;s obvious that writing them as functions for inclusion in a single file (like a script module) is beneficial.<br>
Some argue that any tool is potentially going to be included in a function&hellip; so why not write it that way to begin with? Others argue that functions are a smidge harder to test, so why not just write a script?<br>
This is a debate I don&rsquo;t personally have a strong stake in. I mean, we&rsquo;re literally talking about a _single keyword. _Take <em>any</em> script, add the <strong>function</strong> keyword, a function name, and a couple of curly brackets, and you&rsquo;ve got a function. This really shouldn&rsquo;t be a criteria when you&rsquo;re looking at a contest entry&hellip; or even when you&rsquo;re looking at something a colleague offered to you.<br>
Or should it?<br>
[boilerplate greatdebate]</p>
]]></content:encoded></item><item><title>PowerShell Great Debate: PowerShell Versions?</title><link>https://powershell.org/articles/2013-08-01-powershell-great-debate-powershell-versions/</link><guid>https://powershell.org/articles/2013-08-01-powershell-great-debate-powershell-versions/</guid><pubDate>Thu, 01 Aug 2013 14:32:38 +0000</pubDate><description>&lt;p&gt;&lt;em&gt;Today&amp;rsquo;s Great Debate is a bonus, offered from former team member June Blender. Take it away, June!&lt;/em&gt;&lt;br&gt;
Like several of the excellent debates in our Great Debate series, this debate issue arose during in Scripting Games 2013 when different judges used different selection criteria to evaluate entries.&lt;br&gt;
Some judges, like me, wanted to see evidence that the scripter had studied all features of the newest version of the Windows PowerShell language and selected the best approach for their solution. Other judges wanted the solutions to work on as many computers as possible.&lt;br&gt;
Outside of the Scripting Games, this issue is very practical and very important. If you&amp;quot;™re writing a script to work on particular computers in your enterprise, you know which versions of Windows PowerShell are installed and which features you can use. But when you write a shared script or functions for a module, your scripts/functions can run in any environment.&lt;br&gt;
What&amp;quot;™s the version best practice?&lt;br&gt;
I think we can all agree that a #Requires statement should appear in any shared script.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p><em>Today&rsquo;s Great Debate is a bonus, offered from former team member June Blender. Take it away, June!</em><br>
Like several of the excellent debates in our Great Debate series, this debate issue arose during in Scripting Games 2013 when different judges used different selection criteria to evaluate entries.<br>
Some judges, like me, wanted to see evidence that the scripter had studied all features of the newest version of the Windows PowerShell language and selected the best approach for their solution. Other judges wanted the solutions to work on as many computers as possible.<br>
Outside of the Scripting Games, this issue is very practical and very important. If you"™re writing a script to work on particular computers in your enterprise, you know which versions of Windows PowerShell are installed and which features you can use. But when you write a shared script or functions for a module, your scripts/functions can run in any environment.<br>
What"™s the version best practice?<br>
I think we can all agree that a #Requires statement should appear in any shared script.</p><p><code>#Requires -Version [.]</code>In fact, maybe we need a version property of commands that can be queried by using Get-Command, like the PowerShellVersion property of modules?<br>
But, beyond that, should you restrict yourself to features in the oldest supported version of Windows PowerShell, or the most common version, or can you use features in the newest version, even if your scripts don"™t run on all computers in all enterprises?<br>
Sometimes, the answers are trivial. The simplified syntax in Windows PowerShell 3.0 that omits curly braces {} and &ldquo;$_.&rdquo; is just syntactic sugar for the original syntax. We might decide that it"™s best to avoid it unless you"™re sure that all computers are running at least 3.0.<br>
At the other extreme are features that don"™t have any equivalent in a previous version. What if your module would benefit from using scheduled jobs, CIM commands, or workflows? Must you avoid them?<br>
In the middle are cases where you can use a somewhat equivalent feature. Can you use Get-CimInstance, or are we forever tied to Get-WmiObject? Can you use PSCustomObject or are you committed to Add-Member? Do you need to write Types.ps1xml files when dynamic type data would suffice?</p>
]]></content:encoded></item><item><title>PowerShell Great Debate: The Purity Laws</title><link>https://powershell.org/articles/2013-07-30-powershell-great-debate-the-purity-laws/</link><guid>https://powershell.org/articles/2013-07-30-powershell-great-debate-the-purity-laws/</guid><pubDate>Tue, 30 Jul 2013 17:50:21 +0000</pubDate><description>&lt;p&gt;This should be interesting.&lt;br&gt;
During The Scripting Games, I observed (and in some cases made) a great many comments that I&amp;rsquo;m lumping under the name &amp;ldquo;Purity Laws.&amp;rdquo;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You shouldn&amp;rsquo;t use a command-line utility like Robocopy in a PowerShell script.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You shouldn&amp;rsquo;t use .NET classes in a PowerShell script.&lt;/li&gt;
&lt;li&gt;You should map a drive using New-PSDrive, not &lt;strong&gt;net use&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And so on. You see where I&amp;rsquo;m going: there are folks out there who feel as if the only thing that goes into a PowerShell script is Pure PowerShell. Which is odd, because it isn&amp;rsquo;t an approach the product team actually gave much value. They spent &lt;em&gt;extra time&lt;/em&gt; making sure the shell could use .NET, and could run external utilities - why not use them, if they work and get the job done?&lt;br&gt;
A counterargument involves maintenance and readability. External commands, for example, are harder to read, may not be well-documented, and don&amp;rsquo;t work consistently with the rest of PowerShell. .NET classes are hard to discover, and force you into a very &amp;ldquo;programmer-y&amp;rdquo; approach. Some environments might not want the extra overhead - even if it means giving up functionality.&lt;br&gt;
So where do you come down on this debate? I&amp;rsquo;d really love some _detailed recommendations. _What&amp;rsquo;s right for &lt;em&gt;your&lt;/em&gt; environment, and most importantly _why? _Are there any facts or situations that would sway you to the other side of the argument?&lt;br&gt;
Go.&lt;br&gt;
[boilerplate greatdebate]&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>This should be interesting.<br>
During The Scripting Games, I observed (and in some cases made) a great many comments that I&rsquo;m lumping under the name &ldquo;Purity Laws.&rdquo;</p><ul><li/></ul><p>You shouldn&rsquo;t use a command-line utility like Robocopy in a PowerShell script.</p><ul><li>You shouldn&rsquo;t use .NET classes in a PowerShell script.</li><li>You should map a drive using New-PSDrive, not <strong>net use</strong>.</li></ul><p>And so on. You see where I&rsquo;m going: there are folks out there who feel as if the only thing that goes into a PowerShell script is Pure PowerShell. Which is odd, because it isn&rsquo;t an approach the product team actually gave much value. They spent <em>extra time</em> making sure the shell could use .NET, and could run external utilities - why not use them, if they work and get the job done?<br>
A counterargument involves maintenance and readability. External commands, for example, are harder to read, may not be well-documented, and don&rsquo;t work consistently with the rest of PowerShell. .NET classes are hard to discover, and force you into a very &ldquo;programmer-y&rdquo; approach. Some environments might not want the extra overhead - even if it means giving up functionality.<br>
So where do you come down on this debate? I&rsquo;d really love some _detailed recommendations. _What&rsquo;s right for <em>your</em> environment, and most importantly _why? _Are there any facts or situations that would sway you to the other side of the argument?<br>
Go.<br>
[boilerplate greatdebate]</p>
]]></content:encoded></item><item><title>Calling all PowerShell Teachers/Trainers</title><link>https://powershell.org/articles/2013-07-29-calling-all-powershell-teacherstrainers/</link><guid>https://powershell.org/articles/2013-07-29-calling-all-powershell-teacherstrainers/</guid><pubDate>Mon, 29 Jul 2013 15:02:56 +0000</pubDate><description>&lt;p&gt;I&amp;rsquo;m in the process of building a referral list for teachers and trainers who work with Windows PowerShell. My goal is to build a &amp;ldquo;find a trainer&amp;rdquo; page here on PowerShell.org, with the ability for prospective clients to send an inquiry via email. This would be for customers seeking private classes, not for individual students seeking a class.&lt;br&gt;
If you&amp;rsquo;d like to be on the list, please send me an email, or use the &amp;ldquo;Contact&amp;rdquo; page under the &amp;ldquo;Site Info&amp;rdquo; menu here on PowerShell.org. Please provide an email address that referrals can be sent to; you&amp;rsquo;d receive the potential client&amp;rsquo;s contact information directly and would work with them directly - I&amp;rsquo;m not looking to act s middleman or agent, and there are no referral fees. We won&amp;rsquo;t be providing pricing information or anything other than a means of connecting clients and trainers.&lt;br&gt;
You can also provide a link to your Web site, if you have one, preferably a page that describes your PowerShell training offering(s).&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I&rsquo;m in the process of building a referral list for teachers and trainers who work with Windows PowerShell. My goal is to build a &ldquo;find a trainer&rdquo; page here on PowerShell.org, with the ability for prospective clients to send an inquiry via email. This would be for customers seeking private classes, not for individual students seeking a class.<br>
If you&rsquo;d like to be on the list, please send me an email, or use the &ldquo;Contact&rdquo; page under the &ldquo;Site Info&rdquo; menu here on PowerShell.org. Please provide an email address that referrals can be sent to; you&rsquo;d receive the potential client&rsquo;s contact information directly and would work with them directly - I&rsquo;m not looking to act s middleman or agent, and there are no referral fees. We won&rsquo;t be providing pricing information or anything other than a means of connecting clients and trainers.<br>
You can also provide a link to your Web site, if you have one, preferably a page that describes your PowerShell training offering(s).</p>
]]></content:encoded></item><item><title>PowerShell Great Debate: Credentials</title><link>https://powershell.org/articles/2013-07-23-powershell-great-debate-credentials/</link><guid>https://powershell.org/articles/2013-07-23-powershell-great-debate-credentials/</guid><pubDate>Tue, 23 Jul 2013 17:47:45 +0000</pubDate><description>&lt;p&gt;Credentials suck.&lt;br&gt;
You obviously don&amp;rsquo;t want to hardcode domain credentials into a script - and PowerShell actually makes it a bit difficult to do so, for good reason. On the other hand, you sometimes &lt;em&gt;need&lt;/em&gt; a script to do something using alternate credentials, and you don&amp;rsquo;t necessarily want the runner of the script to know those credentials.&lt;br&gt;
So how do you deal with it?&lt;br&gt;
Let&amp;rsquo;s be clear: This is &lt;em&gt;not&lt;/em&gt; a wish list. Comments like, &amp;ldquo;I wish PowerShell could do ____&amp;rdquo; aren&amp;rsquo;t valid. What &lt;em&gt;do you do using the technology as it exists today&lt;/em&gt;? Do you prompt for a credential and assume the script user will have it? Do you try to hardcode it? Do you set up a constrained endpoint? What?&lt;br&gt;
[boilerplate greatdebate]&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Credentials suck.<br>
You obviously don&rsquo;t want to hardcode domain credentials into a script - and PowerShell actually makes it a bit difficult to do so, for good reason. On the other hand, you sometimes <em>need</em> a script to do something using alternate credentials, and you don&rsquo;t necessarily want the runner of the script to know those credentials.<br>
So how do you deal with it?<br>
Let&rsquo;s be clear: This is <em>not</em> a wish list. Comments like, &ldquo;I wish PowerShell could do ____&rdquo; aren&rsquo;t valid. What <em>do you do using the technology as it exists today</em>? Do you prompt for a credential and assume the script user will have it? Do you try to hardcode it? Do you set up a constrained endpoint? What?<br>
[boilerplate greatdebate]</p>
]]></content:encoded></item><item><title>TechSessions: Free PowerShell Webinars</title><link>https://powershell.org/articles/2013-07-23-techsessions-free-powershell-webinars/</link><guid>https://powershell.org/articles/2013-07-23-techsessions-free-powershell-webinars/</guid><pubDate>Tue, 23 Jul 2013 16:05:08 +0000</pubDate><description>&lt;p&gt;PowerShell.org is going to be launching TechSessions this Fall. These will be ~1 hour online webinars, which you&amp;rsquo;re welcome to attend live. We&amp;rsquo;ll also record them and make the recordings available.&lt;br&gt;
In most cases you will need to &lt;em&gt;register&lt;/em&gt; for each one, so that we can send the appropriate invite information. Our sponsors are working with us on these, so each one might be in a different webinar platform (Lync, Webex, etc) depending on who is providing the infrastructure that month.&lt;br&gt;
In all cases, we&amp;rsquo;ll announce the TechSession in our TechLetter Newsletter, via banners on this site, and in a blog post. You&amp;rsquo;ll notice a new &amp;ldquo;TechSessions&amp;rdquo; post category for those announcements.&lt;br&gt;
I&amp;rsquo;ll be soliciting presenters, and the goal is just to provide you with varied technical content around PowerShell. If you&amp;rsquo;d like to BE a presenter, hit the Contact link in the Site Info menu (above) and let me know! Attending live will obviously give you a Q&amp;amp;A opportunity as well.&lt;br&gt;
Be on the lookout! I&amp;rsquo;m hoping to kick off in September or October. If there are specific topics you&amp;rsquo;d like to see, drop a comment below and let me know. I&amp;rsquo;m sure potential presenters would love some suggestions, and I know I would.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>PowerShell.org is going to be launching TechSessions this Fall. These will be ~1 hour online webinars, which you&rsquo;re welcome to attend live. We&rsquo;ll also record them and make the recordings available.<br>
In most cases you will need to <em>register</em> for each one, so that we can send the appropriate invite information. Our sponsors are working with us on these, so each one might be in a different webinar platform (Lync, Webex, etc) depending on who is providing the infrastructure that month.<br>
In all cases, we&rsquo;ll announce the TechSession in our TechLetter Newsletter, via banners on this site, and in a blog post. You&rsquo;ll notice a new &ldquo;TechSessions&rdquo; post category for those announcements.<br>
I&rsquo;ll be soliciting presenters, and the goal is just to provide you with varied technical content around PowerShell. If you&rsquo;d like to BE a presenter, hit the Contact link in the Site Info menu (above) and let me know! Attending live will obviously give you a Q&amp;A opportunity as well.<br>
Be on the lookout! I&rsquo;m hoping to kick off in September or October. If there are specific topics you&rsquo;d like to see, drop a comment below and let me know. I&rsquo;m sure potential presenters would love some suggestions, and I know I would.</p>
]]></content:encoded></item><item><title>PowerShell Summit City Selection Criteria</title><link>https://powershell.org/articles/2013-07-16-powershell-summit-city-selection-criteria/</link><guid>https://powershell.org/articles/2013-07-16-powershell-summit-city-selection-criteria/</guid><pubDate>Tue, 16 Jul 2013 17:40:13 +0000</pubDate><description>&lt;p&gt;As you may know, we&amp;rsquo;re in the process of putting together a PowerShell Summit Europe for Fall 2014. It&amp;rsquo;s a big task, with a lot of financial risks, so we try to get it right. Folks have been helpful on Twitter in offering city selection ideas&amp;hellip; but there&amp;rsquo;s a bit more involved than just tossing out a city name. With that, here is the selection criteria!&lt;br&gt;
Given the information below&amp;hellip; AND the fact that Germany/UK/Netherlands (in that order) have been getting the overwhelming majority of &amp;ldquo;in what cities would you attend the Summit&amp;rdquo; votes&amp;hellip; what cities would YOU recommend we consider?&lt;br&gt;
(BTW, this is TOTALLY a chance to &amp;ldquo;sell&amp;rdquo; your suggestion - so do so! The criteria below are what&amp;rsquo;s really important to us, so help us understand how a given city helps meet all of that criteria! And, if you&amp;rsquo;re willing to help be our local &amp;lsquo;person on the scene&amp;rsquo; to help organize, mention that also!)&lt;br&gt;
-&amp;ndash;&lt;br&gt;
City Selection Criteria for PowerShell Summits&lt;br&gt;
This guide is intended to provide a framework for selecting an appropriate city and venue for a PowerShell Summit.&lt;br&gt;
Understand that a PowerShell Summit is meant to be a continent-level event, meaning the attendance of international speakers and attendees is a given. A PowerShell Summit is conducted primarily, if not entirely, in English, that being the &amp;ldquo;de facto&amp;rdquo; language of the technology industry, and the most-common language spoken by expert presenters in the field. A PowerShell Summit is open to everyone, and is not intended to fill the need for regional, culture- or language-specific events of any size. PowerShell.org recognizes the need for, and value of, those more-regional events, but the PowerShell Summit does not seek to full that need or provide that exact same value.&lt;br&gt;
Throughout this guide, note that &amp;ldquo;venue&amp;rdquo; does not refer to a city. While in casual discussions we may refer to a city name or metropolitan area name - like London or Munich - our venue may not in fact be within the legal limits of such a city or area. &amp;ldquo;Venue&amp;rdquo; refers to a specific facility, which may be a hotel or a conference center or other specific location.&lt;br&gt;
Our expectation is that most attendees will arrive at the event via common carrier - typically, train or airplane. Some may drive, but our focus is on providing good access for those who do not have their own personal transportation during the event.&lt;br&gt;
Criterion 1: Airport Access&lt;br&gt;
The first criterion is easy access to a major international airport. This is intended to accommodate the wide variety of attendees expected. In general, the venue should be either within a 15-20 minute drive from an airport by private car (including taxis and shuttle busses), or within a 30-minute ride via mass transit rail (specifically excluding public bus service, but including all levels of rail access).&lt;br&gt;
Exception: The airport service area may be widened in instances where a venue offers significant other advantages in other criteria, or where the venue offers specialized access to expert presenters - e.g., using Bellevue for its convenient access to the PowerShell team, despite the fact that it is a ~30 minute ride by private car from SEA-TAC airport and lacks public rail access to the airport.&lt;br&gt;
Criterion 2: Local Transit&lt;br&gt;
The venue must be well-connected to the local area by mass transit rail (tram, train, metro, etc.). Alternately, the area must offer a variety of amenities within walking distance. Our goal is to minimize the need for rental cars to travel to the event venue from local hotels, restaurants, and other amenities. A 15-minute walking radius is a good &amp;ldquo;maximum&amp;rdquo; guideline. Due to this criterion, local parking fees are explicitly not considered during venue selection, although the organization recognizes than some local attendees may be impacted by parking fees.&lt;br&gt;
Criterion 3: Evening Amenities&lt;br&gt;
The selected venue must be accessible (via local rail transit or short walks) to evening amenities, including hotels, restaurants, and so forth. While the PowerShell Summit will often include evening events, attendees must have independent access to these kinds of amenities.&lt;br&gt;
Criterion 4: Price, Quantity, and Quality of Lodging&lt;br&gt;
The selected venue must be accessible (via local rail transit or short walks) to hotels of at least 3-star quality (as listed on travel Web sites such as Expedia or Orbitz), with as reasonable a price as possible given the choices of venues under consideration. When possible, the organization will reserve a room block for at least 1/3 of the expected attendance number (with the understanding that room blocks carry significant financial risk, and the organization has a primary goal of mitigating such risk). Additional hotel capacity meeting this criterion must be available, but may not necessarily be reserved, for the event.&lt;br&gt;
Criterion 5: Language&lt;br&gt;
The selected venue must be in an area where English is commonly spoken, at least by hospitality workers. English need not be the dominant language in the area, but as it is the &amp;ldquo;common language&amp;rdquo; of PowerShell, English must at least be commonly understood as a &amp;ldquo;lingua franca&amp;rdquo; in order for a maximum number of attendees to be able to navigate the area. Venues that do not meet this criterion may still be viable locations for a regional, cultural-specific event, but might not be qualified for a PowerShell Summit.&lt;br&gt;
Criterion 6: Centrality&lt;br&gt;
Given all of the other criteria previously listed, it is desirable to have a venue that provides equitable travel access from the majority of the target area. However, the organization recognizes that central location is often the most difficult to achieve in combination with the other criteria listed.&lt;br&gt;
Criterion 7: Accessibility&lt;br&gt;
The venue must conform with a general international standard of access for disabled persons, and must provide at least basic ability to meet common dietary restrictions, such as vegetarianism. The organization accepts that extremely specific dietary needs, such as cultural or religious needs or allergy concerns, might incur extra costs that would be passed along to the concerned attendee(s).&lt;br&gt;
Criterion 8: Appropriateness&lt;br&gt;
The venue must provide appropriate meeting facilities. This means the venue must be able to accommodate the expected number of attendees in a comfortable and safe surrounding, and attendees must be able to access the venue without undue overhead (e.g., extensive security checks in an office building, etc.). In multi-track events, meeting rooms should be able to accommodate a 15-20% offset (e.g., in a 300-person event with 300 attendees, each room must be able to handle 120 attendees, to deal with the fact that some sessions will be more popular than others).&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>As you may know, we&rsquo;re in the process of putting together a PowerShell Summit Europe for Fall 2014. It&rsquo;s a big task, with a lot of financial risks, so we try to get it right. Folks have been helpful on Twitter in offering city selection ideas&hellip; but there&rsquo;s a bit more involved than just tossing out a city name. With that, here is the selection criteria!<br>
Given the information below&hellip; AND the fact that Germany/UK/Netherlands (in that order) have been getting the overwhelming majority of &ldquo;in what cities would you attend the Summit&rdquo; votes&hellip; what cities would YOU recommend we consider?<br>
(BTW, this is TOTALLY a chance to &ldquo;sell&rdquo; your suggestion - so do so! The criteria below are what&rsquo;s really important to us, so help us understand how a given city helps meet all of that criteria! And, if you&rsquo;re willing to help be our local &lsquo;person on the scene&rsquo; to help organize, mention that also!)<br>
-&ndash;<br>
City Selection Criteria for PowerShell Summits<br>
This guide is intended to provide a framework for selecting an appropriate city and venue for a PowerShell Summit.<br>
Understand that a PowerShell Summit is meant to be a continent-level event, meaning the attendance of international speakers and attendees is a given. A PowerShell Summit is conducted primarily, if not entirely, in English, that being the &ldquo;de facto&rdquo; language of the technology industry, and the most-common language spoken by expert presenters in the field. A PowerShell Summit is open to everyone, and is not intended to fill the need for regional, culture- or language-specific events of any size. PowerShell.org recognizes the need for, and value of, those more-regional events, but the PowerShell Summit does not seek to full that need or provide that exact same value.<br>
Throughout this guide, note that &ldquo;venue&rdquo; does not refer to a city. While in casual discussions we may refer to a city name or metropolitan area name - like London or Munich - our venue may not in fact be within the legal limits of such a city or area. &ldquo;Venue&rdquo; refers to a specific facility, which may be a hotel or a conference center or other specific location.<br>
Our expectation is that most attendees will arrive at the event via common carrier - typically, train or airplane. Some may drive, but our focus is on providing good access for those who do not have their own personal transportation during the event.<br>
Criterion 1: Airport Access<br>
The first criterion is easy access to a major international airport. This is intended to accommodate the wide variety of attendees expected. In general, the venue should be either within a 15-20 minute drive from an airport by private car (including taxis and shuttle busses), or within a 30-minute ride via mass transit rail (specifically excluding public bus service, but including all levels of rail access).<br>
Exception: The airport service area may be widened in instances where a venue offers significant other advantages in other criteria, or where the venue offers specialized access to expert presenters - e.g., using Bellevue for its convenient access to the PowerShell team, despite the fact that it is a ~30 minute ride by private car from SEA-TAC airport and lacks public rail access to the airport.<br>
Criterion 2: Local Transit<br>
The venue must be well-connected to the local area by mass transit rail (tram, train, metro, etc.). Alternately, the area must offer a variety of amenities within walking distance. Our goal is to minimize the need for rental cars to travel to the event venue from local hotels, restaurants, and other amenities. A 15-minute walking radius is a good &ldquo;maximum&rdquo; guideline. Due to this criterion, local parking fees are explicitly not considered during venue selection, although the organization recognizes than some local attendees may be impacted by parking fees.<br>
Criterion 3: Evening Amenities<br>
The selected venue must be accessible (via local rail transit or short walks) to evening amenities, including hotels, restaurants, and so forth. While the PowerShell Summit will often include evening events, attendees must have independent access to these kinds of amenities.<br>
Criterion 4: Price, Quantity, and Quality of Lodging<br>
The selected venue must be accessible (via local rail transit or short walks) to hotels of at least 3-star quality (as listed on travel Web sites such as Expedia or Orbitz), with as reasonable a price as possible given the choices of venues under consideration. When possible, the organization will reserve a room block for at least 1/3 of the expected attendance number (with the understanding that room blocks carry significant financial risk, and the organization has a primary goal of mitigating such risk). Additional hotel capacity meeting this criterion must be available, but may not necessarily be reserved, for the event.<br>
Criterion 5: Language<br>
The selected venue must be in an area where English is commonly spoken, at least by hospitality workers. English need not be the dominant language in the area, but as it is the &ldquo;common language&rdquo; of PowerShell, English must at least be commonly understood as a &ldquo;lingua franca&rdquo; in order for a maximum number of attendees to be able to navigate the area. Venues that do not meet this criterion may still be viable locations for a regional, cultural-specific event, but might not be qualified for a PowerShell Summit.<br>
Criterion 6: Centrality<br>
Given all of the other criteria previously listed, it is desirable to have a venue that provides equitable travel access from the majority of the target area. However, the organization recognizes that central location is often the most difficult to achieve in combination with the other criteria listed.<br>
Criterion 7: Accessibility<br>
The venue must conform with a general international standard of access for disabled persons, and must provide at least basic ability to meet common dietary restrictions, such as vegetarianism. The organization accepts that extremely specific dietary needs, such as cultural or religious needs or allergy concerns, might incur extra costs that would be passed along to the concerned attendee(s).<br>
Criterion 8: Appropriateness<br>
The venue must provide appropriate meeting facilities. This means the venue must be able to accommodate the expected number of attendees in a comfortable and safe surrounding, and attendees must be able to access the venue without undue overhead (e.g., extensive security checks in an office building, etc.). In multi-track events, meeting rooms should be able to accommodate a 15-20% offset (e.g., in a 300-person event with 300 attendees, each room must be able to handle 120 attendees, to deal with the fact that some sessions will be more popular than others).</p>
]]></content:encoded></item><item><title>PowerShell Great Debate: Piping in a Script</title><link>https://powershell.org/articles/2013-07-16-powershell-great-debate-piping-in-a-script/</link><guid>https://powershell.org/articles/2013-07-16-powershell-great-debate-piping-in-a-script/</guid><pubDate>Tue, 16 Jul 2013 17:40:09 +0000</pubDate><description>&lt;p&gt;Take a look at this:&lt;/p&gt;
&lt;p&gt;`# version 1
Get-Content computers.txt |
ForEach-Object {
$os = Get-WmiObject Win32_OperatingSystem -comp $_
$bios = Get-WmiObject Win32_BIOS -comp $_
$props = @{computername=$_;
osversion=$os.version;
biosserial=$bios.serialnumber}
New-Object PSObject -Prop $props
}&lt;/p&gt;
&lt;h1 id="version-2" class="ps-heading"&gt;version 2&lt;a class="ps-heading-anchor" href="#version-2" 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;/h1&gt;
&lt;p&gt;$computers = Get-Content computers.txt
foreach ($computer in $computers) {
$os = Get-WmiObject Win32_OperatingSystem -comp $computer
$bios = Get-WmiObject Win32_BIOS -comp $computer
$props = @{computername=$computer;
osversion=$os.version;
biosserial=$bios.serialnumber}
New-Object PSObject -Prop $props
}
`These two snippets do the same thing. The first uses a more &amp;ldquo;pipeline&amp;rdquo; style approach, and I&amp;rsquo;ve personally never felt the urge to do that in a script. Probably habit - I come from the VBScript world, so a construct like foreach($x in $y) is natural for me. I&amp;rsquo;ve seen folks get into that &amp;ldquo;pipeline&amp;rdquo; approach inside a script and get into trouble, and if I&amp;rsquo;m scripting I often prefer to use the more formal, structured approach of the version 2 snippet.&lt;br&gt;
What&amp;rsquo;re your thoughts? For me, version 1 has some downsides - forcing yourself into that pipeline structure can be limiting, and I find the approach in version 2 to be more readable and a bit easier to follow. Frankly, I&amp;rsquo;m never a fan of having to mentally track what&amp;rsquo;s in $&lt;em&gt;.&lt;br&gt;
(Which brings up a sidebar: I tend to evaluate a script&amp;rsquo;s goodness based on how well I can understand what it does &lt;em&gt;without running it&lt;/em&gt;. That&amp;rsquo;s a common criteria, in fact, and one I personally think helps aid in debugging as well as maintaining scripts.)&lt;/em&gt;&lt;br&gt;
_&lt;br&gt;
Anyway&amp;hellip; discuss!&lt;br&gt;
[boilerplate greatdebate]&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Take a look at this:</p><p>`# version 1
Get-Content computers.txt |
ForEach-Object {
$os = Get-WmiObject Win32_OperatingSystem -comp $_
$bios = Get-WmiObject Win32_BIOS -comp $_
$props = @{computername=$_;
osversion=$os.version;
biosserial=$bios.serialnumber}
New-Object PSObject -Prop $props
}</p><h1 id="version-2" class="ps-heading">version 2<a class="ps-heading-anchor" href="#version-2" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>$computers = Get-Content computers.txt
foreach ($computer in $computers) {
$os = Get-WmiObject Win32_OperatingSystem -comp $computer
$bios = Get-WmiObject Win32_BIOS -comp $computer
$props = @{computername=$computer;
osversion=$os.version;
biosserial=$bios.serialnumber}
New-Object PSObject -Prop $props
}
`These two snippets do the same thing. The first uses a more &ldquo;pipeline&rdquo; style approach, and I&rsquo;ve personally never felt the urge to do that in a script. Probably habit - I come from the VBScript world, so a construct like foreach($x in $y) is natural for me. I&rsquo;ve seen folks get into that &ldquo;pipeline&rdquo; approach inside a script and get into trouble, and if I&rsquo;m scripting I often prefer to use the more formal, structured approach of the version 2 snippet.<br>
What&rsquo;re your thoughts? For me, version 1 has some downsides - forcing yourself into that pipeline structure can be limiting, and I find the approach in version 2 to be more readable and a bit easier to follow. Frankly, I&rsquo;m never a fan of having to mentally track what&rsquo;s in $<em>.<br>
(Which brings up a sidebar: I tend to evaluate a script&rsquo;s goodness based on how well I can understand what it does <em>without running it</em>. That&rsquo;s a common criteria, in fact, and one I personally think helps aid in debugging as well as maintaining scripts.)</em><br>
_<br>
Anyway&hellip; discuss!<br>
[boilerplate greatdebate]</p>
]]></content:encoded></item><item><title>PhillyPoSH 07/11/2013 meeting summary and presentation materials</title><link>https://powershell.org/articles/2013-07-15-phillyposh-07112013-meeting-summary-and-presentation-materials/</link><guid>https://powershell.org/articles/2013-07-15-phillyposh-07112013-meeting-summary-and-presentation-materials/</guid><pubDate>Tue, 16 Jul 2013 02:00:04 +0000</pubDate><description>&lt;ol&gt;
&lt;li&gt;Active Directory SDK team member and former Senior Programing writer for the Windows PowerShell team, &lt;a href="https://twitter.com/juneb_get_help"&gt;Jun Blender&lt;/a&gt; gave a presentation on The Hidden Charms of Windows PowerShell 3.0 via Lync. You can get a copy of &lt;a href="https://powershell.org/wp-content/uploads/2013/07/PhillyPosh_2013-07-11_June_Blender.pptx"&gt;her presentation here&lt;/a&gt; and see a &lt;a href="https://www.youtube.com/watch?v=rY-kkuTwWUs"&gt;recording of the Lync meeting&lt;/a&gt; on our &lt;a href="https://www.youtube.com/channel/UCAc_ow5FIJtRpvew__9Iqzg"&gt;YouTube channel&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Microsoft Technology Evangelist &lt;a href="http://blogs.technet.com/b/yungchou/"&gt;Yung Chou&lt;/a&gt; gave demonstration on how to use the &lt;a href="http://msdn.microsoft.com/en-us/library/windowsazure/jj152841.aspx"&gt;PowerShell Azure cmdlets&lt;/a&gt; to automate data center deployments
&lt;ol&gt;
&lt;li&gt;You can try doing the same and test server 2012 R2 out with a free &lt;a href="http://aka.ms/200"&gt;1-month trial of Windows Azure&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;General Announcements
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://www.microsoftvirtualacademy.com"&gt;The Microsoft Virtual Academy&lt;/a&gt; is hosting 2 separate day long PowerShell learning sessions that will be taught by the lead Architect of PowerShell &lt;a href="https://powershell.org/wp-admin/@jsnover"&gt;Jeffery Snover&lt;/a&gt; and &lt;a href="https://powershell.org/wp-admin/PowerShell.org"&gt;PowerShell.org&lt;/a&gt; board member &lt;a href="https://powershell.org/wp-admin/@theJasonHelmick"&gt;Jason Helmick.&lt;/a&gt; Link to the sessions are as follows:
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://www.microsoftvirtualacademy.com/liveevents/PowerShell-JumpStart"&gt;Getting Started with PowerShell 3.0 : 7/18/2013 9AM-5PM PDT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.microsoftvirtualacademy.com/liveevents/Adv-PowerShell-Jump-Start"&gt;Advanced Tools &amp;amp; Scripting with PowerShell 3.0: 8/1/2013 9AM-5PM PDT&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;The &lt;a href="http://powerscripting.wordpress.com/2013/07/08/we-want-your-powershell-show-ideas/"&gt;PowerScript Podcast&lt;/a&gt; is looking for show ideas&lt;/li&gt;
&lt;li&gt;In the wake of the 2013 scripting games there are many entries in the &lt;a href="https://powershell.org/category/great-debates/"&gt;&amp;ldquo;Great Debates&amp;rdquo;&lt;/a&gt; series, in which the
community discusses the differing techniques that the community used during the games
&lt;ol&gt;
&lt;li&gt;Speaking of the scripting games, the winners were on the &lt;a href="http://powerscripting.wordpress.com/2013/07/10/up-next-winners-from-the-2013-scripting-games/"&gt;PowerScritping Podcast&lt;/a&gt; this week&lt;/li&gt;
&lt;li&gt;&lt;a href="http://mikefrobbins.com/"&gt;Mike Robbins&lt;/a&gt;, the winner of the advanced category, will be presenting for us in September!
&lt;ol&gt;
&lt;li&gt;Mike also runs the virtual &lt;a href="http://mspsug.com/"&gt;Mississippi PowerShell User Group&lt;/a&gt; and makes his meetings available to everyone.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Last month&amp;quot;™s speaker, &lt;a href="http://rohnspowershellblog.wordpress.com/"&gt;Rohn Edwards&lt;/a&gt;, has recently &lt;a href="http://rohnspowershellblog.wordpress.com/tag/powershellaccesscontrol/"&gt;blogged&lt;/a&gt; about how to use some of the functions included in his &lt;a href="http://gallery.technet.microsoft.com/scriptcenter/PowerShellAccessControl-d3be7b83"&gt;PowerShellAccessControl Module&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Check out &lt;a href="http://chocolatey.org/"&gt;Chocolatey&lt;/a&gt; which is a Machine Package Manager, somewhat like apt-get, but built with Windows and PowerShell in mind.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;</description><content:encoded>&lt;![CDATA[<ol><li>Active Directory SDK team member and former Senior Programing writer for the Windows PowerShell team,<a href="https://twitter.com/juneb_get_help">Jun Blender</a> gave a presentation on The Hidden Charms of Windows PowerShell 3.0 via Lync. You can get a copy of<a href="https://powershell.org/wp-content/uploads/2013/07/PhillyPosh_2013-07-11_June_Blender.pptx">her presentation here</a> and see a<a href="https://www.youtube.com/watch?v=rY-kkuTwWUs">recording of the Lync meeting</a> on our<a href="https://www.youtube.com/channel/UCAc_ow5FIJtRpvew__9Iqzg">YouTube channel</a></li><li>Microsoft Technology Evangelist<a href="http://blogs.technet.com/b/yungchou/">Yung Chou</a> gave demonstration on how to use the <a href="http://msdn.microsoft.com/en-us/library/windowsazure/jj152841.aspx">PowerShell Azure cmdlets</a> to automate data center deployments<ol><li>You can try doing the same and test server 2012 R2 out with a free<a href="http://aka.ms/200">1-month trial of Windows Azure</a></li></ol></li><li>General Announcements<ol><li><a href="http://www.microsoftvirtualacademy.com">The Microsoft Virtual Academy</a> is hosting 2 separate day long PowerShell learning sessions that will be taught by the lead Architect of PowerShell<a href="https://powershell.org/wp-admin/@jsnover">Jeffery Snover</a> and<a href="https://powershell.org/wp-admin/PowerShell.org">PowerShell.org</a> board member<a href="https://powershell.org/wp-admin/@theJasonHelmick">Jason Helmick.</a> Link to the sessions are as follows:<ol><li><a href="http://www.microsoftvirtualacademy.com/liveevents/PowerShell-JumpStart">Getting Started with PowerShell 3.0 : 7/18/2013 9AM-5PM PDT</a></li><li><a href="http://www.microsoftvirtualacademy.com/liveevents/Adv-PowerShell-Jump-Start">Advanced Tools &amp; Scripting with PowerShell 3.0: 8/1/2013 9AM-5PM PDT</a></li></ol></li><li>The<a href="http://powerscripting.wordpress.com/2013/07/08/we-want-your-powershell-show-ideas/">PowerScript Podcast</a> is looking for show ideas</li><li>In the wake of the 2013 scripting games there are many entries in the<a href="https://powershell.org/category/great-debates/">&ldquo;Great Debates&rdquo;</a> series, in which the
community discusses the differing techniques that the community used during the games<ol><li>Speaking of the scripting games, the winners were on the<a href="http://powerscripting.wordpress.com/2013/07/10/up-next-winners-from-the-2013-scripting-games/">PowerScritping Podcast</a> this week</li><li><a href="http://mikefrobbins.com/">Mike Robbins</a>, the winner of the advanced category, will be presenting for us in September!<ol><li>Mike also runs the virtual<a href="http://mspsug.com/">Mississippi PowerShell User Group</a> and makes his meetings available to everyone.</li></ol></li></ol></li><li>Last month"™s speaker,<a href="http://rohnspowershellblog.wordpress.com/">Rohn Edwards</a>, has recently<a href="http://rohnspowershellblog.wordpress.com/tag/powershellaccesscontrol/">blogged</a> about how to use some of the functions included in his<a href="http://gallery.technet.microsoft.com/scriptcenter/PowerShellAccessControl-d3be7b83">PowerShellAccessControl Module</a></li><li>Check out<a href="http://chocolatey.org/">Chocolatey</a> which is a Machine Package Manager, somewhat like apt-get, but built with Windows and PowerShell in mind.</li></ol></li></ol>
]]></content:encoded></item><item><title>Working with the WSUS API and the SUSDB Database using PowerShell</title><link>https://powershell.org/articles/2013-07-11-working-with-the-wsus-api-and-the-susdb-database-using-powershell/</link><guid>https://powershell.org/articles/2013-07-11-working-with-the-wsus-api-and-the-susdb-database-using-powershell/</guid><pubDate>Fri, 12 Jul 2013 02:38:43 +0000</pubDate><description>&lt;p&gt;Tthe WSUS API can be used to perform a multitude of WSUS tasks from approving patches, removing clients to creating automatic approval rules to many other things. By diving deeper into the API reveals that we can also find out the name of the SQL server (if using a remote SQL database server) that the SUSDB database is residing on. Beyond that, we can actually perform queries to the database (using TSQL) or perform tasks against the database itself.&lt;br&gt;
I&amp;rsquo;ve written a couple of articles hat focus on making the database connection via the WSUS API and preform a simple query and then following up on that by performing some database maintenance by re-indexing and updating the statistics on the database tables.&lt;br&gt;
&lt;a href="http://learn-powershell.net/2013/07/07/use-the-wsus-api-and-powershell-to-query-the-susdb-database/"&gt;Use the WSUS API and PowerShell to query the SUSDB Database&lt;/a&gt;&lt;br&gt;
&lt;a href="http://learn-powershell.net/2013/07/07/using-the-wsus-api-and-powershell-to-perform-maintenance-on-the-susdb-database/"&gt;Using the WSUS API and PowerShell to Perform Maintenance on the SUSDB Database&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Tthe WSUS API can be used to perform a multitude of WSUS tasks from approving patches, removing clients to creating automatic approval rules to many other things. By diving deeper into the API reveals that we can also find out the name of the SQL server (if using a remote SQL database server) that the SUSDB database is residing on. Beyond that, we can actually perform queries to the database (using TSQL) or perform tasks against the database itself.<br>
I&rsquo;ve written a couple of articles hat focus on making the database connection via the WSUS API and preform a simple query and then following up on that by performing some database maintenance by re-indexing and updating the statistics on the database tables.<br><a href="http://learn-powershell.net/2013/07/07/use-the-wsus-api-and-powershell-to-query-the-susdb-database/">Use the WSUS API and PowerShell to query the SUSDB Database</a><br><a href="http://learn-powershell.net/2013/07/07/using-the-wsus-api-and-powershell-to-perform-maintenance-on-the-susdb-database/">Using the WSUS API and PowerShell to Perform Maintenance on the SUSDB Database</a></p>
]]></content:encoded></item><item><title>PowerShell Summit… EUROPE?!?!?</title><link>https://powershell.org/articles/2013-07-11-powershell-summit-europe/</link><guid>https://powershell.org/articles/2013-07-11-powershell-summit-europe/</guid><pubDate>Thu, 11 Jul 2013 18:47:05 +0000</pubDate><description>&lt;p&gt;I have received a lot of interest in a PowerShell Summit Europe, and we are starting to look at doing one in 2014. I know that&amp;rsquo;s a long way off, but it takes time to put these together when everyone&amp;rsquo;s volunteering that time!&lt;br&gt;
I have put together a very short survey to see if there is any consensus on where such an event might be held. The survey is &lt;a href="http://67004.polldaddy.com/s/powershell-summit-europe"&gt;online now and ready for your opinions&lt;/a&gt;. Please forward this to your colleagues and co-workers, as well - we would really like a variety of opinions. If you want to tweet about it, Facebook it, or anything else to help us get a broad perspective, it would be much appreciated.&lt;br&gt;
I must note that this event will be in English, as it is meant to be a pan-European event that involves as many different folks as possible. We are not attempting to hold a more regional, culture-specific event - some of those already exist (I&amp;rsquo;m aware of one in Germany, for example), and they do a better job serving their local market (which can be quite large) than we could ever do. We are trying to fill a different need, which is more along the lines of a very miniature TechEd Europe, which brings as many different folks together as possible. Hopefully we will achieve that goal.&lt;br&gt;
Thank you for your time and input!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I have received a lot of interest in a PowerShell Summit Europe, and we are starting to look at doing one in 2014. I know that&rsquo;s a long way off, but it takes time to put these together when everyone&rsquo;s volunteering that time!<br>
I have put together a very short survey to see if there is any consensus on where such an event might be held. The survey is<a href="http://67004.polldaddy.com/s/powershell-summit-europe">online now and ready for your opinions</a>. Please forward this to your colleagues and co-workers, as well - we would really like a variety of opinions. If you want to tweet about it, Facebook it, or anything else to help us get a broad perspective, it would be much appreciated.<br>
I must note that this event will be in English, as it is meant to be a pan-European event that involves as many different folks as possible. We are not attempting to hold a more regional, culture-specific event - some of those already exist (I&rsquo;m aware of one in Germany, for example), and they do a better job serving their local market (which can be quite large) than we could ever do. We are trying to fill a different need, which is more along the lines of a very miniature TechEd Europe, which brings as many different folks together as possible. Hopefully we will achieve that goal.<br>
Thank you for your time and input!</p>
]]></content:encoded></item><item><title>PowerShell Great Debate: Backticks</title><link>https://powershell.org/articles/2013-07-10-powershell-great-debate-backticks/</link><guid>https://powershell.org/articles/2013-07-10-powershell-great-debate-backticks/</guid><pubDate>Wed, 10 Jul 2013 21:26:50 +0000</pubDate><description>&lt;p&gt;Here&amp;rsquo;s an age-old debate that we can finally, perhaps, put an end to: The backtick character for line continuation.&lt;br&gt;
The basic concept looks like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Get-WmiObject -Class Win32_BIOS &lt;/code&gt;
-ComputerName whatever &lt;code&gt;-Filter &amp;quot;something='else'&amp;quot;&lt;/code&gt;This trick relies on the fact that the backtick (grave accent) is PowerShell&amp;rsquo;s escape character. In this case, it&amp;rsquo;s escaping the carriage return, turning it from a logical end-of-line marker into a literal carriage return. It makes commands with a lot of parameters easier to read, since you can line up the parameters as I&amp;rsquo;ve done.&lt;br&gt;
My personal beefs with this:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Here&rsquo;s an age-old debate that we can finally, perhaps, put an end to: The backtick character for line continuation.<br>
The basic concept looks like this:</p><p><code>Get-WmiObject -Class Win32_BIOS</code>
-ComputerName whatever<code>-Filter "something='else'"</code>This trick relies on the fact that the backtick (grave accent) is PowerShell&rsquo;s escape character. In this case, it&rsquo;s escaping the carriage return, turning it from a logical end-of-line marker into a literal carriage return. It makes commands with a lot of parameters easier to read, since you can line up the parameters as I&rsquo;ve done.<br>
My personal beefs with this:</p><ul><li/></ul><p>The character is visually hard to distinguish. On-screen, it&rsquo;s just a couple of pixels; in a book, it looks like stray ink or toner.</p><ul><li>If you put any whitespace after the backtick, it escapes <em>that</em> character instead of the carriage return, and everything breaks.</li><li>On some non-US keyboards, it&rsquo;s a difficult character to get to.</li></ul><p>In  many cases, you can achieve nice formatting without the back tick.</p><p><code>Do-Something -Parameter this | Get-Something -Parameter those -Parm these | Something-Else -This that -Foo bar</code>This is because a carriage return after a pipe, semicolon, or comma is always interpreted as a visual thing, and not as a logical end of line. Of course, some argue that you can make that command prettier by using the back tick:</p><p><code>Do-Something -Param this</code>
| Something-Else -this that -foo bar<code>| Invoke-Those -these those</code>Here, the pipes line up on the front, making the command into a kind of visual block - but you have to rely on the backticks. You could then argue that a combination of splatting and careful formatting could be nicer, without the backticks:</p><p><code>$do_something = @{parameter = $this; foo = $bar} $invoke_something = @{param = $these; param = $those} Do-Something @do_something | Invoke-Something @invoke_something | Something-Else</code>Visually blocked-out, but no back ticks.<br>
And the debate rages on. Your thoughts? Pros? Cons? <em>Why?</em></p><p>[boilerplate greatdebate]</p>
]]></content:encoded></item><item><title>Would you contribute enterprise software reviews? [OFFTOPIC]</title><link>https://powershell.org/articles/2013-07-09-would-you-contribute-enterprise-software-reviews-offtopic/</link><guid>https://powershell.org/articles/2013-07-09-would-you-contribute-enterprise-software-reviews-offtopic/</guid><pubDate>Tue, 09 Jul 2013 18:03:55 +0000</pubDate><description>&lt;p&gt;I&amp;rsquo;ve been working with a couple of folks lately who&amp;rsquo;ve been trying to review and pilot Active Directory auditing solutions. Both bemoaned the fact that, unlike consumer products of nearly any kind, IT products (specifically, enterprise software in this instance), don&amp;rsquo;t really get reviews from the admins who use those products.&lt;br&gt;
So, I&amp;rsquo;m curious. If you could (a) anonymously, and (b) without giving your organization&amp;rsquo;s name, would you (c) leave reviews of enterprise software for other admins? You&amp;rsquo;d need to leave some obvious details, like the approximate size of your organization (number of users), what you expected the software to do, what it really did, what you liked, what you didn&amp;rsquo;t like, and so on.&lt;br&gt;
Such a site would be a lot better (I think) than magazine or &amp;ldquo;professional&amp;rdquo; reviews, since you&amp;rsquo;d be reading the experiences of people who actually use the stuff every day. Yeah, as with any publicly-contributed content, review quality will vary - but you already know how to read between the lines, right? 😉&lt;br&gt;
Drop a comment, or even send a tweet to &lt;a href="http://twitter.com/concentrateddon"&gt;@concentrateddon&lt;/a&gt; with &amp;ldquo;Reviews: YES!&amp;rdquo; or &amp;ldquo;Reviews: NO!&amp;rdquo; comment. Or if you prefer Facebook, leave that comment &lt;a href="http://facebook.com/concentrateddon"&gt;on my FB page&lt;/a&gt;. It sure seems like we IT professionals could use something like this - it&amp;rsquo;d be a good place to start researching solutions to particular problems, and a good place to share some real-world intel on how different solutions really work. Even if you don&amp;rsquo;t like &lt;em&gt;writing&lt;/em&gt; reviews, would you use such a site as part of your research process?&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I&rsquo;ve been working with a couple of folks lately who&rsquo;ve been trying to review and pilot Active Directory auditing solutions. Both bemoaned the fact that, unlike consumer products of nearly any kind, IT products (specifically, enterprise software in this instance), don&rsquo;t really get reviews from the admins who use those products.<br>
So, I&rsquo;m curious. If you could (a) anonymously, and (b) without giving your organization&rsquo;s name, would you (c) leave reviews of enterprise software for other admins? You&rsquo;d need to leave some obvious details, like the approximate size of your organization (number of users), what you expected the software to do, what it really did, what you liked, what you didn&rsquo;t like, and so on.<br>
Such a site would be a lot better (I think) than magazine or &ldquo;professional&rdquo; reviews, since you&rsquo;d be reading the experiences of people who actually use the stuff every day. Yeah, as with any publicly-contributed content, review quality will vary - but you already know how to read between the lines, right? 😉<br>
Drop a comment, or even send a tweet to<a href="http://twitter.com/concentrateddon">@concentrateddon</a> with &ldquo;Reviews: YES!&rdquo; or &ldquo;Reviews: NO!&rdquo; comment. Or if you prefer Facebook, leave that comment<a href="http://facebook.com/concentrateddon">on my FB page</a>. It sure seems like we IT professionals could use something like this - it&rsquo;d be a good place to start researching solutions to particular problems, and a good place to share some real-world intel on how different solutions really work. Even if you don&rsquo;t like <em>writing</em> reviews, would you use such a site as part of your research process?</p>
]]></content:encoded></item><item><title>New Blog Posting on Desired State Configuration</title><link>https://powershell.org/articles/2013-07-09-new-blog-posting-on-desired-state-configuration/</link><guid>https://powershell.org/articles/2013-07-09-new-blog-posting-on-desired-state-configuration/</guid><pubDate>Tue, 09 Jul 2013 14:29:29 +0000</pubDate><description>&lt;p&gt;Just an FYI that I posted a walkthrough on my blog, of DSC, including my experiences as it relates to Group Policy:&lt;br&gt;
&lt;a href="http://bit.ly/1868BYS"&gt;http://bit.ly/1868BYS&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Just an FYI that I posted a walkthrough on my blog, of DSC, including my experiences as it relates to Group Policy:<br><a href="http://bit.ly/1868BYS">http://bit.ly/1868BYS</a></p>
]]></content:encoded></item><item><title>How Cloud-First Design Affects You</title><link>https://powershell.org/articles/2013-07-03-how-cloud-first-design-affects-you/</link><guid>https://powershell.org/articles/2013-07-03-how-cloud-first-design-affects-you/</guid><pubDate>Wed, 03 Jul 2013 17:29:36 +0000</pubDate><description>&lt;p&gt;Today, Brad Anderson (Corporate VP in the Windows Server/System Center unit) posted &lt;a href="http://blogs.technet.com/b/in_the_cloud/archive/2013/07/03/what-s-new-in-2012-r2-beginning-and-ending-with-customer-specific-scenarios.aspx"&gt;the first in what should be a series of &amp;ldquo;What&amp;rsquo;s New in 2012 R2&amp;rdquo; articles&lt;/a&gt;. In it, Anderson focuses on how Microsoft squeezed so many features into the 2012R2 release in such a short period of time. The short answer, which has been stated by Jeffrey Snover before, is &amp;ldquo;we build for the cloud first.&amp;rdquo; That means features we&amp;rsquo;re getting in 2012R2 have, for the most part, already been developed, deployed, and in use in some of Microsoft&amp;rsquo;s own cloud services. This is a huge deal. It means their cloud services (think Azure, O365, and the like) get stuff first, where &lt;em&gt;Microsoft&lt;/em&gt; can make sure it&amp;rsquo;s stable. They then package those and hand them off to us.&lt;br&gt;
It means we get better stability, but it also means we get better manageability. Look, you don&amp;rsquo;t get excited when you have to deploy a new server, right? You want to automate that stuff. Well, Azure gets &lt;em&gt;really&lt;/em&gt; ticked off if they can&amp;rsquo;t automate it, because they do it &lt;em&gt;thousands times more than you.&lt;/em&gt; So forcing themselves to run a ginormous datacenter also forces the company to make better management tools - which they then hand down to us in an OS release.&lt;br&gt;
If, that is, you&amp;rsquo;re managing your datacenter as if it was your own little&amp;hellip; dare I say it, &lt;em&gt;private cloud.&lt;/em&gt; In other words, if you think of your datacenter as a wee little cloud, and you manage it like one, then you&amp;rsquo;ll get the tech you need, because Microsoft has to develop that tech for themselves. If you want to keep managing it the old-fashioned way&amp;hellip; well, you&amp;rsquo;ll get less love.&lt;br&gt;
This whole approach, for me, is the ultimate expression of the Microsoft phrase, &amp;ldquo;eat the dogfood.&amp;rdquo; Meaning, &lt;em&gt;use our own products just as our customers would.&lt;/em&gt; You just have to make sure you&amp;rsquo;re eating the same flavor dogfood. Not that MS expects everyone to have their own in-house Azure. No, that&amp;rsquo;s not the point. The point is that they&amp;rsquo;re developing for a world where admins do nothing but create units of automation, and business processes (perhaps outside IT) initiate those processes. You&amp;rsquo;re going to see more and more tools and technologies (um, PowerShell) to facilitate that model of IT operations; you&amp;rsquo;ll see less and less tech that facilitates the old way (meaning, fewer and less robust GUI tools, I&amp;rsquo;m guessing).&lt;br&gt;
Desired State Configuration (DSC) is probably an ideal example of this new approach. In the past, when you wanted to configure a few hundred machines to look and behave a certain way, you went clicky-click a few hundred times in a GUI. That&amp;rsquo;s &lt;em&gt;imperative&lt;/em&gt; configuration; you tell each machine &lt;em&gt;what to do.&lt;/em&gt; That doesn&amp;rsquo;t scale to cloud-sized proportions, and so now we&amp;rsquo;re getting DSC. DSC is &lt;em&gt;declarative&lt;/em&gt; configuration, meaning you tell a group of machines &lt;em&gt;what to be.&lt;/em&gt; The OS itself figures out how to achieve that state of being. So admins have to shift from thinking &amp;ldquo;what do I make the machine do&amp;rdquo; and &amp;ldquo;how do I tell it what to be.&amp;rdquo; It&amp;rsquo;s not unlike Group Policy, actually, which is also declarative, except that DSC will eventually dwarf Group Policy in terms of reach and capability.&lt;br&gt;
Point being, if you&amp;rsquo;re in the old world of, &amp;ldquo;I just run through the Wizard and set the machine up,&amp;rdquo; you&amp;rsquo;re not aligned with the new world order. Expect fewer wizards, as product teams shift their investment to building things like DSC resources instead. With 12-18 month product cycles, time is in short supply for each new release. One-at-a-time approaches don&amp;rsquo;t scale to the cloud, so those are likely to get less of that limited amount of time.&lt;br&gt;
Anderson&amp;rsquo;s post is worth a read. It&amp;rsquo;s a little high-level - the man &lt;em&gt;is&lt;/em&gt; a Corporate VP, after all - but it shows where Microsoft is pointing their collective brain. It uses the word &amp;ldquo;delight.&amp;rdquo; It describes in great detail how Microsoft is trying harder to put the customer in the front of every conversation - but, more subtly, it also shows how Microsoft is moving the conversation past &amp;ldquo;what do customers tell us they want&amp;rdquo; and more toward &amp;ldquo;here&amp;rsquo;s what we see customers &lt;em&gt;needing.&lt;/em&gt;&amp;rdquo; Henry Ford would be proud.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Today, Brad Anderson (Corporate VP in the Windows Server/System Center unit) posted<a href="http://blogs.technet.com/b/in_the_cloud/archive/2013/07/03/what-s-new-in-2012-r2-beginning-and-ending-with-customer-specific-scenarios.aspx">the first in what should be a series of &ldquo;What&rsquo;s New in 2012 R2&rdquo; articles</a>. In it, Anderson focuses on how Microsoft squeezed so many features into the 2012R2 release in such a short period of time. The short answer, which has been stated by Jeffrey Snover before, is &ldquo;we build for the cloud first.&rdquo; That means features we&rsquo;re getting in 2012R2 have, for the most part, already been developed, deployed, and in use in some of Microsoft&rsquo;s own cloud services. This is a huge deal. It means their cloud services (think Azure, O365, and the like) get stuff first, where<em>Microsoft</em> can make sure it&rsquo;s stable. They then package those and hand them off to us.<br>
It means we get better stability, but it also means we get better manageability. Look, you don&rsquo;t get excited when you have to deploy a new server, right? You want to automate that stuff. Well, Azure gets<em>really</em> ticked off if they can&rsquo;t automate it, because they do it<em>thousands times more than you.</em> So forcing themselves to run a ginormous datacenter also forces the company to make better management tools - which they then hand down to us in an OS release.<br>
If, that is, you&rsquo;re managing your datacenter as if it was your own little&hellip; dare I say it,<em>private cloud.</em> In other words, if you think of your datacenter as a wee little cloud, and you manage it like one, then you&rsquo;ll get the tech you need, because Microsoft has to develop that tech for themselves. If you want to keep managing it the old-fashioned way&hellip; well, you&rsquo;ll get less love.<br>
This whole approach, for me, is the ultimate expression of the Microsoft phrase, &ldquo;eat the dogfood.&rdquo; Meaning,<em>use our own products just as our customers would.</em> You just have to make sure you&rsquo;re eating the same flavor dogfood. Not that MS expects everyone to have their own in-house Azure. No, that&rsquo;s not the point. The point is that they&rsquo;re developing for a world where admins do nothing but create units of automation, and business processes (perhaps outside IT) initiate those processes. You&rsquo;re going to see more and more tools and technologies (um, PowerShell) to facilitate that model of IT operations; you&rsquo;ll see less and less tech that facilitates the old way (meaning, fewer and less robust GUI tools, I&rsquo;m guessing).<br>
Desired State Configuration (DSC) is probably an ideal example of this new approach. In the past, when you wanted to configure a few hundred machines to look and behave a certain way, you went clicky-click a few hundred times in a GUI. That&rsquo;s<em>imperative</em> configuration; you tell each machine<em>what to do.</em> That doesn&rsquo;t scale to cloud-sized proportions, and so now we&rsquo;re getting DSC. DSC is<em>declarative</em> configuration, meaning you tell a group of machines<em>what to be.</em> The OS itself figures out how to achieve that state of being. So admins have to shift from thinking &ldquo;what do I make the machine do&rdquo; and &ldquo;how do I tell it what to be.&rdquo; It&rsquo;s not unlike Group Policy, actually, which is also declarative, except that DSC will eventually dwarf Group Policy in terms of reach and capability.<br>
Point being, if you&rsquo;re in the old world of, &ldquo;I just run through the Wizard and set the machine up,&rdquo; you&rsquo;re not aligned with the new world order. Expect fewer wizards, as product teams shift their investment to building things like DSC resources instead. With 12-18 month product cycles, time is in short supply for each new release. One-at-a-time approaches don&rsquo;t scale to the cloud, so those are likely to get less of that limited amount of time.<br>
Anderson&rsquo;s post is worth a read. It&rsquo;s a little high-level - the man<em>is</em> a Corporate VP, after all - but it shows where Microsoft is pointing their collective brain. It uses the word &ldquo;delight.&rdquo; It describes in great detail how Microsoft is trying harder to put the customer in the front of every conversation - but, more subtly, it also shows how Microsoft is moving the conversation past &ldquo;what do customers tell us they want&rdquo; and more toward &ldquo;here&rsquo;s what we see customers<em>needing.</em>&rdquo; Henry Ford would be proud.</p>
]]></content:encoded></item><item><title>It's Safe to Run Update-Help – and you should!</title><link>https://powershell.org/articles/2013-07-02-its-safe-to-run-update-help-and-you-should/</link><guid>https://powershell.org/articles/2013-07-02-its-safe-to-run-update-help-and-you-should/</guid><pubDate>Tue, 02 Jul 2013 17:23:30 +0000</pubDate><description>&lt;p&gt;I&amp;rsquo;m informed that sometime today Microsoft will be posting fixed core cmdlet help files for your downloading pleasure - so it&amp;rsquo;s safe to run Update-Help again, and you should definitely do so. There are likely a lot of fixes and improvements to the help text, and you won&amp;rsquo;t be &amp;ldquo;losing&amp;rdquo; the parameter value type information from the SYNTAX section.&lt;br&gt;
Maybe schedule an Update-Help for tomorrow morning?&lt;br&gt;
BTW - kudos to the team at Microsoft for getting this issue fixed so quickly. It&amp;rsquo;s a shame this one snuck past them, but once notified of the problem they really did jump on it. The fact that the problem was (from the public perspective) just with the downloadable help files means it&amp;rsquo;s an easy fix that doesn&amp;rsquo;t involve pushing code out through Windows Update (thank goodness).&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I&rsquo;m informed that sometime today Microsoft will be posting fixed core cmdlet help files for your downloading pleasure - so it&rsquo;s safe to run Update-Help again, and you should definitely do so. There are likely a lot of fixes and improvements to the help text, and you won&rsquo;t be &ldquo;losing&rdquo; the parameter value type information from the SYNTAX section.<br>
Maybe schedule an Update-Help for tomorrow morning?<br>
BTW - kudos to the team at Microsoft for getting this issue fixed so quickly. It&rsquo;s a shame this one snuck past them, but once notified of the problem they really did jump on it. The fact that the problem was (from the public perspective) just with the downloadable help files means it&rsquo;s an easy fix that doesn&rsquo;t involve pushing code out through Windows Update (thank goodness).</p>
]]></content:encoded></item><item><title>PowerShell Great Debate: Formatting Constructs</title><link>https://powershell.org/articles/2013-07-02-powershell-great-debate-formatting-constructs/</link><guid>https://powershell.org/articles/2013-07-02-powershell-great-debate-formatting-constructs/</guid><pubDate>Tue, 02 Jul 2013 15:23:43 +0000</pubDate><description>&lt;p&gt;Here&amp;rsquo;s an easy, low-stakes debate: How do you like to format your scripting constructs? And, more importantly, &lt;em&gt;why&lt;/em&gt; do you like your method?&lt;br&gt;
For example, I tend to do this:&lt;/p&gt;
&lt;p&gt;`If ($this -eq $that) {&lt;/p&gt;
&lt;h1 id="do-this" class="ps-heading"&gt;do this&lt;a class="ps-heading-anchor" href="#do-this" 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;/h1&gt;
&lt;p&gt;} else {&lt;/p&gt;
&lt;h1 id="do-this-1" class="ps-heading"&gt;do this&lt;a class="ps-heading-anchor" href="#do-this-1" 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;/h1&gt;
&lt;p&gt;}
`I do so out of long habit with C-like syntax, and because when I&amp;rsquo;m teaching this helps me keep more information on the screen. However, some folks prefer this:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Here&rsquo;s an easy, low-stakes debate: How do you like to format your scripting constructs? And, more importantly, <em>why</em> do you like your method?<br>
For example, I tend to do this:</p><p>`If ($this -eq $that) {</p><h1 id="do-this" class="ps-heading">do this<a class="ps-heading-anchor" href="#do-this" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>} else {</p><h1 id="do-this-1" class="ps-heading">do this<a class="ps-heading-anchor" href="#do-this-1" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>}
`I do so out of long habit with C-like syntax, and because when I&rsquo;m teaching this helps me keep more information on the screen. However, some folks prefer this:</p><p>`if ($this -eq $that)
{</p><h1 id="do-this-2" class="ps-heading">do this<a class="ps-heading-anchor" href="#do-this-2" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>}
else
{</p><h1 id="do-this-3" class="ps-heading">do this<a class="ps-heading-anchor" href="#do-this-3" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>}
`Because of my own long habits, I find that hard to read, but it does make it easier to see if your squigglies are lining up properly. It takes up a ton of room, though, and I personally don&rsquo;t follow this as easily as the previous example.<br>
But what&rsquo;s your preference? _Why? _<br>
[boilerplate greatdebate]</p>
]]></content:encoded></item><item><title>Come to PowerShell Summer School!</title><link>https://powershell.org/articles/2013-07-01-come-to-powershell-summer-school/</link><guid>https://powershell.org/articles/2013-07-01-come-to-powershell-summer-school/</guid><pubDate>Mon, 01 Jul 2013 22:11:31 +0000</pubDate><description>&lt;p&gt;Through my company Concentrated Tech, I&amp;rsquo;ve decided to run a set of three &lt;a href="http://itpro.concentratedtech.com/training/summerschool.php"&gt;PowerShell Summer School&lt;/a&gt; classes (click that link for descriptions). These will be a combo of self-study and weekly online sessions, designed to teach Toolmaking, Practical applications of PowerShell, or how to teach PowerShell in a lunch &amp;rsquo;n&amp;rsquo; learn style format. Registration is open from now until August 1st, and you&amp;rsquo;ll also get a discount on some great SAPIEN products to use during class, if you like.&lt;br&gt;
The Toolmaking class will also prepare you for PowerShell VERIFIED EFFECTIVEâ„¢ certification, if you&amp;rsquo;ve been considering that.&lt;br&gt;
Two of the classes will incorporate group code reviews of student assignments, to help improve your style; the third will include mock delivery sessions to help polish your delivery skills. All will include a private Q&amp;amp;A forum where you can ask questions both of me and of your fellow students while you&amp;rsquo;re in the self-stufy phase. Classes will meet online, on Wednesdays, for six weeks through August and September.&lt;br&gt;
Planning a vacation in the middle of summer school? It&amp;rsquo;s fine - we can schedule a make-up online session when you get home. I&amp;rsquo;m also willing to try and make other accommodations to help make this an effective learning experience for everyone.&lt;br&gt;
All of these classes assume a basic level of PowerShell knowledge, although you&amp;rsquo;ll get plenty of review material to help you catch up, or dredge up old memories from when you &lt;em&gt;last&lt;/em&gt; tried to learn the shell.&lt;br&gt;
Tell a friend, tell a colleague - I don&amp;rsquo;t do these kinds of offerings all that often; my travel schedule usually precludes it. But a fortuitous schedule has made it possible, so consider taking advantage!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Through my company Concentrated Tech, I&rsquo;ve decided to run a set of three<a href="http://itpro.concentratedtech.com/training/summerschool.php">PowerShell Summer School</a> classes (click that link for descriptions). These will be a combo of self-study and weekly online sessions, designed to teach Toolmaking, Practical applications of PowerShell, or how to teach PowerShell in a lunch &rsquo;n&rsquo; learn style format. Registration is open from now until August 1st, and you&rsquo;ll also get a discount on some great SAPIEN products to use during class, if you like.<br>
The Toolmaking class will also prepare you for PowerShell VERIFIED EFFECTIVEâ„¢ certification, if you&rsquo;ve been considering that.<br>
Two of the classes will incorporate group code reviews of student assignments, to help improve your style; the third will include mock delivery sessions to help polish your delivery skills. All will include a private Q&amp;A forum where you can ask questions both of me and of your fellow students while you&rsquo;re in the self-stufy phase. Classes will meet online, on Wednesdays, for six weeks through August and September.<br>
Planning a vacation in the middle of summer school? It&rsquo;s fine - we can schedule a make-up online session when you get home. I&rsquo;m also willing to try and make other accommodations to help make this an effective learning experience for everyone.<br>
All of these classes assume a basic level of PowerShell knowledge, although you&rsquo;ll get plenty of review material to help you catch up, or dredge up old memories from when you <em>last</em> tried to learn the shell.<br>
Tell a friend, tell a colleague - I don&rsquo;t do these kinds of offerings all that often; my travel schedule usually precludes it. But a fortuitous schedule has made it possible, so consider taking advantage!</p>
]]></content:encoded></item><item><title>Seeking Editor for PowerShell.org TechLetter</title><link>https://powershell.org/articles/2013-07-01-seeking-editor-for-powershell-org-techletter/</link><guid>https://powershell.org/articles/2013-07-01-seeking-editor-for-powershell-org-techletter/</guid><pubDate>Mon, 01 Jul 2013 18:30:37 +0000</pubDate><description>&lt;p&gt;The PowerShell.org TechLetter goes out once a month, and we&amp;rsquo;re looking for an editor to take over the task of building each monthly issue.&lt;br&gt;
You&amp;rsquo;ll need some basic HTML knowledge, and ideally will have a decent HTML editor. Not FrontPage. You&amp;rsquo;ll be given articles in both HTML and Word format, and will need to insert those into a master HTML document and (especially in the case of Word), fix the formatting. You&amp;rsquo;ll have plenty of examples from past issues to work with. Eventually, you&amp;rsquo;ll also schedule the mid-month mailing.&lt;br&gt;
It all takes a few hours once you have the monthly materials in hand, and you&amp;rsquo;ll usually have at least a week to do assembly and mailing. You&amp;rsquo;ll be helping us deliver technical content to a growing audience of more than 3,500 IT professionals and PowerShell enthusiasts!&lt;br&gt;
If you&amp;rsquo;re interested, &lt;a href="https://powershell.org/contact-us/" title="Contact Us"&gt;contact me&lt;/a&gt;. Your pay will be &lt;em&gt;double&lt;/em&gt; what I&amp;rsquo;m currently paid to do this. Which is, sadly, nothing.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>The PowerShell.org TechLetter goes out once a month, and we&rsquo;re looking for an editor to take over the task of building each monthly issue.<br>
You&rsquo;ll need some basic HTML knowledge, and ideally will have a decent HTML editor. Not FrontPage. You&rsquo;ll be given articles in both HTML and Word format, and will need to insert those into a master HTML document and (especially in the case of Word), fix the formatting. You&rsquo;ll have plenty of examples from past issues to work with. Eventually, you&rsquo;ll also schedule the mid-month mailing.<br>
It all takes a few hours once you have the monthly materials in hand, and you&rsquo;ll usually have at least a week to do assembly and mailing. You&rsquo;ll be helping us deliver technical content to a growing audience of more than 3,500 IT professionals and PowerShell enthusiasts!<br>
If you&rsquo;re interested,<a href="https://powershell.org/contact-us/" title="Contact Us">contact me</a>. Your pay will be <em>double</em> what I&rsquo;m currently paid to do this. Which is, sadly, nothing.</p>
]]></content:encoded></item><item><title>[UPDATE: It's Safe] CAUTION: Don't Run Update-Help Right Now</title><link>https://powershell.org/articles/2013-06-28-caution-dont-run-update-help-right-now/</link><guid>https://powershell.org/articles/2013-06-28-caution-dont-run-update-help-right-now/</guid><pubDate>Fri, 28 Jun 2013 15:19:22 +0000</pubDate><description>&lt;p&gt;&lt;strong&gt;UPDATE 2 JULY 2013: Microsoft is informing MVPs that the fix is in, and new help files should be downloadable by (at latest) the morning of 3 July 2013. So get your Update-Help ready to run. &lt;a href="http://wp.me/p3priC-25s"&gt;More info&lt;/a&gt;.&lt;/strong&gt;&lt;br&gt;
If you haven&amp;rsquo;t recently run Update-Help&amp;hellip; don&amp;rsquo;t. There&amp;rsquo;s a problem with the help files that have been produced recently so that instead of:&lt;br&gt;
**-computername **&lt;br&gt;
You&amp;rsquo;re getting:&lt;br&gt;
&lt;strong&gt;-computername&lt;/strong&gt;&lt;br&gt;
This affects all parameters - no value types will be shown. This has been reported to Microsoft, and they&amp;rsquo;ve acknowledged receipt of that report and are investigating. Personally, I believe the problem may be related to internal-use-only tools that are used to create the syntax section of the help files, so hopefully it&amp;rsquo;ll be an easy fix.&lt;br&gt;
The -full and -detail help still shows the correct information, so if you&amp;rsquo;ve downloaded the borked help files, you&amp;rsquo;re not totally out of luck.&lt;br&gt;
As far as I can determine, this only currently affects core PowerShell cmdlets, not add-in modules from product teams like Exchange, etc. I believe that&amp;rsquo;s because the core cmdlets were just updated and re-published, something the PowerShell team tends to do a bit more frequently than some of the other product groups.&lt;br&gt;
I&amp;rsquo;ll keep you posted as I learn anything new.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p><strong>UPDATE 2 JULY 2013: Microsoft is informing MVPs that the fix is in, and new help files should be downloadable by (at latest) the morning of 3 July 2013. So get your Update-Help ready to run.<a href="http://wp.me/p3priC-25s">More info</a>.</strong><br>
If you haven&rsquo;t recently run Update-Help&hellip; don&rsquo;t. There&rsquo;s a problem with the help files that have been produced recently so that instead of:<br>
**-computername **<br>
You&rsquo;re getting:<br><strong>-computername</strong><br>
This affects all parameters - no value types will be shown. This has been reported to Microsoft, and they&rsquo;ve acknowledged receipt of that report and are investigating. Personally, I believe the problem may be related to internal-use-only tools that are used to create the syntax section of the help files, so hopefully it&rsquo;ll be an easy fix.<br>
The -full and -detail help still shows the correct information, so if you&rsquo;ve downloaded the borked help files, you&rsquo;re not totally out of luck.<br>
As far as I can determine, this only currently affects core PowerShell cmdlets, not add-in modules from product teams like Exchange, etc. I believe that&rsquo;s because the core cmdlets were just updated and re-published, something the PowerShell team tends to do a bit more frequently than some of the other product groups.<br>
I&rsquo;ll keep you posted as I learn anything new.</p>
]]></content:encoded></item><item><title>PowerShell Great Debate: To Accelerate, or Not?</title><link>https://powershell.org/articles/2013-06-25-powershell-great-debate-to-accelerate-or-not/</link><guid>https://powershell.org/articles/2013-06-25-powershell-great-debate-to-accelerate-or-not/</guid><pubDate>Tue, 25 Jun 2013 14:38:57 +0000</pubDate><description>&lt;p&gt;At his &lt;a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/BOF-ITP23"&gt;Birds of a feather session at TechEd 2013&lt;/a&gt;, Glenn Sizemore and I briefly debated something that I&amp;rsquo;d like to make the topic of today&amp;rsquo;s Great Debate. It has to do with how you create new, custom objects. For example, one approach - which I used to favor, but now think is too long-form:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;$obj = New-Object -Type PSObject $obj | Add-Member NoteProperty Foo $bar $obj | Add-Member NoteProperty This $that &lt;/code&gt;We saw some variants in The Scripting Games, including this one:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>At his<a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/BOF-ITP23">Birds of a feather session at TechEd 2013</a>, Glenn Sizemore and I briefly debated something that I&rsquo;d like to make the topic of today&rsquo;s Great Debate. It has to do with how you create new, custom objects. For example, one approach - which I used to favor, but now think is too long-form:</p><p><code>$obj = New-Object -Type PSObject $obj | Add-Member NoteProperty Foo $bar $obj | Add-Member NoteProperty This $that</code>We saw some variants in The Scripting Games, including this one:</p><p><code>$obj = New-Object PSObject Add-Member -InputObject $obj -Name Foo -MemberType NoteProperty -Value $bar</code>I generally don&rsquo;t like any syntax that explicitly uses -InputObject like that; the parameter is designed to catch pipeline input, and using it explicitly strikes me as overly wordy, and doesn&rsquo;t really leverage the shell.<br>
Glenn and I both felt that, these days, a hashtable was the preferred approach:</p><p><code>$props = @{This=$that; Foo=$bar; These=$those}</code>The semicolons are optional when you type the construct that way, but I tend to use them out of habits that come from other languages. The point of our debate was that Glenn would use the hashtable like this:</p><p><code>$obj = [pscustomobject]$props</code>Because he feels it&rsquo;s more concise, and because he puts a high value on quick readability. I personally prefer (and teach) a somewhat longer version:</p><p><code>$obj = New-Object -Type PSObject -Prop $props</code>Because, I argued, type accelerators like [pscustomobject] aren&rsquo;t documented or discoverable. Someone running across your script can&rsquo;t use the shell&rsquo;s help system to figure out WTF is going on; with New-Object, on the other hand, they&rsquo;ve got a help file and examples to rely on.<br>
(BTW, I never worry about ordered hashtables; if I need the output in a specific order, I&rsquo;ll use a custom view, a Format cmdlet, or Select-Object. A developer once explained to me that unordered hashtables are more memory-efficient for .NET, so I go with them).<br>
But the big question on the table here is &ldquo;to use type accelerators, or no?&rdquo; You see this in many instances:</p><p>`[null]Do-Something</p><h1 id="vs" class="ps-heading">vs.<a class="ps-heading-anchor" href="#vs" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>Do-Something | Out-Null
`Same end effect of course, but I&rsquo;ve always argued that the latter is more discoverable, while Glenn (and many others) prefer the brevity of the former.<br>
So we&rsquo;ll make today&rsquo;s Great Debate two-pronged. What approach do you favor for creating custom objects? And, do you tend to prefer type accelerators, or no?<br>
[boilerplate greatdebate]</p>
]]></content:encoded></item><item><title>Pipeline or Script? That is the Question</title><link>https://powershell.org/articles/2013-06-21-pipeline-or-script-that-is-the-question/</link><guid>https://powershell.org/articles/2013-06-21-pipeline-or-script-that-is-the-question/</guid><pubDate>Fri, 21 Jun 2013 17:52:14 +0000</pubDate><description>&lt;p&gt;When I teach PowerShell classes, I often start by assuring students that, with the shell, you can _accomplish a great deal without ever writing a script. _And it&amp;rsquo;s true - you can. Unlike predecessor technologies like VBScript, PowerShell lets you pack a lot of goodness into a one-liner - or even into several lines run manually in the console.&lt;br&gt;
What I never say is _you can accomplish 
anything
without ever writing a script. _That isn&amp;rsquo;t true. I see folks struggle all the time to squeeze something into a one-liner pipeline, when life would be so much easier if they switched a script-style, procedural approach.&lt;br&gt;
So what&amp;rsquo;s the tipping point?&lt;br&gt;
Actually, it&amp;rsquo;s really easy to spot. You should be writing a script if:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>When I teach PowerShell classes, I often start by assuring students that, with the shell, you can _accomplish a great deal without ever writing a script. _And it&rsquo;s true - you can. Unlike predecessor technologies like VBScript, PowerShell lets you pack a lot of goodness into a one-liner - or even into several lines run manually in the console.<br>
What I never say is _you can accomplish 
anything
without ever writing a script. _That isn&rsquo;t true. I see folks struggle all the time to squeeze something into a one-liner pipeline, when life would be so much easier if they switched a script-style, procedural approach.<br>
So what&rsquo;s the tipping point?<br>
Actually, it&rsquo;s really easy to spot. You should be writing a script if:</p><ul><li/></ul><p>You need to take different actions based on some condition, like send an e-mail if there&rsquo;s data to send, but send nothing if there&rsquo;s no data.</p><ul><li>You need to do more than one discrete task. Yeah, you can sometimes jam multiple actions into a one-liner using things like passthrough, but it&rsquo;s not consistently available, and the command becomes dreadfully difficult to read and debug.</li><li>You need to run a command repeatedly over time, and each time some of its values will change (scripts offer declarative parameters).</li></ul><p>Many smart folks <em>start</em> in the console to test a command, and then paste it into a script they&rsquo;re working on (I do that, too). And there are other reasons to switch from &ldquo;running a command in the console&rdquo; to &ldquo;banging out a script in the ISE [or editor of choice].&rdquo; What tips would you offer to a PowerShell newbie to help them get the most from the command-line&hellip; but know when it&rsquo;s time to move into a script-based approach?</p>
]]></content:encoded></item><item><title>PowerShell Great Debate: Capturing Errors</title><link>https://powershell.org/articles/2013-06-17-powershell-great-debate-capturing-errors/</link><guid>https://powershell.org/articles/2013-06-17-powershell-great-debate-capturing-errors/</guid><pubDate>Mon, 17 Jun 2013 14:30:30 +0000</pubDate><description>&lt;p&gt;Hot on the heels of &lt;a href="https://powershell.org/2013/06/11/powershell-great-debate-error-trapping/" title="PowerShell Great Debate: Error Trapping"&gt;our last Great Debate&lt;/a&gt;, let&amp;rsquo;s take the discussion to the next logical step and talk about how you like to capture errors when they occur.&lt;br&gt;
The first technique is to use -ErrorVariable:&lt;/p&gt;
&lt;p&gt;`Try {
Get-WmiObject Win32_BIOS -comp nothing -ea stop -ev mine
} Catch {&lt;/p&gt;
&lt;h1 id="use-mine-for-error" class="ps-heading"&gt;use $mine for error&lt;a class="ps-heading-anchor" href="#use-mine-for-error" 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;/h1&gt;
&lt;p&gt;}
`Another is to use the $Error collection:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Hot on the heels of<a href="https://powershell.org/2013/06/11/powershell-great-debate-error-trapping/" title="PowerShell Great Debate: Error Trapping">our last Great Debate</a>, let&rsquo;s take the discussion to the next logical step and talk about how you like to capture errors when they occur.<br>
The first technique is to use -ErrorVariable:</p><p>`Try {
Get-WmiObject Win32_BIOS -comp nothing -ea stop -ev mine
} Catch {</p><h1 id="use-mine-for-error" class="ps-heading">use $mine for error<a class="ps-heading-anchor" href="#use-mine-for-error" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>}
`Another is to use the $Error collection:</p><p>`Try {
Get-WmiObject Win32_BIOS -comp badname -ea stop
} Catch {</p><h1 id="use-error0" class="ps-heading">use $error[0]<a class="ps-heading-anchor" href="#use-error0" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>}
`And a third is to use $_:</p><p>`Try {
Get-WmiObject Win32_BIOS -comp snoopy -ea stop
} Catch {</p><h1 id="use-_" class="ps-heading">use $_<a class="ps-heading-anchor" href="#use-_" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>}
`Personally, I&rsquo;ve always disliked the last approach, because people don&rsquo;t realize that in some situations $_ can get &ldquo;hijacked.&rdquo; For example:</p><p><code>Get-Content names.txt | ForEach-Object { Try { Get-WmiObject Win32_BIOS -Comp $_ -EA Stop } Catch { # is $_ an error or a computer name? } }</code>Now, I&rsquo;m a big not-fan of using pipelines like this in a script, but that&rsquo;s another debate (it&rsquo;s on my list). The point is really that I can&rsquo;t universally, 100% rely on $<em>&hellip; and when someone uses $</em> without realizing what&rsquo;s happening, they back themselves into a tricky corner that&rsquo;s difficult to diagnose. Since my big focus is on learning and teaching, I tend to want to teach techniques that are universal and always work the same way.<br>
That said, $error[0] and the -ErrorVariable (-EV) technique return slightly different objects, meaning you have to work with them somewhat differently.<br>
So what&rsquo;s your preference? Why? Which of these don&rsquo;t you like so much&hellip; and why?<br>
[boilerplate greatdebate]</p>
]]></content:encoded></item><item><title>Charlotte User Group July Meeting</title><link>https://powershell.org/articles/2013-06-12-charlotte-user-group-july-meeting/</link><guid>https://powershell.org/articles/2013-06-12-charlotte-user-group-july-meeting/</guid><pubDate>Thu, 13 Jun 2013 02:24:30 +0000</pubDate><description>&lt;p&gt;Please join us on a special date in July. This month our meeting will be on July 11, 2013 instead of our normal first Thursday of the month due to the holiday.&lt;br&gt;
Microsoft Scripting Guy Ed Wilson will make a presentation on DSC Desired State Configuration for PowerShell V4.&lt;br&gt;
Sign up at the following link in Meetup so we know how many will be there and we can have adequate food for all.&lt;br&gt;
&lt;a href="http://www.meetup.com/Charlotte-PowerShell-Users-Group/events/124356442/"&gt;http://www.meetup.com/Charlotte-PowerShell-Users-Group/events/124356442/&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Please join us on a special date in July. This month our meeting will be on July 11, 2013 instead of our normal first Thursday of the month due to the holiday.<br>
Microsoft Scripting Guy Ed Wilson will make a presentation on DSC Desired State Configuration for PowerShell V4.<br>
Sign up at the following link in Meetup so we know how many will be there and we can have adequate food for all.<br><a href="http://www.meetup.com/Charlotte-PowerShell-Users-Group/events/124356442/">http://www.meetup.com/Charlotte-PowerShell-Users-Group/events/124356442/</a></p>
]]></content:encoded></item><item><title>PowerShell Great Debate: Error Trapping</title><link>https://powershell.org/articles/2013-06-11-powershell-great-debate-error-trapping/</link><guid>https://powershell.org/articles/2013-06-11-powershell-great-debate-error-trapping/</guid><pubDate>Tue, 11 Jun 2013 21:17:36 +0000</pubDate><description>&lt;p&gt;In the aftermath of The Scripting Games, it&amp;rsquo;s clear we need to have several community discussions - thus, I present to you, The Great Debates. These will be a series of posts wherein I&amp;rsquo;ll outline the basic situation, and you&amp;rsquo;re encouraged to debate and discuss in the comments section.&lt;br&gt;
The general gist is that, during the Games, we saw different people voting &amp;ldquo;up&amp;rdquo; and &amp;ldquo;down&amp;rdquo; for the exact same techniques. So&amp;hellip; which one is right? Neither! But all approaches have pros and cons&amp;hellip; so that&amp;rsquo;s what we&amp;rsquo;ll discuss and debate. In the end, I&amp;rsquo;ll take the discussion into a community-owned (free) ebook on patterns and practices for PowerShell.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>In the aftermath of The Scripting Games, it&rsquo;s clear we need to have several community discussions - thus, I present to you, The Great Debates. These will be a series of posts wherein I&rsquo;ll outline the basic situation, and you&rsquo;re encouraged to debate and discuss in the comments section.<br>
The general gist is that, during the Games, we saw different people voting &ldquo;up&rdquo; and &ldquo;down&rdquo; for the exact same techniques. So&hellip; which one is right? Neither! But all approaches have pros and cons&hellip; so that&rsquo;s what we&rsquo;ll discuss and debate. In the end, I&rsquo;ll take the discussion into a community-owned (free) ebook on patterns and practices for PowerShell.</p><h2 id="todays-debate-error-trapping" class="ps-heading">Today&rsquo;s Debate: Error Trapping<a class="ps-heading-anchor" href="#todays-debate-error-trapping" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>There are a few different approaches folks take to trapping an error (I&rsquo;m not discussing <em>capturing</em> the error, just knowing that one occurred).<br>
Hopefully the Trap construct is familiar to everyone; I&rsquo;ve always believed it&rsquo;s awkward and outdated. The product team has said as much; it was just the best they could do in v1 given time constraints. Its use of scope makes it especially tricky sometimes.<br>
Try&hellip;Catch&hellip;Finally seems to be what a lot of people prefer. It&rsquo;s procedural and structured, and it works against any terminating exception. You do have to remember to make errors into terminating exceptions (<strong>-EA Stop</strong> on a cmdlet, for example), but it&rsquo;s a very programmatic approach.<br>
I see folks sometimes use $?:</p><p>`Do-Something
If ($?) {</p><h1 id="deal-with-it" class="ps-heading">deal with it<a class="ps-heading-anchor" href="#deal-with-it" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>}
`A &ldquo;con&rdquo; of this approach is that $? doesn&rsquo;t indicate an error. It indicates whether or not _the previous command 
thinks
it completed successfully. _It&rsquo;s reliable with <em>most</em> cmdlets - but I&rsquo;ve seen it fail for a lot of external utilities. Given that it isn&rsquo;t 100% reliable as an indicator, I tend to shy away from it. I&rsquo;d rather learn one way that always works, and that&rsquo;s been Try/Catch for me.<br>
Try/Catch also makes it easy to catch different exceptions differently. I don&rsquo;t always need to do so&hellip; but again, I&rsquo;d rather learn <em>one</em> way to do things that <em>always</em> works and provides more flexibility. I don&rsquo;t want to use $? sometimes, and then use something else other times, because that&rsquo;s more to remember, teach, learn, etc.<br>
Some folks will do an <strong>$error.clear()</strong>, clearing the error collection, and then run a command. They&rsquo;ll then check <strong>$error.count</strong> to see if it&rsquo;s nonzero. I don&rsquo;t like that as much because it looks messy to me, and again - it doesn&rsquo;t let me easily handle different exceptions as easily as Try/Catch.<br>
Ok&hellip; your thoughts?</p><p>[boilerplate greatdebate]</p>
]]></content:encoded></item><item><title>Overall Winners of the Scripting Games</title><link>https://powershell.org/articles/2013-06-11-overall-winners-of-the-scripting-games/</link><guid>https://powershell.org/articles/2013-06-11-overall-winners-of-the-scripting-games/</guid><pubDate>Tue, 11 Jun 2013 14:24:22 +0000</pubDate><description>&lt;p&gt;**Congratulations to our top winners, **determined by our expert judges (and in this case we also considered their CrowdScores), &lt;strong&gt;mikefrobbins&lt;/strong&gt; and &lt;strong&gt;taygibb&lt;/strong&gt;, who have just won a free pass to Microsoft TechEd Europe or Microsoft TechEd North America 2014. Instructions are in your profile for claiming your prize. It is transferrable, but must be claimed/transferred by the end of July.&lt;br&gt;
&lt;strong&gt;Congratulations to our top voters/commenters&lt;/strong&gt;, Klaus_Schulte and Poshsg0606. They were chosen randomly for this award, although I did review their comments and scores to ensure they were all meaningful and consistent. They&amp;rsquo;ve won free passes to the PowerShell Summit North America 2014; these are transferrable and must be claimed/transferred by the end of July.&lt;br&gt;
Thanks to everyone who participated in The Scripting Games this year. We&amp;rsquo;ve received a lot of feedback from you, and very much appreciate the time and spirit you spent to offer it. We&amp;rsquo;re taking it all into consideration for our next event.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>**Congratulations to our top winners, **determined by our expert judges (and in this case we also considered their CrowdScores), <strong>mikefrobbins</strong> and <strong>taygibb</strong>, who have just won a free pass to Microsoft TechEd Europe or Microsoft TechEd North America 2014. Instructions are in your profile for claiming your prize. It is transferrable, but must be claimed/transferred by the end of July.<br><strong>Congratulations to our top voters/commenters</strong>, Klaus_Schulte and Poshsg0606. They were chosen randomly for this award, although I did review their comments and scores to ensure they were all meaningful and consistent. They&rsquo;ve won free passes to the PowerShell Summit North America 2014; these are transferrable and must be claimed/transferred by the end of July.<br>
Thanks to everyone who participated in The Scripting Games this year. We&rsquo;ve received a lot of feedback from you, and very much appreciate the time and spirit you spent to offer it. We&rsquo;re taking it all into consideration for our next event.</p>
]]></content:encoded></item><item><title>Scripting Games Event 6 Winners</title><link>https://powershell.org/articles/2013-06-11-scripting-games-event-5-winners-1/</link><guid>https://powershell.org/articles/2013-06-11-scripting-games-event-5-winners-1/</guid><pubDate>Tue, 11 Jun 2013 14:17:31 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;re pleased to announce the winners for Event 6 of The Scripting Games 2013!&lt;br&gt;
Winners: You can log into &lt;a href="http://scriptinggames.org/"&gt;The Scripting Games Web site&lt;/a&gt; and go to your Profile page to see your prize. You will be given a prize redemption code and either a URL where you can redeem it, or an e-mail address of the prize provider (they will need the redemption code). All prizes must be claimed by the end of July 2013. I will list winners by username; if you used your e-mail address as your username, then a portion of that will be truncated for your privacy. Anyone can log in and check their Profile page to see if they&amp;rsquo;ve won a prize.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;re pleased to announce the winners for Event 6 of The Scripting Games 2013!<br>
Winners: You can log into<a href="http://scriptinggames.org/">The Scripting Games Web site</a> and go to your Profile page to see your prize. You will be given a prize redemption code and either a URL where you can redeem it, or an e-mail address of the prize provider (they will need the redemption code). All prizes must be claimed by the end of July 2013. I will list winners by username; if you used your e-mail address as your username, then a portion of that will be truncated for your privacy. Anyone can log in and check their Profile page to see if they&rsquo;ve won a prize.</p><ul><li><p>Event 6 Beginner First Place: chanced (free ebook from Manning<strong>and a copy of SAPIEN Software Suite!</strong>)</p></li><li><p>Event 6 Beginner Second Place: marches (6 months video training from Interface<strong>and a copy of SAPIEN PrimalScript!</strong>)</p></li><li><p>Event 6 Beginner Third Place: jb.lewis (1 year of Phoneominal from Start-Automating)</p></li><li><p>Event 6 Advanced First Place: mikefrobbins (free ebook from Manning<strong>and a copy of SAPIEN Software Suite!</strong>)</p></li><li><p>Event 6 Advanced Second Place: DaveGarnar (6 months video training from Interface<strong>and a copy of SAPIEN PrimalScript!</strong>)</p></li><li><p>Event 6 Advanced Third Place: Alexy (1 year of Phonenominal from Start-Automating)</p></li><li><p>Event 6 Beginner Top CrowdScore: taygibb (free ebook from Manning)</p></li><li><p>Event 6 Advanced Top CrowdScore: CarloM (free ebook from Manning)</p></li></ul><p>These will be listed on our<a href="http://scriptinggames.org/winners.php">consolidated list of winners</a>, which includes links to the winning entries.<br>
Our CrowdScore winners get a selection of free ebooks from Manning, 1 month of video training from Interface, and $50 gift cards from SAPIEN; 1 prize per winner. Check your profile to see if you&rsquo;ve won!<br>
Congratulations to all of our winners! Note that our top three prizes in each category were awarded by our Mighty Panel of Celebrity Judges. Each judge nominated a first, second, and third place winner from the entries that our expert commentators identified as &ldquo;best.&rdquo; Those nominations were compiled, and in the event of a tie the earliest entry was deemed winner.</p>
]]></content:encoded></item><item><title>Call for Debates!</title><link>https://powershell.org/articles/2013-06-10-call-for-debates/</link><guid>https://powershell.org/articles/2013-06-10-call-for-debates/</guid><pubDate>Mon, 10 Jun 2013 14:20:00 +0000</pubDate><description>&lt;p&gt;As the Scripting Games begin to wind down, I know that we&amp;rsquo;ve come across a number of divergent opinions, especially in the comments. &amp;ldquo;You shouldn&amp;rsquo;t use .NET classes!&amp;rdquo; says one comment, &amp;ldquo;you should have done this with a .NET class&amp;rdquo; says another comment _in the same entry. _Fun. It&amp;rsquo;s great to see those differences - but it&amp;rsquo;d be better to &lt;em&gt;discuss&lt;/em&gt; them.&lt;br&gt;
So I&amp;rsquo;m asking everyone in the Games: Go through your comments on all of your entries. Find comments that you disagree with - but that you could possibly see someone making an argument for (and that you&amp;rsquo;d perhaps argue against). Post those here as a comment, or email me (there&amp;rsquo;s a contact form on the Site Info tab). I want to collect these, and start a series of discussions where we can, jointly, start to hammer out some patterns and practices that we, as a community, feel work well. Some of those may have exceptions (rules always do) - &amp;ldquo;never use a .NET class _when there&amp;rsquo;s a cmdlet that can do the same thing, _but otherwise go nuts&amp;rdquo; is one example.&lt;br&gt;
Fire away. For now, you don&amp;rsquo;t need to put your argument for or against - I&amp;rsquo;m just collecting the topics that we&amp;rsquo;ve seen disagreement or differing opinions on. Discussion will follow!&lt;br&gt;
The result of this will be a community-guided Best Practices ebook, which I&amp;rsquo;ll assemble and we&amp;rsquo;ll give away for free. I might even build that, initially, as a wiki, so that folks could contribute to it over time. Will see - that&amp;rsquo;s a bit of extra software.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>As the Scripting Games begin to wind down, I know that we&rsquo;ve come across a number of divergent opinions, especially in the comments. &ldquo;You shouldn&rsquo;t use .NET classes!&rdquo; says one comment, &ldquo;you should have done this with a .NET class&rdquo; says another comment _in the same entry. _Fun. It&rsquo;s great to see those differences - but it&rsquo;d be better to <em>discuss</em> them.<br>
So I&rsquo;m asking everyone in the Games: Go through your comments on all of your entries. Find comments that you disagree with - but that you could possibly see someone making an argument for (and that you&rsquo;d perhaps argue against). Post those here as a comment, or email me (there&rsquo;s a contact form on the Site Info tab). I want to collect these, and start a series of discussions where we can, jointly, start to hammer out some patterns and practices that we, as a community, feel work well. Some of those may have exceptions (rules always do) - &ldquo;never use a .NET class _when there&rsquo;s a cmdlet that can do the same thing, _but otherwise go nuts&rdquo; is one example.<br>
Fire away. For now, you don&rsquo;t need to put your argument for or against - I&rsquo;m just collecting the topics that we&rsquo;ve seen disagreement or differing opinions on. Discussion will follow!<br>
The result of this will be a community-guided Best Practices ebook, which I&rsquo;ll assemble and we&rsquo;ll give away for free. I might even build that, initially, as a wiki, so that folks could contribute to it over time. Will see - that&rsquo;s a bit of extra software.</p>
]]></content:encoded></item><item><title>Scripting Games 2013: Event 6 Notes</title><link>https://powershell.org/articles/2013-06-09-scripting-games-2013-event-6-notes/</link><guid>https://powershell.org/articles/2013-06-09-scripting-games-2013-event-6-notes/</guid><pubDate>Mon, 10 Jun 2013 02:43:58 +0000</pubDate><description>&lt;p&gt;We have finally hit the final event of the 2013 Scripting Games! The past 6 weeks have given us many amazing scripts and some that were in need of extra work. Regardless, for those of you who have finished all 6 scripts in your respective, I say Congratulations! You have hit the finish line sprinting hard to the end! Now you can sit back and know that you made it and have learned (hopefully) some great things along the way. Remember, not only have you learned some new techniques, but also the techniques that you have used have taught others how to write better scripts!&lt;br&gt;
Check out the rest of my notes on my &lt;a href="http://learn-powershell.net/2013/06/09/scripting-games-2013-event-6-notes/"&gt;blog here&lt;/a&gt;!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We have finally hit the final event of the 2013 Scripting Games! The past 6 weeks have given us many amazing scripts and some that were in need of extra work. Regardless, for those of you who have finished all 6 scripts in your respective, I say Congratulations! You have hit the finish line sprinting hard to the end! Now you can sit back and know that you made it and have learned (hopefully) some great things along the way. Remember, not only have you learned some new techniques, but also the techniques that you have used have taught others how to write better scripts!<br>
Check out the rest of my notes on my<a href="http://learn-powershell.net/2013/06/09/scripting-games-2013-event-6-notes/">blog here</a>!</p>
]]></content:encoded></item><item><title>Event 6 Judge's Notes from Jan Egil Ring</title><link>https://powershell.org/articles/2013-06-08-event-6-judges-notes-from-jan-egil-ring/</link><guid>https://powershell.org/articles/2013-06-08-event-6-judges-notes-from-jan-egil-ring/</guid><pubDate>Sun, 09 Jun 2013 01:25:00 +0000</pubDate><description>&lt;p&gt;&lt;a href="http://blog.powershell.no/2013/06/08/2013-scripting-games-learning-points-from-event-6/"&gt;http://blog.powershell.no/2013/06/08/2013-scripting-games-learning-points-from-event-6/&lt;/a&gt; has Jan Egil&amp;rsquo;s thoughts on the final event.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p><a href="http://blog.powershell.no/2013/06/08/2013-scripting-games-learning-points-from-event-6/">http://blog.powershell.no/2013/06/08/2013-scripting-games-learning-points-from-event-6/</a> has Jan Egil&rsquo;s thoughts on the final event.</p>
]]></content:encoded></item><item><title>Last events: my notes and scripts.</title><link>https://powershell.org/articles/2013-06-08-last-events-my-notes-and-scripts/</link><guid>https://powershell.org/articles/2013-06-08-last-events-my-notes-and-scripts/</guid><pubDate>Sat, 08 Jun 2013 20:46:30 +0000</pubDate><description>&lt;p&gt;Oops! Looks like I totally forgot about posting what I did over here. Sorry!&lt;br&gt;
In order of appearance:&lt;br&gt;
&lt;a href="http://becomelotr.wordpress.com/2013/05/28/event-5-my-way/"&gt;Event 5 - script&lt;/a&gt;&lt;br&gt;
&lt;a href="http://becomelotr.wordpress.com/2013/06/02/event-5-my-notes/"&gt;Event 5 - notes&lt;/a&gt;&lt;br&gt;
&lt;a href="http://becomelotr.wordpress.com/2013/06/05/event-6-my-way/"&gt;Event 6 - script&lt;/a&gt;&lt;br&gt;
&lt;a href="http://becomelotr.wordpress.com/2013/06/08/event-6-my-notes/"&gt;Event 6 - notes&lt;/a&gt;&lt;br&gt;
This is last event, and I would like to thank everybody who took part in this games. Thank you guys for great ideas, inspiration, feedback&amp;hellip; It was really educational experience for me (as it was in the past), and I hope it was educational for you too. And - congratulations for all the winners. 🙂&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Oops! Looks like I totally forgot about posting what I did over here. Sorry!<br>
In order of appearance:<br><a href="http://becomelotr.wordpress.com/2013/05/28/event-5-my-way/">Event 5 - script</a><br><a href="http://becomelotr.wordpress.com/2013/06/02/event-5-my-notes/">Event 5 - notes</a><br><a href="http://becomelotr.wordpress.com/2013/06/05/event-6-my-way/">Event 6 - script</a><br><a href="http://becomelotr.wordpress.com/2013/06/08/event-6-my-notes/">Event 6 - notes</a><br>
This is last event, and I would like to thank everybody who took part in this games. Thank you guys for great ideas, inspiration, feedback&hellip; It was really educational experience for me (as it was in the past), and I hope it was educational for you too. And - congratulations for all the winners. 🙂</p>
]]></content:encoded></item><item><title>Notes for Event 6</title><link>https://powershell.org/articles/2013-06-07-notes-for-event-6/</link><guid>https://powershell.org/articles/2013-06-07-notes-for-event-6/</guid><pubDate>Fri, 07 Jun 2013 13:26:41 +0000</pubDate><description>&lt;p&gt;When I read the instructions for event 6, I thought that here&amp;rsquo;s a tough one. A lot of competitors won&amp;rsquo;t have access to a test environment with Windows Server 2012 and Virtual Machines that they can actually work with. So, I expected that many of the entries wouldn&amp;rsquo;t get tested and intended to forgive minor errors that would have shown up in testing.&lt;br&gt;
Well, there was one thing that really surprised me. The instructions were quite clear about minimizing &amp;ldquo;Are You Sure&amp;rdquo; queries to the user, but you can count on one hand the number of entries that included &lt;em&gt;-Confirm:$false&lt;/em&gt;. This is just an example of why it&amp;rsquo;s so important to read the problem statement very carefully and extract the solution requirements. Then, after creating the solution, go back and verify that the requirements have all been met. Many of the entries called out this requirement in the comments, but then didn&amp;rsquo;t account for it in the script.&lt;br&gt;
I had mentioned in a previous blog entry that, particularly in the advanced entries, the author was working too hard. Sometimes this means putting more emphasis on &amp;ldquo;completeness&amp;rdquo; than in solving the problem. Here&amp;rsquo;s an example of a wasted effort. A few entries used the &lt;em&gt;[ValidateNotNullOrEmpty()]&lt;/em&gt; test for a possible alternate to the default value for &amp;ldquo;Server&amp;rdquo;.  Because there is a default value for the parameter, it won&amp;rsquo;t be null or empty making this test unnecessary. Here, give this a try:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>When I read the instructions for event 6, I thought that here&rsquo;s a tough one. A lot of competitors won&rsquo;t have access to a test environment with Windows Server 2012 and Virtual Machines that they can actually work with. So, I expected that many of the entries wouldn&rsquo;t get tested and intended to forgive minor errors that would have shown up in testing.<br>
Well, there was one thing that really surprised me. The instructions were quite clear about minimizing &ldquo;Are You Sure&rdquo; queries to the user, but you can count on one hand the number of entries that included<em>-Confirm:$false</em>. This is just an example of why it&rsquo;s so important to read the problem statement very carefully and extract the solution requirements. Then, after creating the solution, go back and verify that the requirements have all been met. Many of the entries called out this requirement in the comments, but then didn&rsquo;t account for it in the script.<br>
I had mentioned in a previous blog entry that, particularly in the advanced entries, the author was working too hard. Sometimes this means putting more emphasis on &ldquo;completeness&rdquo; than in solving the problem. Here&rsquo;s an example of a wasted effort. A few entries used the<em>[ValidateNotNullOrEmpty()]</em> test for a possible alternate to the default value for &ldquo;Server&rdquo;.  Because there is a default value for the parameter, it won&rsquo;t be null or empty making this test unnecessary. Here, give this a try:</p><p><code>function Test-NullOrEmpty { [CmdletBinding()] Param ( [ValidateNotNullOrEmpty()] $Name = "Server" ) "Got $Name" } Test-NullOrEmpty</code>Note that calling the function without a named parameter just assigns the default value. In order to make it fail you have to deliberately call the function with an empty value (<em>Test-NullOrEmpty -Name</em>), which is not going to happen in the real world.<br>
I know that these are just nit-picking &ndash; and if these are examples of the nits in the Event 6 entries, then CONGRATULATIONS!! y&rsquo;all did a mighty fine job of solving the problem. Calling out these issues is just intended as a learning opportunity. There are lots and lots of correct ways to write PowerShell solutions, it&rsquo;s just that some are more efficient or take less typing than others. And learning about them is one of the important results of participating in the games.<br>
Thanks to all of you for your efforts!</p>
]]></content:encoded></item><item><title>More PowerShell v4 and DSC Details</title><link>https://powershell.org/articles/2013-06-05-more-powershell-v4-and-dsc-details/</link><guid>https://powershell.org/articles/2013-06-05-more-powershell-v4-and-dsc-details/</guid><pubDate>Wed, 05 Jun 2013 14:22:01 +0000</pubDate><description>&lt;p&gt;Here&amp;rsquo;s what I know, much &lt;a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/MDC-B400#fbid=8yK1U1eJ0GQ"&gt;based on a TechEd talk this week:&lt;/a&gt;&lt;br&gt;
We can expect PowerShell v4 to ship in the Windows Management Framework, as with previous versions. It will be preinstalled on Windows Server 2012 R2 and what they&amp;rsquo;re calling Windows 8.1; the default execution policy will be RemoteSigned, and on the server OS Remoting will be enabled by default. Microsoft&amp;rsquo;s past policy has been &amp;ldquo;current version and two back,&amp;rdquo; and if they follow that then we&amp;rsquo;ll get WMF 4.0 on Windows 7, Windows Server 2008 R2, and later. That would leave out Server 2008, if in fact they follow that same policy.&lt;br&gt;
DSC itself starts with a PowerShell script that&amp;rsquo;s mainly declarative code: Make sure x is installed, make sure y isn&amp;rsquo;t installed, etc. PowerShell compiles that into a MOF, which can be transmitted to managed endpoints (computers). The built-in mechanisms for deployment aren&amp;rsquo;t as complex or flexible as GPO or SCCM targeting, but you could use either GPO or SCCM to deploy those MOFs. That&amp;rsquo;s the &amp;ldquo;push&amp;rdquo; model - you push MOFs out to managed nodes. A &amp;ldquo;pull&amp;rdquo; model requires you to configure managed nodes to have a URI and UDDI, and they check that URI for their MOFs.&lt;br&gt;
DSC runs every 15 minutes or every 30 minutes by default, depending on whether you&amp;rsquo;re using push or pull, and you can configure that time. Right now there&amp;rsquo;s no feedback or reporting - it&amp;rsquo;s a bit like GPO, where you push out the setting and it enforces it, but that&amp;rsquo;s it.&lt;br&gt;
When DSC runs, it takes your &amp;ldquo;desired state&amp;rdquo; MOFs and starts running &amp;ldquo;DSC resources.&amp;rdquo; These resources are special modules that implement a predefined set of functions - a Get, a Test, and a Set function, to be specific. I expect MS product groups to provide these - the Exchange team will likely someday provide resources that can check/set Exchange settings, for example. You can also write your own modules. DSC calls the &amp;ldquo;test&amp;rdquo; to see if your setting is or isn&amp;rsquo;t configured at that time; it calls the &amp;ldquo;set&amp;rdquo; to add/remove/whatever the setting. So the real work is done by these special modules - and those modules can do whatever they want. Write to the registry, run commands, call .NET classes, &lt;em&gt;anything.&lt;/em&gt;&lt;br&gt;
So there&amp;rsquo;s two scripts: The &amp;ldquo;desired state&amp;rdquo; script that gets compiled to a MOF (so you shouldn&amp;rsquo;t ever have to mess directly with MOFs yourself), and the &amp;ldquo;implementing module&amp;rdquo; that has the three special functions which actually do all the work.&lt;br&gt;
In the &amp;ldquo;pull&amp;rdquo; model, those special modules can be dynamically downloaded by a managed node. &amp;ldquo;Hey, I grabbed this desired state MOF, and it seems to require 12 modules, so I&amp;rsquo;ll go to the same URI and look for those 12 modules.&amp;rdquo; You provide those modules as ZIPs, and PowerShell can grab the ZIP, expand it into the proper location, and then run the modules as needed.&lt;br&gt;
Personal analysis (meaning this is my opinion, not something MS has said): I can see this DSC feature integrating super-well with some future version of SCCM. DSC writes out some local file with configuration details, and the SCCM client grabs it and feeds it up to the database. Those MOFs could potentially be pulled from a Distribution Point by the client, handed off to PowerShell, and run on a scheduled basis. I can also see DSC starting to supplant GPO in a lot of ways. After all, &lt;em&gt;most&lt;/em&gt; GPO stuff is just reg hacks in a special section of the registry; there&amp;rsquo;s no reason DSC couldn&amp;rsquo;t do that - and it does it on a more frequent basis, making it more reliable. Right now, the targeting of a MOF isn&amp;rsquo;t as flexible as GPO targeting&amp;hellip; but that could obviously evolve. Until more of the architectural details emerge, we won&amp;rsquo;t know for sure&amp;hellip; and this is of course a v1 feature that will doubtless be expanded on and invested in as the team moves forward. We do know that the first release of DSC will not have a lot of those underlying &amp;ldquo;resource modules,&amp;rdquo; which means you won&amp;rsquo;t actually be able to configure much. This is a feature the team needs to put in place so that folks can start building those things&amp;hellip; so this is going to take a cycle or two to start being really useful.&lt;br&gt;
There&amp;rsquo;s obviously still a lot under wraps here, and this is all subject to change and tweaking as the team moves toward release. We&amp;rsquo;re told there will be some kind of public preview - but they haven&amp;rsquo;t announced a date on that. Personally, with the Build conference coming up, we can imagine that Microsoft will try and have a preview release ready for that show. There&amp;rsquo;s also no announcement of ship date. It&amp;rsquo;s still too early to tell, and I want to emphasize that the company hasn&amp;rsquo;t announced &lt;em&gt;any&lt;/em&gt; dates. We can but try to make educated guesses at this stage.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Here&rsquo;s what I know, much<a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/MDC-B400#fbid=8yK1U1eJ0GQ">based on a TechEd talk this week:</a><br>
We can expect PowerShell v4 to ship in the Windows Management Framework, as with previous versions. It will be preinstalled on Windows Server 2012 R2 and what they&rsquo;re calling Windows 8.1; the default execution policy will be RemoteSigned, and on the server OS Remoting will be enabled by default. Microsoft&rsquo;s past policy has been &ldquo;current version and two back,&rdquo; and if they follow that then we&rsquo;ll get WMF 4.0 on Windows 7, Windows Server 2008 R2, and later. That would leave out Server 2008, if in fact they follow that same policy.<br>
DSC itself starts with a PowerShell script that&rsquo;s mainly declarative code: Make sure x is installed, make sure y isn&rsquo;t installed, etc. PowerShell compiles that into a MOF, which can be transmitted to managed endpoints (computers). The built-in mechanisms for deployment aren&rsquo;t as complex or flexible as GPO or SCCM targeting, but you could use either GPO or SCCM to deploy those MOFs. That&rsquo;s the &ldquo;push&rdquo; model - you push MOFs out to managed nodes. A &ldquo;pull&rdquo; model requires you to configure managed nodes to have a URI and UDDI, and they check that URI for their MOFs.<br>
DSC runs every 15 minutes or every 30 minutes by default, depending on whether you&rsquo;re using push or pull, and you can configure that time. Right now there&rsquo;s no feedback or reporting - it&rsquo;s a bit like GPO, where you push out the setting and it enforces it, but that&rsquo;s it.<br>
When DSC runs, it takes your &ldquo;desired state&rdquo; MOFs and starts running &ldquo;DSC resources.&rdquo; These resources are special modules that implement a predefined set of functions - a Get, a Test, and a Set function, to be specific. I expect MS product groups to provide these - the Exchange team will likely someday provide resources that can check/set Exchange settings, for example. You can also write your own modules. DSC calls the &ldquo;test&rdquo; to see if your setting is or isn&rsquo;t configured at that time; it calls the &ldquo;set&rdquo; to add/remove/whatever the setting. So the real work is done by these special modules - and those modules can do whatever they want. Write to the registry, run commands, call .NET classes,<em>anything.</em><br>
So there&rsquo;s two scripts: The &ldquo;desired state&rdquo; script that gets compiled to a MOF (so you shouldn&rsquo;t ever have to mess directly with MOFs yourself), and the &ldquo;implementing module&rdquo; that has the three special functions which actually do all the work.<br>
In the &ldquo;pull&rdquo; model, those special modules can be dynamically downloaded by a managed node. &ldquo;Hey, I grabbed this desired state MOF, and it seems to require 12 modules, so I&rsquo;ll go to the same URI and look for those 12 modules.&rdquo; You provide those modules as ZIPs, and PowerShell can grab the ZIP, expand it into the proper location, and then run the modules as needed.<br>
Personal analysis (meaning this is my opinion, not something MS has said): I can see this DSC feature integrating super-well with some future version of SCCM. DSC writes out some local file with configuration details, and the SCCM client grabs it and feeds it up to the database. Those MOFs could potentially be pulled from a Distribution Point by the client, handed off to PowerShell, and run on a scheduled basis. I can also see DSC starting to supplant GPO in a lot of ways. After all,<em>most</em> GPO stuff is just reg hacks in a special section of the registry; there&rsquo;s no reason DSC couldn&rsquo;t do that - and it does it on a more frequent basis, making it more reliable. Right now, the targeting of a MOF isn&rsquo;t as flexible as GPO targeting&hellip; but that could obviously evolve. Until more of the architectural details emerge, we won&rsquo;t know for sure&hellip; and this is of course a v1 feature that will doubtless be expanded on and invested in as the team moves forward. We do know that the first release of DSC will not have a lot of those underlying &ldquo;resource modules,&rdquo; which means you won&rsquo;t actually be able to configure much. This is a feature the team needs to put in place so that folks can start building those things&hellip; so this is going to take a cycle or two to start being really useful.<br>
There&rsquo;s obviously still a lot under wraps here, and this is all subject to change and tweaking as the team moves toward release. We&rsquo;re told there will be some kind of public preview - but they haven&rsquo;t announced a date on that. Personally, with the Build conference coming up, we can imagine that Microsoft will try and have a preview release ready for that show. There&rsquo;s also no announcement of ship date. It&rsquo;s still too early to tell, and I want to emphasize that the company hasn&rsquo;t announced<em>any</em> dates. We can but try to make educated guesses at this stage.</p>
]]></content:encoded></item><item><title>Scripting Games Event 5 Winners</title><link>https://powershell.org/articles/2013-06-04-scripting-games-event-5-winners/</link><guid>https://powershell.org/articles/2013-06-04-scripting-games-event-5-winners/</guid><pubDate>Tue, 04 Jun 2013 14:08:44 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;re pleased to announce the winners for Event 5 of The Scripting Games 2013!&lt;br&gt;
Remember that Event 6 is now open for community voting, and that Event 6 opens up near the end of this week. That&amp;rsquo;ll be your last chance to contribute, and shortly after TechEd we&amp;rsquo;ll announce the overall winners. Good luck!&lt;br&gt;
Winners: You can log into &lt;a href="http://scriptinggames.org/"&gt;The Scripting Games Web site&lt;/a&gt; and go to your Profile page to see your prize. You will be given a prize redemption code and either a URL where you can redeem it, or an e-mail address of the prize provider (they will need the redemption code). All prizes must be claimed by the end of July 2013. I will list winners by username; if you used your e-mail address as your username, then a portion of that will be truncated for your privacy. Anyone can log in and check their Profile page to see if they&amp;rsquo;ve won a prize.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;re pleased to announce the winners for Event 5 of The Scripting Games 2013!<br>
Remember that Event 6 is now open for community voting, and that Event 6 opens up near the end of this week. That&rsquo;ll be your last chance to contribute, and shortly after TechEd we&rsquo;ll announce the overall winners. Good luck!<br>
Winners: You can log into<a href="http://scriptinggames.org/">The Scripting Games Web site</a> and go to your Profile page to see your prize. You will be given a prize redemption code and either a URL where you can redeem it, or an e-mail address of the prize provider (they will need the redemption code). All prizes must be claimed by the end of July 2013. I will list winners by username; if you used your e-mail address as your username, then a portion of that will be truncated for your privacy. Anyone can log in and check their Profile page to see if they&rsquo;ve won a prize.</p><ul><li><p>Event 5 Beginner First Place: KmTatar (free ebook from Manning<strong>and a copy of SAPIEN PowerShell Studio!</strong>)</p></li><li><p>Event 5 Beginner Second Place: skyrabin_yuri@__.ru (6 months video training from Interface)</p></li><li><p>Event 5 Beginner Third Place: PShellMan (1 year of Phoneominal from Start-Automating)</p></li><li><p>Event 5 Advanced First Place: mjolinor (free ebook from Manning<strong>and a copy of SAPIEN PowerShell Studio!</strong>)</p></li><li><p>Event 5 Advanced Second Place: mikefrobbins (6 months video training from Interface)</p></li><li><p>Event 5 Advanced Third Place: dchristian3188@__.com (1 year of Phonenominal from Start-Automating)</p></li><li><p>Event 5 Beginner Top CrowdScore: KmTatar (free ebook from Manning)</p></li><li><p>Event 5 Advanced Top CrowdScore:<em>Emin</em> (free ebook from Manning)</p></li></ul><p>These will be listed on our<a href="http://scriptinggames.org/winners.php">consolidated list of winners</a>, which includes links to the winning entries.<br>
Our CrowdScore winners get a selection of free ebooks from Manning, 1 month of video training from Interface, and $50 gift cards from SAPIEN; 1 prize per winner. Check your profile to see if you&rsquo;ve won!<br>
Congratulations to all of our winners! Note that our top three prizes in each category were awarded by our Mighty Panel of Celebrity Judges. Each judge nominated a first, second, and third place winner from the entries that our expert commentators identified as &ldquo;best.&rdquo; Those nominations were compiled, and in the event of a tie the earliest entry was deemed winner.</p>
]]></content:encoded></item><item><title>Microsoft announces PowerShell v4, DSC</title><link>https://powershell.org/articles/2013-06-04-microsoft-announces-powershell-v4-dsc/</link><guid>https://powershell.org/articles/2013-06-04-microsoft-announces-powershell-v4-dsc/</guid><pubDate>Tue, 04 Jun 2013 14:00:15 +0000</pubDate><description>&lt;p&gt;Yesterday at TechEd North America, Jeffrey Snover and Kenneth Hansen began describing features to be delivered with PowerShell v4 in Windows Server 2012 R2 (the company has not yet announced availability dates for either).&lt;br&gt;
In particular, a new feature called Desired State Configuration promises to become the foundation for some pretty serious expansion. Essentially, DSC lets administrators write a declarative &amp;ldquo;script&amp;rdquo; that describes what a computer should look like. PowerShell takes that, matches the declarative components with underlying modules, and ensures that the computer does, in fact, look like that. Nearly anything can be checked and controlled: roles, features, files, registry keys - anything, in fact, that a PowerShell module can do.&lt;br&gt;
The architecture includes the notion of centrally stored declarative scripts, and the ability to dynamically deploy supporting modules on an as-needed basis to computers that are checking themselves. A System Center Virtual Machine Manager demonstration utilized the feature to dynamically spin up brand-new VM instances and have them immediately reconfigure to their desired state.&lt;br&gt;
At first glance, it&amp;rsquo;s easy to see &amp;ldquo;more Microsoft stuff&amp;rdquo; in this feature. After all, the company has previous given us Dynamic Systems Management (DSM), various universal &amp;ldquo;configuration languages,&amp;rdquo; and even System Center Configuration Manager&amp;rsquo;s somewhat primitive configuration auditing feature. But keep in mind that DSC will &lt;strong&gt;be a core part of the OS.&lt;/strong&gt; That means product teams and ISVs can rely on it being there, with no other dependencies to worry about. DSC is also built around DMTF standards - like the MOF format - making it natively suitable for cross-platform management. A demo from Opscode using their Chef product showed clever use of the new DSC feature.&lt;br&gt;
Hansen also mentioned that PowerShell modules will be deployable through DSC as ZIP files, helping make them more self-contained (not entirely unlike PECL packages in the Unix world).&lt;br&gt;
There has been no announcement as yet on how far back PowerShell v4 will be made available, nor whether or not DSC is a PowerShell feature or a Windows Server 2012 R2 feature. If it is indeed a PowerShell feature (which I suspect it is), then it&amp;rsquo;ll be available on any system with v4 installed. That will hopefully include at least Windows 7, Windows Server 2008 R2, and later.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Yesterday at TechEd North America, Jeffrey Snover and Kenneth Hansen began describing features to be delivered with PowerShell v4 in Windows Server 2012 R2 (the company has not yet announced availability dates for either).<br>
In particular, a new feature called Desired State Configuration promises to become the foundation for some pretty serious expansion. Essentially, DSC lets administrators write a declarative &ldquo;script&rdquo; that describes what a computer should look like. PowerShell takes that, matches the declarative components with underlying modules, and ensures that the computer does, in fact, look like that. Nearly anything can be checked and controlled: roles, features, files, registry keys - anything, in fact, that a PowerShell module can do.<br>
The architecture includes the notion of centrally stored declarative scripts, and the ability to dynamically deploy supporting modules on an as-needed basis to computers that are checking themselves. A System Center Virtual Machine Manager demonstration utilized the feature to dynamically spin up brand-new VM instances and have them immediately reconfigure to their desired state.<br>
At first glance, it&rsquo;s easy to see &ldquo;more Microsoft stuff&rdquo; in this feature. After all, the company has previous given us Dynamic Systems Management (DSM), various universal &ldquo;configuration languages,&rdquo; and even System Center Configuration Manager&rsquo;s somewhat primitive configuration auditing feature. But keep in mind that DSC will<strong>be a core part of the OS.</strong> That means product teams and ISVs can rely on it being there, with no other dependencies to worry about. DSC is also built around DMTF standards - like the MOF format - making it natively suitable for cross-platform management. A demo from Opscode using their Chef product showed clever use of the new DSC feature.<br>
Hansen also mentioned that PowerShell modules will be deployable through DSC as ZIP files, helping make them more self-contained (not entirely unlike PECL packages in the Unix world).<br>
There has been no announcement as yet on how far back PowerShell v4 will be made available, nor whether or not DSC is a PowerShell feature or a Windows Server 2012 R2 feature. If it is indeed a PowerShell feature (which I suspect it is), then it&rsquo;ll be available on any system with v4 installed. That will hopefully include at least Windows 7, Windows Server 2008 R2, and later.</p>
]]></content:encoded></item><item><title>Scripting Games 2013: Event 5 Notes</title><link>https://powershell.org/articles/2013-06-03-scripting-games-2013-event-5-notes/</link><guid>https://powershell.org/articles/2013-06-03-scripting-games-2013-event-5-notes/</guid><pubDate>Tue, 04 Jun 2013 03:36:46 +0000</pubDate><description>&lt;p&gt;With week 5 in the books, I can see that everyone just continues to grow and show some great submissions. Of course, nothing is perfect and can always show areas of improvement, but trust me, you are all doing an excellent job!&lt;br&gt;
I was hoping to have this article completed prior to now, but between a flight to Tech Ed and forgetting my power cord for the laptop, I am just now getting this accomplished. Better late than never :).&lt;br&gt;
With that, head over to my blog to check out my notes on Event 5 &lt;a href="http://learn-powershell.net/2013/06/03/scripting-games-2013-event-5-notes/"&gt;here&lt;/a&gt;.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>With week 5 in the books, I can see that everyone just continues to grow and show some great submissions. Of course, nothing is perfect and can always show areas of improvement, but trust me, you are all doing an excellent job!<br>
I was hoping to have this article completed prior to now, but between a flight to Tech Ed and forgetting my power cord for the laptop, I am just now getting this accomplished. Better late than never :).<br>
With that, head over to my blog to check out my notes on Event 5<a href="http://learn-powershell.net/2013/06/03/scripting-games-2013-event-5-notes/">here</a>.</p>
]]></content:encoded></item><item><title>As The Scripting Games Wrap Up…</title><link>https://powershell.org/articles/2013-06-01-as-the-scripting-games-wrap-up/</link><guid>https://powershell.org/articles/2013-06-01-as-the-scripting-games-wrap-up/</guid><pubDate>Sat, 01 Jun 2013 18:39:15 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;ve still got, oh, about 48 hours or so for Event 6 submissions, and then of course voting and judging. &lt;strong&gt;But&lt;/strong&gt; I wanted to take a second and let you know what this year&amp;rsquo;s Games looked like:&lt;br&gt;
We&amp;rsquo;ve logged over 1,100 entries. Almost 13,000 votes. More than 6,700 comments. That&amp;rsquo;s a lot - and it&amp;rsquo;ll all be &lt;a href="http://scriptinggames.org/entries"&gt;archived&lt;/a&gt; once the final votes are tallied and prizes awarded. There will be ZIP files of entries for each track and event, and I encourage you to download them over the Summer - we won&amp;rsquo;t necessarily archive them permanently.&lt;br&gt;
We&amp;rsquo;ve seen an enormous range of techniques and approaches, and generated hundreds of learning notes across more than a dozen active expert commentators. We&amp;rsquo;ve awarded - with some yet to be handed out - thousands of dollars worth of prizes.&lt;br&gt;
This is also a good time to start collecting general feedback on the Games, so feel free to drop into our &lt;a href="https://powershell.org/forums/topic/post-mortem-likedislike/"&gt;official post-mortem thread and offer your feedback&lt;/a&gt;. &lt;strong&gt;Read the introductory post in that thread&lt;/strong&gt; before you post, please. I&amp;rsquo;m asking for a specific feedback format at this time, although you&amp;rsquo;re always welcome to open your own thread if you have something specific or off-format you want to offer. I ask only that you keep things &lt;em&gt;constructive&lt;/em&gt; and &lt;em&gt;professional.&lt;/em&gt;&lt;br&gt;
Thanks to everyone who participated in the Games. We&amp;rsquo;re formulating our next event, so stay tuned.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;ve still got, oh, about 48 hours or so for Event 6 submissions, and then of course voting and judging.<strong>But</strong> I wanted to take a second and let you know what this year&rsquo;s Games looked like:<br>
We&rsquo;ve logged over 1,100 entries. Almost 13,000 votes. More than 6,700 comments. That&rsquo;s a lot - and it&rsquo;ll all be<a href="http://scriptinggames.org/entries">archived</a> once the final votes are tallied and prizes awarded. There will be ZIP files of entries for each track and event, and I encourage you to download them over the Summer - we won&rsquo;t necessarily archive them permanently.<br>
We&rsquo;ve seen an enormous range of techniques and approaches, and generated hundreds of learning notes across more than a dozen active expert commentators. We&rsquo;ve awarded - with some yet to be handed out - thousands of dollars worth of prizes.<br>
This is also a good time to start collecting general feedback on the Games, so feel free to drop into our<a href="https://powershell.org/forums/topic/post-mortem-likedislike/">official post-mortem thread and offer your feedback</a>.<strong>Read the introductory post in that thread</strong> before you post, please. I&rsquo;m asking for a specific feedback format at this time, although you&rsquo;re always welcome to open your own thread if you have something specific or off-format you want to offer. I ask only that you keep things<em>constructive</em> and<em>professional.</em><br>
Thanks to everyone who participated in the Games. We&rsquo;re formulating our next event, so stay tuned.</p>
]]></content:encoded></item><item><title>Meet the Scripting Games Judges</title><link>https://powershell.org/articles/2013-05-31-meet-the-scripting-games-judges/</link><guid>https://powershell.org/articles/2013-05-31-meet-the-scripting-games-judges/</guid><pubDate>Fri, 31 May 2013 20:42:17 +0000</pubDate><description>&lt;p&gt;I can honestly say that the interactions that I&amp;quot;™ve had with the PowerShell community over the past five years have been some of the most fulfilling. There is something to watching someone learn to script. Some plateau artificially mainly because they don&amp;quot;™t want to leave the GUI. Often they&amp;quot;™re forced into learning PowerShell and stubbornly go into trying to learn as little as possible. If you competed this year you do not fall into that category. You fall into the category that I love working with Talented Specialist that we watch graduate from good to great. I&amp;quot;™m happy to invite this year&amp;quot;™s class into &amp;ldquo;the club&amp;rdquo;.&lt;br&gt;
For everyone else I have an invitation. If you would like to know what makes a good script great and will be in New Orleans next week for TechEd 2012 NA, then please join the judges of the Scripting Games as we do a public Code review. Simply put we&amp;quot;™ll take a script and as a group discuss what makes it good and bad. We&amp;quot;™re calling it best practices for the real word, but you&amp;quot;™ll see it listed in the directory under &lt;a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/BOF-ITP23#fbid=LcGTktzJqbc" title="BOF-ITP23"&gt;BOF-ITP23&lt;/a&gt;.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I can honestly say that the interactions that I"™ve had with the PowerShell community over the past five years have been some of the most fulfilling. There is something to watching someone learn to script. Some plateau artificially mainly because they don"™t want to leave the GUI. Often they"™re forced into learning PowerShell and stubbornly go into trying to learn as little as possible. If you competed this year you do not fall into that category. You fall into the category that I love working with Talented Specialist that we watch graduate from good to great. I"™m happy to invite this year"™s class into &ldquo;the club&rdquo;.<br>
For everyone else I have an invitation. If you would like to know what makes a good script great and will be in New Orleans next week for TechEd 2012 NA, then please join the judges of the Scripting Games as we do a public Code review. Simply put we"™ll take a script and as a group discuss what makes it good and bad. We"™re calling it best practices for the real word, but you"™ll see it listed in the directory under<a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/BOF-ITP23#fbid=LcGTktzJqbc" title="BOF-ITP23">BOF-ITP23</a>.</p>
]]></content:encoded></item><item><title>Scripting Games Week 5</title><link>https://powershell.org/articles/2013-05-31-scripting-games-week-5/</link><guid>https://powershell.org/articles/2013-05-31-scripting-games-week-5/</guid><pubDate>Fri, 31 May 2013 15:02:17 +0000</pubDate><description>&lt;p&gt;I loved this week&amp;quot;™s challenge as it had the right wiggle room to bring out the best in our participants.  Of course, this is also the point in the games when we start to get everyone&amp;quot;™s &amp;ldquo;A&amp;rdquo; game.  At this point even our new competitors are all warmed up and in the zone, and let me tell you the entries this week show it!   I want to start with the beginners as I actually ran almost every entry this week.  Honestly everyone fell into one of three buckets Select-string, Import-CSV or ,Foreach.  Let me explain there where three primary means to solve this problem.  Use Select-String and some basic text parsing to get the ip addresses, and then using Select-Object to filter.  Converting the logs to objects with Import-CSV and using Where-Object to filter.  Or using Foreach and a combination of if and where.&lt;br&gt;
They are all three correct, so how does one judge one from another?  As this is a competition I used speed as the determining gauge.  For a long time I was convinced that the following was about perfect.  Quick simple and accurate.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I loved this week"™s challenge as it had the right wiggle room to bring out the best in our participants.  Of course, this is also the point in the games when we start to get everyone"™s &ldquo;A&rdquo; game.  At this point even our new competitors are all warmed up and in the zone, and let me tell you the entries this week show it!   I want to start with the beginners as I actually ran almost every entry this week.  Honestly everyone fell into one of three buckets Select-string, Import-CSV or ,Foreach.  Let me explain there where three primary means to solve this problem.  Use Select-String and some basic text parsing to get the ip addresses, and then using Select-Object to filter.  Converting the logs to objects with Import-CSV and using Where-Object to filter.  Or using Foreach and a combination of if and where.<br>
They are all three correct, so how does one judge one from another?  As this is a competition I used speed as the determining gauge.  For a long time I was convinced that the following was about perfect.  Quick simple and accurate.</p><p><code>Select-String -Path C:\Reporting\LogFiles\*\*.log -Pattern "(\b\d{1,3}\.){3}.\d{1,3}\b" -AllMatches | Select-Object -Unique @{Label="IP";Expression={$_.matches[1]}}</code>I was particularly drawn to this approach because it only used two cmdlets if that"™s not PowerShell I don"™t know what is. At first I was convinced converting the logs to objects was a waste.  Let me explain.  Over the course of this past month you"™ve heard us rant and rave about objects, and how PowerShell is not text, but rich .Net objects.  For the most part that is an iron law, but it"™s a law with an exception.  There is one place where text is just text, log files!  That"™s why I loved this event.  This is the exception where all the old tricks still apply and where we found out which of you really know your regular expressions.  However in this one instant since we had a well formed log converting to a CSV was actually faster.   I wasn"™t expecting that, but consider my gold standard example takes about 10 Seconds on my PC.   The Following finishes in 3!</p><p>`$LogFilePath = &lsquo;C:\Reporting\LogFiles&rsquo;
$header = &lsquo;date&rsquo;,&rsquo;time&rsquo;,&rsquo;s-ip&rsquo;,&lsquo;cs-method&rsquo;,&lsquo;cs-uri-stem&rsquo;,&lsquo;cs-uri-query&rsquo;,&rsquo;s-port&rsquo;,&lsquo;cs-username&rsquo;,&lsquo;c-ip&rsquo;,&lsquo;cs(User-Agent)&rsquo;,&lsquo;sc-status&rsquo;,&lsquo;sc-substatus&rsquo;,&lsquo;sc-win32-status&rsquo;,&rsquo;time-taken&rsquo;
Import-Csv -Path $(Get-ChildItem -Path $LogFilePath -File -Recurse).FullName -Header $header -Delimiter &rsquo; &rsquo; |</p><h1 id="if-the-contents-of-c-ip-can-be-converted-to-an-ip-address-then-it-is-a-valid-ip" class="ps-heading">if the contents of &lsquo;c-ip&rsquo; can be converted to an IP address then it is a valid IP<a class="ps-heading-anchor" href="#if-the-contents-of-c-ip-can-be-converted-to-an-ip-address-then-it-is-a-valid-ip" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>Select-Object @{n=&lsquo;ClientIP&rsquo;;e={if ([IPAddress]$<em>.&lsquo;c-ip&rsquo;){ $</em>.&lsquo;c-ip&rsquo; }}} |
Sort-Object -Property &lsquo;ClientIP&rsquo; -Unique
`Now I"™m not crazy about that entry it"™s hard to follow, and will always return a blank string, but if you really look what makes it work is the author is offloading the IP filtering to the [IPAddress] type accelerator.  That is brilliant, and is x5 faster than a regular expression, which really adds up when you"™re performing over 6k comparisons.   I know the general consensus is to leave the .Net stuff alone, but I have no religion when it comes to this stuff. If it"™s better it"™s better and in this instance it was better.<br>
But that"™s not the end of the story. While sorting through the entries I found the following solution.</p><p><code>Get-ChildItem -File C:\Reporting\LogFiles -Recurse | Get-Content | # Selecting "GET /" gives us only the lines we want from the files. Select-String -Pattern "GET /" | # Split the remaining lines into an array and write element 8, the IP, to a file. ForEach-Object {$_.Line.Split("")[8] } | Select-Object -Unique @{Name="Source Address"; Expression={$_}}</code>Now that"™s an old school PowerShell solution if I"™ve ever seen one, and you know what it"™s fast as hell!  There"™s no validation of any kind. It will only work with provided source files, and it"™s absolutely perfect!  You see the goal is to get the job done.  We don"™t always have to author a tool that can be used by the world.  There is nothing wrong with leveraging your brain and cheating a little!<br>
As for the advanced entries I think they"™ve been adequately covered by my fellow judges.  In general my feedback would be to start a slow clap for the group.  There not perfect, but as a group you"™ve learned from the feedback over this past month and man does it show! Heading into the final stretch I encourage you all to treat this last entry as your victory lap as you"™ve all already one.<br>
~Glenn</p>
]]></content:encoded></item><item><title>Free PowerShell Workshop Video from TechMentor and Me</title><link>https://powershell.org/articles/2013-05-31-free-powershell-workshop-video-from-techmentor-and-me/</link><guid>https://powershell.org/articles/2013-05-31-free-powershell-workshop-video-from-techmentor-and-me/</guid><pubDate>Fri, 31 May 2013 12:16:42 +0000</pubDate><description>&lt;p&gt;At the last &lt;a href="http://techmentorevents.com"&gt;TechMentor&lt;/a&gt; (in Orlando), I did a Windows PowerShell pre-conference workshop. The conference was kind enough to let me record it - I basically just used Camtasia, so this isn&amp;rsquo;t a professional video by any stretch, but it gives you an idea of what a TechMentor conference is like. Obviously, my focus was on the folks in the room, but you can see all of the demos and hear me pretty clearly. &lt;a href="http://techmentorevents.com/forms/don-jones-video.aspx"&gt;You can view the video for free&lt;/a&gt;, although note that registration is required.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>At the last<a href="http://techmentorevents.com">TechMentor</a> (in Orlando), I did a Windows PowerShell pre-conference workshop. The conference was kind enough to let me record it - I basically just used Camtasia, so this isn&rsquo;t a professional video by any stretch, but it gives you an idea of what a TechMentor conference is like. Obviously, my focus was on the folks in the room, but you can see all of the demos and hear me pretty clearly.<a href="http://techmentorevents.com/forms/don-jones-video.aspx">You can view the video for free</a>, although note that registration is required.</p>
]]></content:encoded></item><item><title>Tobias' Event 5 Notes</title><link>https://powershell.org/articles/2013-05-31-tobias-event-5-notes/</link><guid>https://powershell.org/articles/2013-05-31-tobias-event-5-notes/</guid><pubDate>Fri, 31 May 2013 12:12:45 +0000</pubDate><description>&lt;p&gt;Find &amp;rsquo;em at &lt;a href="http://www.powertheshell.com/scripting-games-task-5-commentary/"&gt;http://www.powertheshell.com/scripting-games-task-5-commentary/&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Find &rsquo;em at<a href="http://www.powertheshell.com/scripting-games-task-5-commentary/">http://www.powertheshell.com/scripting-games-task-5-commentary/</a></p>
]]></content:encoded></item><item><title>Notes on Event 5</title><link>https://powershell.org/articles/2013-05-30-notes-on-event-5/</link><guid>https://powershell.org/articles/2013-05-30-notes-on-event-5/</guid><pubDate>Thu, 30 May 2013 13:54:17 +0000</pubDate><description>&lt;p&gt;Into the home stretch and the entries just keep getting better! The only advice I&amp;rsquo;d like to offer this time is to be careful to read the instructions carefully. They included the specific folder where the files were located and I noticed several misinterpretations in the scripts. Some included a mandatory Path parameter and others had a default Path that was not the specified folder. Including an optional Path with the correct default would certainly be acceptable, but not those variations.&lt;br&gt;
The instructions also included some ambiguity about what the log file actually contains. Was the client IP address in the first column (as specified in the instructions) or in a different column (as presented in the example logs)? There were a number of entries that just searched the logs for IP addresses and returned all of them. This approach would not be able to distinguished between the client and server addresses, which would give a wrong answer. Another approach searched for the &amp;ldquo;c-ip&amp;rdquo; column, but this would only work if the log files were as in the samples. Another method, select the second IP address in a line would also only work on the sample log style. There weren&amp;rsquo;t many entries that supported both file types, but one of them did it in a very concise manner, checking the first and ninth columns for an IP address and selecting the correct one.&lt;br&gt;
Most of the entries used &lt;em&gt;Sort-Object -Unique&lt;/em&gt; or &lt;em&gt;Select-Object -Unique&lt;/em&gt; to eliminate duplicates, which was the first approach that I thought of. There were several entries, however, that used alternate methods that I thought were quite clever applications of PowerShell technology: hash tables with the IP address as the key, and &lt;em&gt;Group-Object&lt;/em&gt; on the IP address. Both options provided a fairly simple way to also report the instance count for each address.&lt;br&gt;
Returning an instance count sounds like an interesting option, but after thinking about it some more, I&amp;rsquo;m not so sure. Counts of the number of sessions and the hits per session would be much more interesting than the raw hits count. But that&amp;rsquo;s way, way beyond the scope of this event.&lt;br&gt;
Anyway, just one more event to go. I&amp;rsquo;m expecting a spectacular finish!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Into the home stretch and the entries just keep getting better! The only advice I&rsquo;d like to offer this time is to be careful to read the instructions carefully. They included the specific folder where the files were located and I noticed several misinterpretations in the scripts. Some included a mandatory Path parameter and others had a default Path that was not the specified folder. Including an optional Path with the correct default would certainly be acceptable, but not those variations.<br>
The instructions also included some ambiguity about what the log file actually contains. Was the client IP address in the first column (as specified in the instructions) or in a different column (as presented in the example logs)? There were a number of entries that just searched the logs for IP addresses and returned all of them. This approach would not be able to distinguished between the client and server addresses, which would give a wrong answer. Another approach searched for the &ldquo;c-ip&rdquo; column, but this would only work if the log files were as in the samples. Another method, select the second IP address in a line would also only work on the sample log style. There weren&rsquo;t many entries that supported both file types, but one of them did it in a very concise manner, checking the first and ninth columns for an IP address and selecting the correct one.<br>
Most of the entries used<em>Sort-Object -Unique</em> or<em>Select-Object -Unique</em> to eliminate duplicates, which was the first approach that I thought of. There were several entries, however, that used alternate methods that I thought were quite clever applications of PowerShell technology: hash tables with the IP address as the key, and<em>Group-Object</em> on the IP address. Both options provided a fairly simple way to also report the instance count for each address.<br>
Returning an instance count sounds like an interesting option, but after thinking about it some more, I&rsquo;m not so sure. Counts of the number of sessions and the hits per session would be much more interesting than the raw hits count. But that&rsquo;s way, way beyond the scope of this event.<br>
Anyway, just one more event to go. I&rsquo;m expecting a spectacular finish!</p>
]]></content:encoded></item><item><title>"Super Secret" Snover Session at TechEd</title><link>https://powershell.org/articles/2013-05-29-super-secret-snover-session-at-teched/</link><guid>https://powershell.org/articles/2013-05-29-super-secret-snover-session-at-teched/</guid><pubDate>Wed, 29 May 2013 12:39:09 +0000</pubDate><description>&lt;p&gt;So what&amp;rsquo;s with the &lt;a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/MDC-B302#fbid=nMfDOO99OjI"&gt;&amp;ldquo;super secret&amp;rdquo; PowerShell session&lt;/a&gt; being given by Jeffrey Snover at TechEd 2013?&lt;br&gt;
First, if you&amp;rsquo;ll be in New Orleans, plan to attend this. The deal is pretty simple: Microsoft has got a lot of information pertaining to v.Next under embargo, which means people can&amp;rsquo;t talk about it yet, or even tell you the title of the session. But trust me, if you&amp;rsquo;re interested in the world of DevOps (and if you use PowerShell, you are), you&amp;rsquo;ll want to be at this session. PowerShell MVPs were given a sneak peek at what Snover will be discussing, and it&amp;rsquo;ll frankly blow your mind. It will, over the long haul, put PowerShell in a completely new place - and you&amp;rsquo;ll want to get in on the ground floor.&lt;br&gt;
Like most sessions at TechEd, it appears as if they&amp;rsquo;ll be recording this, so even if you can&amp;rsquo;t attend in person be sure to check back once the recording is live. That usually takes a day or two after the talk itself.&lt;br&gt;
And spread the word a bit. There&amp;rsquo;s a bit of a worry that, because even the &lt;em&gt;title&lt;/em&gt; of the session won&amp;rsquo;t be announced until TechEd formally commences, folks won&amp;rsquo;t have much time to realize the session exists and it&amp;rsquo;ll go empty. We don&amp;rsquo;t want that to happen - as with any new developments in PowerShell, it&amp;rsquo;s crucial to get folks thinking about it early, to get their feedback early, and to start planning for it early.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>So what&rsquo;s with the<a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/MDC-B302#fbid=nMfDOO99OjI">&ldquo;super secret&rdquo; PowerShell session</a> being given by Jeffrey Snover at TechEd 2013?<br>
First, if you&rsquo;ll be in New Orleans, plan to attend this. The deal is pretty simple: Microsoft has got a lot of information pertaining to v.Next under embargo, which means people can&rsquo;t talk about it yet, or even tell you the title of the session. But trust me, if you&rsquo;re interested in the world of DevOps (and if you use PowerShell, you are), you&rsquo;ll want to be at this session. PowerShell MVPs were given a sneak peek at what Snover will be discussing, and it&rsquo;ll frankly blow your mind. It will, over the long haul, put PowerShell in a completely new place - and you&rsquo;ll want to get in on the ground floor.<br>
Like most sessions at TechEd, it appears as if they&rsquo;ll be recording this, so even if you can&rsquo;t attend in person be sure to check back once the recording is live. That usually takes a day or two after the talk itself.<br>
And spread the word a bit. There&rsquo;s a bit of a worry that, because even the <em>title</em> of the session won&rsquo;t be announced until TechEd formally commences, folks won&rsquo;t have much time to realize the session exists and it&rsquo;ll go empty. We don&rsquo;t want that to happen - as with any new developments in PowerShell, it&rsquo;s crucial to get folks thinking about it early, to get their feedback early, and to start planning for it early.</p>
]]></content:encoded></item><item><title>Notes for Event 5</title><link>https://powershell.org/articles/2013-05-29-notes-for-event-5/</link><guid>https://powershell.org/articles/2013-05-29-notes-for-event-5/</guid><pubDate>Wed, 29 May 2013 12:27:33 +0000</pubDate><description>&lt;p&gt;Jan Egil, or Norwegian expert commentator/judge, has posted his learning notes for Event 5: &lt;a href="http://blog.powershell.no/2013/05/28/2013-scripting-games-learning-points-from-event-5/"&gt;http://blog.powershell.no/2013/05/28/2013-scripting-games-learning-points-from-event-5/&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Jan Egil, or Norwegian expert commentator/judge, has posted his learning notes for Event 5: <a href="http://blog.powershell.no/2013/05/28/2013-scripting-games-learning-points-from-event-5/">http://blog.powershell.no/2013/05/28/2013-scripting-games-learning-points-from-event-5/</a></p>
]]></content:encoded></item><item><title>Scripting Games Event 4 Winners</title><link>https://powershell.org/articles/2013-05-28-scripting-games-event-4-winners/</link><guid>https://powershell.org/articles/2013-05-28-scripting-games-event-4-winners/</guid><pubDate>Tue, 28 May 2013 13:32:27 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;re pleased to announce the winners for Event 4 of The Scripting Games 2013!&lt;br&gt;
Remember that Event 5 is now open for community voting, and that Event 6 opens up near the end of this week. That&amp;rsquo;ll be your last chance to contribute, and shortly after TechEd we&amp;rsquo;ll announce the overall winners. Good luck!&lt;br&gt;
Winners: You can log into &lt;a href="http://scriptinggames.org/"&gt;The Scripting Games Web site&lt;/a&gt; and go to your Profile page to see your prize. You will be given a prize redemption code and either a URL where you can redeem it, or an e-mail address of the prize provider (they will need the redemption code). All prizes must be claimed by the end of July 2013. I will list winners by username; if you used your e-mail address as your username, then a portion of that will be truncated for your privacy. Anyone can log in and check their Profile page to see if they&amp;rsquo;ve won a prize.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;re pleased to announce the winners for Event 4 of The Scripting Games 2013!<br>
Remember that Event 5 is now open for community voting, and that Event 6 opens up near the end of this week. That&rsquo;ll be your last chance to contribute, and shortly after TechEd we&rsquo;ll announce the overall winners. Good luck!<br>
Winners: You can log into<a href="http://scriptinggames.org/">The Scripting Games Web site</a> and go to your Profile page to see your prize. You will be given a prize redemption code and either a URL where you can redeem it, or an e-mail address of the prize provider (they will need the redemption code). All prizes must be claimed by the end of July 2013. I will list winners by username; if you used your e-mail address as your username, then a portion of that will be truncated for your privacy. Anyone can log in and check their Profile page to see if they&rsquo;ve won a prize.</p><ul><li><p>Event 4 Beginner First Place: amello (free ebook from Manning)</p></li><li><p>Event 4 Beginner Second Place: jwoods@__.com (6 months video training from Interface)</p></li><li><p>Event 4 Beginner Third Place: Poshsg0606 (1 year of Phoneominal from Start-Automating)</p></li><li><p>Event 4 Advanced First Place: DawnVillejoin (free ebook from Manning)</p></li><li><p>Event 4 Advanced Second Place: adweigert (6 months video training from Interface)</p></li><li><p>Event 4 Advanced Third Place: JustinK70 (1 year of Phonenominal from Start-Automating)</p></li><li><p>Event 4 Beginner Top CrowdScore: taygibb (free ebook from Manning)</p></li><li><p>Event 4 Advanced Top CrowdScore: mikefrobbins (free ebook from Manning)</p></li></ul><p>These will be listed on our<a href="http://scriptinggames.org/winners.php">consolidated list of winners</a>, which includes links to the winning entries.<br>
Our CrowdScore winners get a selection of free ebooks from Manning, 1 month of video training from Interface, and $50 gift cards from SAPIEN; 1 prize per winner. Check your profile to see if you&rsquo;ve won!<br>
Congratulations to all of our winners! Note that our top three prizes in each category were awarded by our Mighty Panel of Celebrity Judges. Each judge nominated a first, second, and third place winner from the entries that our expert commentators identified as &ldquo;best.&rdquo; Those nominations were compiled, and in the event of a tie the earliest entry was deemed winner.</p>
]]></content:encoded></item><item><title>Event 4: My notes…</title><link>https://powershell.org/articles/2013-05-25-event-4-my-notes/</link><guid>https://powershell.org/articles/2013-05-25-event-4-my-notes/</guid><pubDate>Sat, 25 May 2013 21:09:10 +0000</pubDate><description>&lt;p&gt;Active Directory is one of those things I just love to work with. That&amp;rsquo;s why I was really looking forward to this event. As always, I learned few things, but still - seen some mistakes that I would like to highlight. As always - you can read about those both in &lt;a href="http://powershellpl.net/2013/05/25/scripting-games-moje-notatki-4/"&gt;Polish&lt;/a&gt; and in &lt;a href="http://becomelotr.wordpress.com/2013/05/25/event-4-my-notes/"&gt;English&lt;/a&gt;. Enjoy!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Active Directory is one of those things I just love to work with. That&rsquo;s why I was really looking forward to this event. As always, I learned few things, but still - seen some mistakes that I would like to highlight. As always - you can read about those both in<a href="http://powershellpl.net/2013/05/25/scripting-games-moje-notatki-4/">Polish</a> and in<a href="http://becomelotr.wordpress.com/2013/05/25/event-4-my-notes/">English</a>. Enjoy!</p>
]]></content:encoded></item><item><title>Scripting Games Week 4</title><link>https://powershell.org/articles/2013-05-24-scripting-games-week-4/</link><guid>https://powershell.org/articles/2013-05-24-scripting-games-week-4/</guid><pubDate>Fri, 24 May 2013 21:37:18 +0000</pubDate><description>&lt;p&gt;Again if you&amp;quot;™re participating in the games this year you&amp;quot;™ve already won!  If you&amp;quot;™re not and you&amp;quot;™re reading this post what are you doing!  I&amp;quot;™ve watched authors step there game up over the past month, and I can tell you from personal experience the games will make you better at your real job.  It&amp;quot;™s like sharpening an axe, an axe made of super juice that can automate the world 🙂&lt;br&gt;
**Well that&amp;rsquo;s clever!&lt;br&gt;
** I came across this script this morning.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Again if you"™re participating in the games this year you"™ve already won!  If you"™re not and you"™re reading this post what are you doing!  I"™ve watched authors step there game up over the past month, and I can tell you from personal experience the games will make you better at your real job.  It"™s like sharpening an axe, an axe made of super juice that can automate the world 🙂<br>
**Well that&rsquo;s clever!<br>
** I came across this script this morning.</p><h2 id="convertto-html--title-active-directory-audit--postcontent-" class="ps-heading">`$prop = Write-Output Name,Title,Department,LastLogonDate,PasswordLastSet,LockedOut,Enabled
Get-ADUser -Filter * -Properties $prop |
Get-Random -Count 20 | Select-Object $prop |
ConvertTo-Html -Title &ldquo;Active Directory Audit&rdquo; -PostContent "<a class="ps-heading-anchor" href="#convertto-html--title-active-directory-audit--postcontent-" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>$(Get-Date)" | Out-File C:\adresult.html
`Well formatted, simple concise, all around a very clean approach to the problem.  However the use of write-output threw me for a second.  I actually had to run it to see what was happening there, for a second I thought maybe there was yet another way to create a custom object in PowerShell.  Alas no, our intrepid author has simply deduced a way to avoid having to put quotes around the text.  Consider the following Prop1, and Prop2 are identical, but it"™s one less character using write-output.</p><p><code>$prop1 = Write-Output Name,Title,Department,LastLogonDate,PasswordLastSet,LockedOut,Enabled $prop2 = 'Name','Title','Department','LastLogonDate','PasswordLastSet','LockedOut','Enabled'</code>I"™m not saying we should start using write-output instead of quotation if for nothing other than syntax highlighting it"™s incorrect. However, this one time it"™s forgiven, and I"™m tipping my hat to you sir, well done.<br>
**Don"™t put spaces or dashes in your property names.<br>
** I"™ve seen this on and off throughout the games and I"™ll admit this one isn"™t a slam dunk, but that said don"™t do it. You"™re writing a script, camel case is the established standard for spaces. Yes the spaces do make it slightly easier to read, but at the cost of eliminate the reuse of the code.<br>
**Oh the Humanity.<br>
** Seriously read the damn help already. I could just fill this post with examples of simple mistakes that could have been avoided. Using the wrong cmdlet is one thing but take the following.</p><p><code>Get-Process | Sort-Object {Get-Random} | select -First 5</code>What"™s wrong with that picture? Well nothing except it"™s horribly inefficient since the Get-Random cmdlet has a count parameter!</p><p><code>Get-Process | Get-Random -Count 5</code>To the author You know who you are, everyone else read the help people!<br>
Light week this week, but I will say I am super excited about next weeks offerings it"™s a problem that tickles my kind of fancy, and I hope you all have as much fun solving it as I did.<br>
~Glenn</p>
]]></content:encoded></item><item><title>The new PowerShell Class is Coming to a CPLS Near You!</title><link>https://powershell.org/articles/2013-05-24-the-new-powershell-class-is-coming-to-a-cpls-near-you/</link><guid>https://powershell.org/articles/2013-05-24-the-new-powershell-class-is-coming-to-a-cpls-near-you/</guid><pubDate>Fri, 24 May 2013 21:00:09 +0000</pubDate><description>&lt;p&gt;Looking for a great getting-started PowerShell class? Or perhaps you&amp;rsquo;d like to send a colleague or peer to some PowerShell &amp;ldquo;zero to hero&amp;rdquo; training?&lt;br&gt;
We&amp;rsquo;ve just finished the official beta-teach of Microsoft&amp;rsquo;s 10961, Automating Administration with Windows PowerShell, and it went _great. _The sequencing of the class was spot-on, and we had an absolutely incredible group of students. Many were n00bs, which was perfect; a couple had &amp;ldquo;some&amp;rdquo; shell experience but wanted to learn &amp;ldquo;the right way.&amp;rdquo; And they did.&lt;br&gt;
Through a series of 12 modules, you&amp;rsquo;re led through the basics all the way up to writing your own script. The grand semi-finale has you creating a script that provisions a brand-new, freshly-installed Server Core instance - all without logging on to that instance at all. The high moment for me was when one student, after struggling a bit to get started on the provisioning lab, concluded with a &amp;ldquo;well, that did it.&amp;rdquo; Everything came together for him: command discovery, help, scripting, variables, remoting, &lt;em&gt;all&lt;/em&gt; of it. He &lt;em&gt;did&lt;/em&gt; the task, from scratch, with practically no help. He&amp;rsquo;s _there. _&lt;br&gt;
10961 replaces MS course 10325, and it will soon be supplemented by a Microsoft Courseware Marketplace title that goes further into scripting, error handling, debugging, and more&amp;hellip; what I&amp;rsquo;ve taken to calling _toolmaking. _We&amp;rsquo;ll hopefully continue to refresh both courses as PowerShell evolves.&lt;br&gt;
So call your local Microsoft Certified Partner - Learning Systems (&amp;ldquo;training center&amp;rdquo;) and see when they&amp;rsquo;re offering 10961. A bit of caution: this is a class where, unfortunately, an inexperienced MCT will be really challenged. While the course book is a full, almost-500-page book (you&amp;rsquo;re welcome), it&amp;rsquo;s tightly timed and you&amp;rsquo;ll definitely want to check the credentials and experience of whatever trainer is running the class. You can&amp;rsquo;t just &amp;ldquo;read the slides&amp;rdquo; to stay a module ahead of the students on this one.&lt;br&gt;
This class is &lt;em&gt;strongly&lt;/em&gt; based upon _Learn Windows PowerShell 3.0 in a Month of Lunches, _in terms of how the material is presented, although the sequence and narrative was altered a bit to better accommodate Microsoft requirements and classroom logistics. I&amp;rsquo;m &lt;em&gt;really&lt;/em&gt; proud of how the course turned out - so if you&amp;rsquo;ve got folks who need some PowerShell training, tell &amp;rsquo;em to look it up. Many CPLS centers offer remote training, too, meaning you can attend from the comfort of your own home or office.&lt;br&gt;
If you take the class, I&amp;rsquo;d love to hear what you think.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Looking for a great getting-started PowerShell class? Or perhaps you&rsquo;d like to send a colleague or peer to some PowerShell &ldquo;zero to hero&rdquo; training?<br>
We&rsquo;ve just finished the official beta-teach of Microsoft&rsquo;s 10961, Automating Administration with Windows PowerShell, and it went _great. _The sequencing of the class was spot-on, and we had an absolutely incredible group of students. Many were n00bs, which was perfect; a couple had &ldquo;some&rdquo; shell experience but wanted to learn &ldquo;the right way.&rdquo; And they did.<br>
Through a series of 12 modules, you&rsquo;re led through the basics all the way up to writing your own script. The grand semi-finale has you creating a script that provisions a brand-new, freshly-installed Server Core instance - all without logging on to that instance at all. The high moment for me was when one student, after struggling a bit to get started on the provisioning lab, concluded with a &ldquo;well, that did it.&rdquo; Everything came together for him: command discovery, help, scripting, variables, remoting, <em>all</em> of it. He <em>did</em> the task, from scratch, with practically no help. He&rsquo;s _there. _<br>
10961 replaces MS course 10325, and it will soon be supplemented by a Microsoft Courseware Marketplace title that goes further into scripting, error handling, debugging, and more&hellip; what I&rsquo;ve taken to calling _toolmaking. _We&rsquo;ll hopefully continue to refresh both courses as PowerShell evolves.<br>
So call your local Microsoft Certified Partner - Learning Systems (&ldquo;training center&rdquo;) and see when they&rsquo;re offering 10961. A bit of caution: this is a class where, unfortunately, an inexperienced MCT will be really challenged. While the course book is a full, almost-500-page book (you&rsquo;re welcome), it&rsquo;s tightly timed and you&rsquo;ll definitely want to check the credentials and experience of whatever trainer is running the class. You can&rsquo;t just &ldquo;read the slides&rdquo; to stay a module ahead of the students on this one.<br>
This class is <em>strongly</em> based upon _Learn Windows PowerShell 3.0 in a Month of Lunches, _in terms of how the material is presented, although the sequence and narrative was altered a bit to better accommodate Microsoft requirements and classroom logistics. I&rsquo;m <em>really</em> proud of how the course turned out - so if you&rsquo;ve got folks who need some PowerShell training, tell &rsquo;em to look it up. Many CPLS centers offer remote training, too, meaning you can attend from the comfort of your own home or office.<br>
If you take the class, I&rsquo;d love to hear what you think.</p>
]]></content:encoded></item><item><title>Scripting Games 2013: Event 4 Notes</title><link>https://powershell.org/articles/2013-05-23-scripting-games-2013-event-4-notes/</link><guid>https://powershell.org/articles/2013-05-23-scripting-games-2013-event-4-notes/</guid><pubDate>Fri, 24 May 2013 01:21:11 +0000</pubDate><description>&lt;p&gt;It is all downhill from here folks! Event 4 is in the books and we only have 2 more to go! Everyone has been doing an outstanding job with their submissions and it is becoming clear that people are learning new things and showing some great techniques with their code.&lt;br&gt;
Of course, this doesn&amp;rsquo;t mean that there isn&amp;rsquo;t room for improvement with some submissions to make them even better or just some simple mistakes that can be cleaned up to make average submissions into amazing submissions. With that, its time to dive into my notes&amp;quot;¦ You can check out the rest of this article &lt;a href="http://learn-powershell.net/2013/05/23/scripting-games-2013-event-4-notes/"&gt;here&lt;/a&gt;.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>It is all downhill from here folks! Event 4 is in the books and we only have 2 more to go! Everyone has been doing an outstanding job with their submissions and it is becoming clear that people are learning new things and showing some great techniques with their code.<br>
Of course, this doesn&rsquo;t mean that there isn&rsquo;t room for improvement with some submissions to make them even better or just some simple mistakes that can be cleaned up to make average submissions into amazing submissions. With that, its time to dive into my notes"¦ You can check out the rest of this article<a href="http://learn-powershell.net/2013/05/23/scripting-games-2013-event-4-notes/">here</a>.</p>
]]></content:encoded></item><item><title>Event 4 Notes</title><link>https://powershell.org/articles/2013-05-23-event-4-notes/</link><guid>https://powershell.org/articles/2013-05-23-event-4-notes/</guid><pubDate>Thu, 23 May 2013 15:10:15 +0000</pubDate><description>&lt;p&gt;Loved seeing &lt;strong&gt;[OutputType([PSObject])]&lt;/strong&gt; in an entry this morning&amp;hellip; that helps the help system document what your script produces. It&amp;rsquo;s a shame it doesn&amp;rsquo;t work well with custom type names (since those are a bit of a fake-out on the object), but it&amp;rsquo;s an attention to detail I appreciate.&lt;br&gt;
I &lt;strong&gt;am&lt;/strong&gt; seeing a little bit of misunderstandings. Keep in mind that the lastLogonTimestamp attribute in AD is the one that replicates, although there is a long possible delay in that replication. There are other &amp;ldquo;last logged on&amp;rdquo; attributes that &lt;em&gt;don&amp;rsquo;t&lt;/em&gt; replicate so you can&amp;rsquo;t rely on them unless you&amp;rsquo;re querying every DC (pretty inefficient).&lt;br&gt;
Hey, one thing to think about: sometimes simpler is better. For example, instead of adding a dozen lines to check and see if a module exists and can be loaded, just add a #requires comment for that module. Let the shell do that work and spew an error if the module isn&amp;rsquo;t present. It&amp;rsquo;ll even force-load the module into memory. Saves lots of steps.&lt;br&gt;
Hey, don&amp;rsquo;t declare functions as &lt;strong&gt;global:Do-This&lt;/strong&gt;. It&amp;rsquo;s a neat trick, but you&amp;rsquo;re polluting the shell&amp;rsquo;s global scope. Plan to write in-scope functions and make them a script module, so they can be loaded and unloaded. From the Games perspective, &amp;ldquo;whatever,&amp;rdquo; but in the real world&amp;hellip; don&amp;rsquo;t pollute the global scope.&lt;br&gt;
A comment I saw: &amp;ldquo;You should check to make sure the module isn&amp;rsquo;t loaded before loading it again.&amp;rdquo; Disagree. The shell does this for you when you use Import-Module. But, doc your module dependency in a #requires, and you won&amp;rsquo;t have to worry about the module. In fact, the whole theme of &amp;ldquo;checking to see if the AD module is loaded&amp;rdquo; appears to be a major point of commenting. I&amp;rsquo;m a fan of &amp;ldquo;easier&amp;rdquo; and a 1-line &lt;strong&gt;#requires -module ActiveDirectory&lt;/strong&gt; is far easier to write and maintain than, say, and entire function designed specifically to load the ActiveDirectory module.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Loved seeing <strong>[OutputType([PSObject])]</strong> in an entry this morning&hellip; that helps the help system document what your script produces. It&rsquo;s a shame it doesn&rsquo;t work well with custom type names (since those are a bit of a fake-out on the object), but it&rsquo;s an attention to detail I appreciate.<br>
I <strong>am</strong> seeing a little bit of misunderstandings. Keep in mind that the lastLogonTimestamp attribute in AD is the one that replicates, although there is a long possible delay in that replication. There are other &ldquo;last logged on&rdquo; attributes that <em>don&rsquo;t</em> replicate so you can&rsquo;t rely on them unless you&rsquo;re querying every DC (pretty inefficient).<br>
Hey, one thing to think about: sometimes simpler is better. For example, instead of adding a dozen lines to check and see if a module exists and can be loaded, just add a #requires comment for that module. Let the shell do that work and spew an error if the module isn&rsquo;t present. It&rsquo;ll even force-load the module into memory. Saves lots of steps.<br>
Hey, don&rsquo;t declare functions as <strong>global:Do-This</strong>. It&rsquo;s a neat trick, but you&rsquo;re polluting the shell&rsquo;s global scope. Plan to write in-scope functions and make them a script module, so they can be loaded and unloaded. From the Games perspective, &ldquo;whatever,&rdquo; but in the real world&hellip; don&rsquo;t pollute the global scope.<br>
A comment I saw: &ldquo;You should check to make sure the module isn&rsquo;t loaded before loading it again.&rdquo; Disagree. The shell does this for you when you use Import-Module. But, doc your module dependency in a #requires, and you won&rsquo;t have to worry about the module. In fact, the whole theme of &ldquo;checking to see if the AD module is loaded&rdquo; appears to be a major point of commenting. I&rsquo;m a fan of &ldquo;easier&rdquo; and a 1-line <strong>#requires -module ActiveDirectory</strong> is far easier to write and maintain than, say, and entire function designed specifically to load the ActiveDirectory module.</p>
]]></content:encoded></item><item><title>Judge notes for Event 4</title><link>https://powershell.org/articles/2013-05-23-judge-notes-for-event-4/</link><guid>https://powershell.org/articles/2013-05-23-judge-notes-for-event-4/</guid><pubDate>Thu, 23 May 2013 14:56:59 +0000</pubDate><description>&lt;p&gt; Wow! That&amp;rsquo;s the only word I can think of to describe the submissions this time. I&amp;rsquo;m really impressed with the approaches taken to solve this problem. The only thing that could have been better is quitting when the ActiveDirectory module or the Quest snapin weren&amp;rsquo;t found. I chalked that up to not having experience with an actual audit where no answer is not acceptable, so I didn&amp;rsquo;t count against it when evaluating the scripts. But, on this point kudos to the one script that tested for the AD module, then the Quest snapin, and fell back to the ADSI accelerator if neither were found.&lt;br&gt;
&lt;strong&gt;Beginner entries&lt;/strong&gt;&lt;br&gt;
For me, the best entries were those that had the shortest pipelines. Those of you who used &lt;em&gt;Get-Random -Count 20 -InputObject (Get-ADUser&amp;hellip;) | Select &amp;hellip; | ConvertTo-Html | Out-File&lt;/em&gt; had the shortest. And those who used &lt;em&gt;Get-ADUser | Get-Random -Count 20&lt;/em&gt; were a close second.&lt;br&gt;
A couple of entries had something that at first I thought was silly. But, instead, it offers a learning opportunity. Here&amp;rsquo;s the code fragment: &lt;em&gt;Get-ADUser -Filter {ObjectClass -eq &amp;lsquo;User&amp;rsquo;}&lt;/em&gt;. Paying attention to what the cmdlet does saves a lot of typing, not only here where the filter is redundant, but also when entering other parameters. For example, a similar extra effort occurs when default properties are explicitly listed in a -Properties parameter.&lt;br&gt;
&lt;strong&gt;Advanced entries&lt;/strong&gt;&lt;br&gt;
As mentioned, the best entries were those that fell back to the [ADSI] accelerator when the AD module or the Quest snapin weren&amp;rsquo;t found. Making this kind of check and fallback is pretty important when responding to audit requests. This reminds me of a case where I actually had to respond to an audit request with the actual last logon date in a domain with mixed W2K3, W2K8, and W2K8R2 domain controllers. The default choice was to use the AD module, but since we had to check each domain controller (there were 72 of them), it turned out to be a real pain determining which method to use on each of them. In the end, we decided to install the Quest tools on the audit server and just avoid the issue.&lt;br&gt;
There were several different methods used to verify the presence of the AD module before trying to load it. Most of them were actually more work that really necessary. The reason for this is that the Import-Module cmdlet does not return an error if the module has already been loaded. Thus, the easiest test would be:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p> Wow! That&rsquo;s the only word I can think of to describe the submissions this time. I&rsquo;m really impressed with the approaches taken to solve this problem. The only thing that could have been better is quitting when the ActiveDirectory module or the Quest snapin weren&rsquo;t found. I chalked that up to not having experience with an actual audit where no answer is not acceptable, so I didn&rsquo;t count against it when evaluating the scripts. But, on this point kudos to the one script that tested for the AD module, then the Quest snapin, and fell back to the ADSI accelerator if neither were found.<br><strong>Beginner entries</strong><br>
For me, the best entries were those that had the shortest pipelines. Those of you who used<em>Get-Random -Count 20 -InputObject (Get-ADUser&hellip;) | Select &hellip; | ConvertTo-Html | Out-File</em> had the shortest. And those who used<em>Get-ADUser | Get-Random -Count 20</em> were a close second.<br>
A couple of entries had something that at first I thought was silly. But, instead, it offers a learning opportunity. Here&rsquo;s the code fragment:<em>Get-ADUser -Filter {ObjectClass -eq &lsquo;User&rsquo;}</em>. Paying attention to what the cmdlet does saves a lot of typing, not only here where the filter is redundant, but also when entering other parameters. For example, a similar extra effort occurs when default properties are explicitly listed in a -Properties parameter.<br><strong>Advanced entries</strong><br>
As mentioned, the best entries were those that fell back to the [ADSI] accelerator when the AD module or the Quest snapin weren&rsquo;t found. Making this kind of check and fallback is pretty important when responding to audit requests. This reminds me of a case where I actually had to respond to an audit request with the actual last logon date in a domain with mixed W2K3, W2K8, and W2K8R2 domain controllers. The default choice was to use the AD module, but since we had to check each domain controller (there were 72 of them), it turned out to be a real pain determining which method to use on each of them. In the end, we decided to install the Quest tools on the audit server and just avoid the issue.<br>
There were several different methods used to verify the presence of the AD module before trying to load it. Most of them were actually more work that really necessary. The reason for this is that the Import-Module cmdlet does not return an error if the module has already been loaded. Thus, the easiest test would be:</p><p><code>Try { Import-Module ActiveDirectory -ErrorAction Stop $Users = Get-ADUser ... } Catch { Write-Error "AD Module not available" # Fall back to ADSI to get User data }</code>The same is true for Add-PSSnapin for PowerShell 3, but in V2, it generates an error with &ldquo;because it is already added&rdquo; in $Error[0].Exception.Message. So, you can use something similar to check for that.<br>
To close out this set of comments, here&rsquo;s something to think about. The topic is embedded, or local, functions in a master function. Question 1: should you even go through the trouble of writing a local function if it&rsquo;s only going used one time? Question 2: since the local function will execute in a controlled environment, does it need to be an advanced function with comments and parameter validation, or would a simple function make more sense?<br>
Until next time: keep up the great work!!</p>
]]></content:encoded></item><item><title>Want a premier PowerShell class in your area next year? Help me make it happen.</title><link>https://powershell.org/articles/2013-05-23-want-a-premier-powershell-class-in-your-area-next-year-help-me-make-it-happen/</link><guid>https://powershell.org/articles/2013-05-23-want-a-premier-powershell-class-in-your-area-next-year-help-me-make-it-happen/</guid><pubDate>Thu, 23 May 2013 14:18:50 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;re putting together our schedule for 2014 (yes, already), and we&amp;rsquo;re looking to hold premier-level PowerShell master classes throughout the world. But&amp;hellip; we need your help.&lt;br&gt;
If you&amp;rsquo;ve got a really top-notch training center in your area that might be interested in working with us, &lt;a href="https://powershell.org/contact-us/"&gt;contact me&lt;/a&gt;. We&amp;rsquo;ll need the name of someone there - the training manager, the marketing manager, someone like that. We co-market our classes, but rely on a local center to market to their existing customer base as well. These &lt;em&gt;are&lt;/em&gt; premium classes, and they do go for a premium price, so the center has to be comfortable marketing that kind of class. We&amp;rsquo;re not the run-of-the-mill &amp;ldquo;official curriculum;&amp;rdquo; my Master Class packs in around eleven days of &amp;ldquo;normal&amp;rdquo; training, covering toolmaking, scripting, and advanced topics as well as the introductory-level stuff. _&lt;br&gt;
_&lt;br&gt;
International contacts are fine, and in fact it&amp;rsquo;s something I&amp;rsquo;m excited to get going, as international classes also help me set up future PowerShell Forum and PowerShell Saturday events in a country or region.&lt;br&gt;
So think about your area and see if we might be a fit, and if you&amp;rsquo;ve got a really top-notch training center you can put us in touch with!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;re putting together our schedule for 2014 (yes, already), and we&rsquo;re looking to hold premier-level PowerShell master classes throughout the world. But&hellip; we need your help.<br>
If you&rsquo;ve got a really top-notch training center in your area that might be interested in working with us,<a href="https://powershell.org/contact-us/">contact me</a>. We&rsquo;ll need the name of someone there - the training manager, the marketing manager, someone like that. We co-market our classes, but rely on a local center to market to their existing customer base as well. These <em>are</em> premium classes, and they do go for a premium price, so the center has to be comfortable marketing that kind of class. We&rsquo;re not the run-of-the-mill &ldquo;official curriculum;&rdquo; my Master Class packs in around eleven days of &ldquo;normal&rdquo; training, covering toolmaking, scripting, and advanced topics as well as the introductory-level stuff. _<br>
_<br>
International contacts are fine, and in fact it&rsquo;s something I&rsquo;m excited to get going, as international classes also help me set up future PowerShell Forum and PowerShell Saturday events in a country or region.<br>
So think about your area and see if we might be a fit, and if you&rsquo;ve got a really top-notch training center you can put us in touch with!</p>
]]></content:encoded></item><item><title>Jan Egil's Event 4 Notes</title><link>https://powershell.org/articles/2013-05-22-jan-egils-event-4-notes/</link><guid>https://powershell.org/articles/2013-05-22-jan-egils-event-4-notes/</guid><pubDate>Wed, 22 May 2013 15:47:46 +0000</pubDate><description>&lt;p&gt;Jan offers some perspective on Event 4 at &lt;a href="http://blog.powershell.no/2013/05/22/2013-scripting-games-learning-points-from-event-4/"&gt;http://blog.powershell.no/2013/05/22/2013-scripting-games-learning-points-from-event-4/&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Jan offers some perspective on Event 4 at <a href="http://blog.powershell.no/2013/05/22/2013-scripting-games-learning-points-from-event-4/">http://blog.powershell.no/2013/05/22/2013-scripting-games-learning-points-from-event-4/</a></p>
]]></content:encoded></item><item><title>ValidateScript for Beginners</title><link>https://powershell.org/articles/2013-05-21-validatescript-for-beginners/</link><guid>https://powershell.org/articles/2013-05-21-validatescript-for-beginners/</guid><pubDate>Tue, 21 May 2013 18:03:27 +0000</pubDate><description>&lt;p&gt;There&amp;quot;™s been a lot of chatter about in Scripting Games 2013 blog posts about the ValidateScript attribute. The chatter is, appropriately, confined to the advanced events &amp;ldquo;“ this sort of thing is not expected in a one-liner. But I thought I&amp;rdquo;™d take a minute and demystify it &amp;ldquo;“ and discuss an issue that it raises about when input should be rejected.&lt;br&gt;
Let&amp;rdquo;™s start with a quick description of ValidateScript and its siblings. For help, see &lt;a href="http://go.microsoft.com/fwlink/?LinkID=135173"&gt;about_functions_advanced_parameters&lt;/a&gt;.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>There"™s been a lot of chatter about in Scripting Games 2013 blog posts about the ValidateScript attribute. The chatter is, appropriately, confined to the advanced events &ldquo;“ this sort of thing is not expected in a one-liner. But I thought I&rdquo;™d take a minute and demystify it &ldquo;“ and discuss an issue that it raises about when input should be rejected.<br>
Let&rdquo;™s start with a quick description of ValidateScript and its siblings. For help, see<a href="http://go.microsoft.com/fwlink/?LinkID=135173">about_functions_advanced_parameters</a>.</p><h2 id="what-is-validatescript" class="ps-heading">What is ValidateScript?<a class="ps-heading-anchor" href="#what-is-validatescript" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>ValidateScript and its siblings are<em>parameter validation attributes</em>. These attributes are statements that are added to the parameter definition. They tell Windows PowerShell to examine the parameter values that are used when the function is called and determine whether the parameter values meet some specified conditions. In particular, ValidateScript lets you write a script block to test the conditions that the values must satisfy. Windows PowerShell runs the validation script on the parameter values and, if the script returns $False, it throws a terminating error.<br>
Before we get to the details, let"™s talk about why you"™d want to use something like this. The answer is simplicity. &ldquo;What!!?!,&rdquo; you say, incredulously? The syntax of this thing looks like a sampler of Windows PowerShell enclosures. There"™s a square bracket &ldquo;[&rdquo; or two &ldquo;]&rdquo;, a pair of parentheses &ldquo;( )&rdquo; and even some curly braces &ldquo;{  }&rdquo;. So it doesn"™t look simple.<br>
But once you get over the syntax, you realize that putting the parameter value validation into the parameter definition means that you don"™t need to test the parameter value in your script. Instead, the Windows PowerShell engine tests the parameter value and you can use the script to do scripty things.</p><h1 id="using-validatescript" class="ps-heading">Using ValidateScript<a class="ps-heading-anchor" href="#using-validatescript" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>Here"™s what I mean. Here"™s a silly function that will serve as our example.</p><p><code>function Get-EventDate { Param($EventDate) if ($EventDate -is [DateTime] -and $EventDate -gt (Get-Date)) {"The event is happening on $EventDate."} else {Write-Error "Event date must be a DateTime object</code>
that represents a date in the future."}
}
`The Get-EventDate function has a $EventDate parameter. If the value of the $EventDate parameter is a DateTime object and it"™s later than now, the function writes a nice sentence with the date to the console or host program. But, if the value of $EventDate is not a DateTime object, or it"™s not a future date, the function generates an error. (To be complete, this info would be in the Help for the function.)<br>
But much of this little function is wrapped around validating the value of the $EventDate parameter. So let"™s see if we can get Windows PowerShell to validate it for us.<br>
In this version, we add a parameter value type enclosed in square brackets ([DateTime]) on the line before the parameter name ($EventDate).<br>
But that"™s enough to allow us to delete the &ldquo;if $EventDate &ldquo;“is [DateTime]&rdquo; from the If statement and from the error message.</p><p><code>function Get-EventDate { Param( [DateTime] $EventDate ) if ($EventDate -gt (Get-Date)) {"The event is happening on $EventDate."} else { Write-Error "Event date must represents a future date."} }</code>Let&rdquo;™s make sure it works. I"™ll send it a process object instead of a date. And, sure enough, Windows PowerShell generates an error explaining that it can"™t convert (&ldquo;process argument transformation&rdquo; &ldquo;“ oy!) a process object to a DateTime object.</p><p>`PS C:&gt; Get-EventDate -EventDate (Get-Process PowerShell)
Get-EventDate : Cannot process argument transformation on parameter
&lsquo;EventDate&rsquo;. Cannot convert the &ldquo;System.Diagnostics.Process (powershell)&rdquo;
value of type &ldquo;System.Diagnostics.Process&rdquo; to type &ldquo;System.DateTime&rdquo;.
At line:15 char:26</p><ul><li>Get-EventDate -EventDate (Get-Process PowerShell)
+                          ~~~~~~~~~~~~~~~~~~~~~~~~</li><li>CategoryInfo          : InvalidData: (:) [Get -EventDate],
ParameterBindingArgumentTransformationException</li><li>FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-EventDate
`Now, let&rdquo;™s get Windows PowerShell to test the other date condition for us. Here"™s where ValidateScript comes in.<br>
The syntax is a bit wonky. ValidateScript is enclosed in square brackets: [ValidateScript]. Its parameter is enclosed in parentheses: [ValidateScript( )] and the parameter value is a script block, complete with curly braces: [ValidateScript({ Your-script-goes-here })]. I can never remember this, so I use an ISE snippet or copy it from<a href="http://go.microsoft.com/fwlink/?LinkID=135173">about_functions_advanced_parameters</a>.<br>
But aside from the syntax, ValidateScript is easy to use. I just moved the (-gt (Get-Date)) from the script into the ValidateScript script block. Now, I can eliminate the error message, too.<br>
In the script block, &ldquo;$<em>&rdquo; represents the parameter value. If a parameter takes a collection (more than one) of objects, &ldquo;$</em>&rdquo; represents each value in the collection, which is tested one at a time &ldquo;“ no need for a Foreach-Object command.</li></ul><p><code>function Get-EventDate { Param( [ValidateScript({$_ -gt (Get-Date)})] [DateTime] $EventDate ) "The event is happening on $EventDate." }</code>When a parameter value fails a test, ValidateScript generates a terminating error. If the parameter value takes a collection, like a list of dates, and any one of the dates fails the test, ValidateScript throws an error that stops the script, even if all other dates pass the test.<br>
Let&rdquo;™s test by sending it a date in the past. (Today"™s date would generate the same error.) The error message explains (in more words that I could use) that the date failed the validation test.<br>
It"™s not a great error message, but it"™s the best we could do, because Windows PowerShell just executes the validation script in the script block. It can"™t guess your intent.</p><p>`PS C:&gt; Get-EventDate -EventDate (Get-Date -Month 9 -Day 21 -Year 2007)
Get-EventDate : Cannot validate argument on parameter &lsquo;EventDate&rsquo;.
The &ldquo;$_ -gt (Get-Date)&rdquo; validation script for the argument with value
&ldquo;9/21/2007 5:36:36 PM&rdquo; did not return true. Determine why the validation
script failed and then try the command again.
At line:1 char:26</p><ul><li>Get-EventDate -EventDate (Get-Date -Month 9 -Day 21 -Year 2007)
+                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</li><li>CategoryInfo          : InvalidData: (:) [Get-EventDate], ParameterBindingValidationException</li><li>FullyQualifiedErrorId : ParameterArgumentValidationError,Get-EventDate
`And, just for kicks, let"™s pass it a date in the future. This one works.</li></ul><p><code>PS C:\ &gt; Get-EventDate -EventDate (Get-Date -Month 9 -Day 21 -Year 2013) The event is happening on 09/21/2013 18:00:50.</code>## ValidateScript in Advanced Functions</p><p>This is the sort of clever thing that the advanced folks are doing. For example, here"™s the parameter section from Toni"™s totally terrific Archival Atrocity solution.</p><p><code>[CmdletBinding()] param( [ValidateScript({ Test-Path $_ -PathType Container })] [string]$LogPath="C:\Application\Log", [Parameter(Mandatory=$true)] [ValidateScript({ Test-Path "$LogPath\*" -Include $_ -PathType Container })] [string[]]$ApplicationLogFolder, [Parameter(Mandatory=$true)] [ValidateScript({ Test-Path $_ -PathType Container })] [string]$DestinationPath, [int]$Period=90 )</code>We"™re not even in the function statements yet, but we already know for sure that the values of the $LogPath, $ApplicationLog, and DestinationPath parameters are folders (not files), and the full path to these folders already exists in the file system. Not bad! Excellent, really. Clever enough to win second prize in the Nobel Prizes of PowerShell scripting. (Congratulations, Toni!)<br>
In fact, almost all of the advanced scripts used validation parameters. Take a peek. Keep a copy of<a href="http://go.microsoft.com/fwlink/?LinkID=135173">about_functions_advanced_parameters</a> nearby.</p><h2 id="should-we-use-validatescript" class="ps-heading">Should we use ValidateScript?<a class="ps-heading-anchor" href="#should-we-use-validatescript" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>This is very clever scripting, but is it a good idea? It"™s easier for the author and easier to maintain, because the conditions are in a predictable place.<br>
But, is this the right thing to do for users? I don"™t know the answer, but I think that we, as a community, need to consider the question.<br>
Jeffrey Snover, the Windows PowerShell grand architect, wisely proclaims that Windows PowerShell differs from other languages in that scripts should &ldquo;just work.&rdquo; Windows PowerShell scripts should make the user successful.<br>
The language goes to all ends in its pursuit of this principle. When you send the wrong type of parameter value to a cmdlet, Windows PowerShell tries to convert the value to the right type. It returns an error only when its attempts to convert fail.<br>
In Windows PowerShell 3.0, if you send it a collection of object and ask for a property that the collection doesn"™t have, Windows PowerShell checks to see if the objects in the collection have that property and, if they do, it returns the property value. (Try: (Get-Process).Name ).<br>
If you ask Windows PowerShell 3.0 how many items are in an empty object, it tells you 0, even though empty objects don"™t have a Count or Length property.</p><p><code>PS C:\&gt; $zoo = $null PS C:\&gt; $zoo.Count 0</code>Many scripts, including those we"™ve seen in these esteemed Games, have elaborate try-catch syntax to capture errors and create a pleasant user experience.<br>
So, given that background, should we encourage scripting techniques that throw errors to users, instead of making them successful? And, in particular, errors that cannot provide very helpful error messages?<br>
Personally, I prefer scripts that optimize the user experience, instead of the authoring experience. In the Get-EventDate example, where I planned to write an error anyway, ValidateScript is probably a cleaner alternative. But in the Archival Atrocity script, it would have been a much better user experience to create a directory if it didn"™t already exist.<br>
On the other hand, if I were writing a script only for myself, I would keep it strict. I would prefer the error message to the risk that I just created a directory structure for a typo.<br>
What do you think? Should we create community guidance for using validation attributes?</p>
]]></content:encoded></item><item><title>Scripting Games Event 3 Winners</title><link>https://powershell.org/articles/2013-05-21-scripting-games-event-3-winners/</link><guid>https://powershell.org/articles/2013-05-21-scripting-games-event-3-winners/</guid><pubDate>Tue, 21 May 2013 14:41:53 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;re pleased to announce the winners for Event 3 of The Scripting Games 2013!&lt;br&gt;
Winners: You can log into &lt;a href="http://scriptinggames.org/"&gt;The Scripting Games Web site&lt;/a&gt; and go to your Profile page to see your prize. You will be given a prize redemption code and either a URL where you can redeem it, or an e-mail address of the prize provider (they will need the redemption code). All prizes must be claimed by the end of July 2013. I will list winners by username; if you used your e-mail address as your username, then a portion of that will be truncated for your privacy. Anyone can log in and check their Profile page to see if they&amp;rsquo;ve won a prize.&lt;br&gt;
&lt;strong&gt;Note:&lt;/strong&gt; Our hosting company is doing some maintenance on their admin site, so it may be a day or two before redemption codes appear in your Scripting Games profile. Appreciate your patience.&lt;br&gt;
And seriously, you&amp;rsquo;re killing me with the usernames. Heh.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;re pleased to announce the winners for Event 3 of The Scripting Games 2013!<br>
Winners: You can log into<a href="http://scriptinggames.org/">The Scripting Games Web site</a> and go to your Profile page to see your prize. You will be given a prize redemption code and either a URL where you can redeem it, or an e-mail address of the prize provider (they will need the redemption code). All prizes must be claimed by the end of July 2013. I will list winners by username; if you used your e-mail address as your username, then a portion of that will be truncated for your privacy. Anyone can log in and check their Profile page to see if they&rsquo;ve won a prize.<br><strong>Note:</strong> Our hosting company is doing some maintenance on their admin site, so it may be a day or two before redemption codes appear in your Scripting Games profile. Appreciate your patience.<br>
And seriously, you&rsquo;re killing me with the usernames. Heh.</p><ul><li><p>Event 3 Beginner First Place: TechieSponge (free ebook from Manning)</p></li><li><p>Event 3 Beginner Second Place: LittleBunnyFooFoo (6 months video training from Interface)</p></li><li><p>Event 3 Beginner Third Place: chadmcauley (1 year of Phoneominal from Start-Automating)</p></li><li><p>Event 3 Advanced First Place: glenn.faustino (free ebook from Manning)</p></li><li><p>Event 3 Advanced Second Place: mikefrobbins (6 months video training from Interface)</p></li><li><p>Event 3 Advanced Third Place: CarloM (1 year of Phonenominal from Start-Automating)</p></li><li><p>Event 3 Beginner Top CrowdScore: LittleBunnyFooFoo (free ebook from Manning)</p></li><li><p>Event 3 Advanced Top CrowdScore: mikefrobbins (free ebook from Manning)</p></li></ul><p>These will be listed on our<a href="http://scriptinggames.org/winners.php">consolidated list of winners</a>, which includes links to the winning entries.<br>
Our CrowdScore winners get a selection of free ebooks from Manning, 1 month of video training from Interface, and $50 gift cards from SAPIEN; 1 prize per winner. Check your profile to see if you&rsquo;ve won!<br>
Congratulations to all of our winners! Note that our top three prizes in each category were awarded by our Mighty Panel of Celebrity Judges. Each judge nominated a first, second, and third place winner from the entries that our expert commentators identified as &ldquo;best.&rdquo; Those nominations were compiled, and in the event of a tie the earliest entry was deemed winner.</p>
]]></content:encoded></item><item><title>Some Event 3 Notes</title><link>https://powershell.org/articles/2013-05-18-some-event-3-notes/</link><guid>https://powershell.org/articles/2013-05-18-some-event-3-notes/</guid><pubDate>Sat, 18 May 2013 14:23:25 +0000</pubDate><description>&lt;p&gt;I didn&amp;rsquo;t see anyone (although I&amp;rsquo;ll admit I haven&amp;rsquo;t checked every entry) using my EnhancedHTML module from &lt;em&gt;Creating HTML Reports in PowerShell.&lt;/em&gt; I am ensaddened.&lt;br&gt;
But man, Event 3 shows that you can really do well by learning a wee bit of HTML. Knowing an H2 and HR tag makes for much pretty results. Take it as career advice.&lt;br&gt;
As a nitpick, don&amp;rsquo;t use Convert as a function verb unless all the function is going to do is convert something. It shouldn&amp;rsquo;t &amp;ldquo;Get&amp;rdquo; as well. That said, because this event wants a single function that both gets and converts&amp;hellip; which is something I&amp;rsquo;d ordinarily avoid packing into one function&amp;hellip; no big. It&amp;rsquo;s interesting to see the function names folks picked out.&lt;br&gt;
Folks, &lt;strong&gt;test your scripts.&lt;/strong&gt; Seriously.&lt;br&gt;
I kinda giggled when I saw this comment in an entry:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I didn&rsquo;t see anyone (although I&rsquo;ll admit I haven&rsquo;t checked every entry) using my EnhancedHTML module from<em>Creating HTML Reports in PowerShell.</em> I am ensaddened.<br>
But man, Event 3 shows that you can really do well by learning a wee bit of HTML. Knowing an H2 and HR tag makes for much pretty results. Take it as career advice.<br>
As a nitpick, don&rsquo;t use Convert as a function verb unless all the function is going to do is convert something. It shouldn&rsquo;t &ldquo;Get&rdquo; as well. That said, because this event wants a single function that both gets and converts&hellip; which is something I&rsquo;d ordinarily avoid packing into one function&hellip; no big. It&rsquo;s interesting to see the function names folks picked out.<br>
Folks,<strong>test your scripts.</strong> Seriously.<br>
I kinda giggled when I saw this comment in an entry:</p><p><code># I'd like to Splat this but I don't know how / ran out of time</code>Heh. In general, this is like a cooking show. If you know your food doesn&rsquo;t taste good, don&rsquo;t bring it to the judges. And if you do bring it to them, don&rsquo;t tell them all the cool toppings you were going to add. Just give them what you made.<br>
Note to self: Don&rsquo;t write scenarios that require HTML. It messes up the Scripting Games Web site. Duh.<br>
You know, overall, I&rsquo;m seeing good stuff. I ran through some of the low-scoring entries and didn&rsquo;t see anything that didn&rsquo;t deserve a lowered score. If you constructed your own HTML instead of using ConvertTo-HTML, you pretty much got universally dinged, and I can understand and support that philosophy.<br>
Oh, and ConvertTo-HTML doesn&rsquo;t output to stdout, whoever wrote that. It writes to the pipeline. Big difference.<br>
Folks, when using Get-WmiObject,<em>use the -Filter parameter.</em> Don&rsquo;t get<em>everything</em> and pipe it to Where-Object. Get the filtering done early - this is a huge performance concept.<br>
This was interesting:</p><p><code>[Parameter(Mandatory=$True,ValueFromPipeline=$True)] [ValidateScript({Test-Connection -ComputerName $_ -Quiet -Count 2})] [STRING[]]$ComputerName,</code>I&rsquo;m entirely unsure how I feel about this. I like the idea. I keep telling people than a Ping doesn&rsquo;t really tell you anything when you&rsquo;re about to use WMI, though. If the computer responds, WMI might still fail; if the computer doesn&rsquo;t respond, WMI might still succeed. A ping is not useful diagnostic information for WMI connections. I understand the desire to try and eliminate the WMI timeout, but you&rsquo;re not doing so. What if I block ICMP traffic but not WMI traffic - a very common thing at a lot of my clients? Just bear that in mind.<br>
We&rsquo;re done with Hungarian notation ($objDisk, $strComputer). Time to move on.<br>
Commenters: Dudes, you need to read. For example, this:</p><blockquote><p>When localhost, an IP address, or an alias is provided, the actual computer name is not displayed on the web page and the file name is also incorrect. Consider using one of the properties from the WMI class that has the computer name instead of what the user provided on input.</p></blockquote><p>Was next to a 1-star vote. Totally inappropriate. 1 star, as the voting page clearly indicates, is when the script is totally non-functional. &ldquo;Bad entry - does not function at all&rdquo; is what it says under 1 star. This comment was on a working script. Maybe it didn&rsquo;t fulfill every requirement, but seriously, you&rsquo;d<em>fire a guy</em> whose script simply put an IP address instead of a computer name? No. This was a 3-star script according to the guidelines.<br>
Anyway&hellip; things are looking great. On to Event 4, which opens for voting real soon!</p>
]]></content:encoded></item><item><title>Your Weekend Games Report</title><link>https://powershell.org/articles/2013-05-18-your-weekend-games-report/</link><guid>https://powershell.org/articles/2013-05-18-your-weekend-games-report/</guid><pubDate>Sat, 18 May 2013 14:05:18 +0000</pubDate><description>&lt;p&gt;It&amp;rsquo;s been a crazy-busy week for me, so I&amp;rsquo;m just getting caught up here. I&amp;rsquo;m off observing the beta-teach of the new 10961A PowerShell 3 class in Phoenix next week, but I&amp;rsquo;ll be keeping an eye on the Games.&lt;br&gt;
So let&amp;rsquo;s run some numbers.&lt;br&gt;
The Games have 2092 users at present, along with 10960 scores and 5412 comments. There are 849 total entries.&lt;br&gt;
Regarding Event 3, we have 109 Advanced entries and 122 Beginner entries. The average beginner score is 2.8416, and the advanced score is 2.8512. Darn close.&lt;br&gt;
Site traffic is up to 25,000 visits from 18,200 unique visitors, for a total of 56,000 page views and a poo-load of bandwidth. I should have Event 3 winners posted on Tuesday sometime.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>It&rsquo;s been a crazy-busy week for me, so I&rsquo;m just getting caught up here. I&rsquo;m off observing the beta-teach of the new 10961A PowerShell 3 class in Phoenix next week, but I&rsquo;ll be keeping an eye on the Games.<br>
So let&rsquo;s run some numbers.<br>
The Games have 2092 users at present, along with 10960 scores and 5412 comments. There are 849 total entries.<br>
Regarding Event 3, we have 109 Advanced entries and 122 Beginner entries. The average beginner score is 2.8416, and the advanced score is 2.8512. Darn close.<br>
Site traffic is up to 25,000 visits from 18,200 unique visitors, for a total of 56,000 page views and a poo-load of bandwidth. I should have Event 3 winners posted on Tuesday sometime.</p>
]]></content:encoded></item><item><title>Meet the Scripting Games Judges: Olver Lipkau</title><link>https://powershell.org/articles/2013-05-18-meet-the-scripting-games-judges-olver-lipkau/</link><guid>https://powershell.org/articles/2013-05-18-meet-the-scripting-games-judges-olver-lipkau/</guid><pubDate>Sat, 18 May 2013 13:36:13 +0000</pubDate><description>&lt;p&gt;I have been working for AtoS, formaly Siemens IT Solutions and Services, for 6 years as a IT Consultant.&lt;br&gt;
I was 15 when I started scripting. First only batch scripts to automate simple things. With time the scriptt grew in complexity and languages. VBS, AutoIt, AHK and finally PowerShell, which superseeded all others. PowerShell became a passion and became more and more a daily thing.&lt;br&gt;
I was invited to be a judge for the Scripting Games in 2011, 2012 and now 2013.&lt;br&gt;
You are welcome to visit my Blog at &lt;a href="http://oliver.lipkau.net/blog"&gt;http://oliver.lipkau.net/blog&lt;/a&gt; and check out what I have been up to.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I have been working for AtoS, formaly Siemens IT Solutions and Services, for 6 years as a IT Consultant.<br>
I was 15 when I started scripting. First only batch scripts to automate simple things. With time the scriptt grew in complexity and languages. VBS, AutoIt, AHK and finally PowerShell, which superseeded all others. PowerShell became a passion and became more and more a daily thing.<br>
I was invited to be a judge for the Scripting Games in 2011, 2012 and now 2013.<br>
You are welcome to visit my Blog at<a href="http://oliver.lipkau.net/blog">http://oliver.lipkau.net/blog</a> and check out what I have been up to.</p>
]]></content:encoded></item><item><title>Event 3: My notes…</title><link>https://powershell.org/articles/2013-05-17-event-3-my-notes/</link><guid>https://powershell.org/articles/2013-05-17-event-3-my-notes/</guid><pubDate>Fri, 17 May 2013 21:56:13 +0000</pubDate><description>&lt;p&gt;I&amp;rsquo;m almost done judging event 3, perfect time to share few thoughts about things I&amp;rsquo;ve seen in this event. A lot of great entries, but still few things that could have been done (in my opinion) better. If you want to know my general opinion - you can read it either in &lt;a href="http://becomelotr.wordpress.com/2013/05/17/event-3-my-notes/"&gt;English&lt;/a&gt; or in &lt;a href="http://powershellpl.net/2013/05/17/scripting-games-moje-notatki-3/"&gt;Polish&lt;/a&gt;. Enjoy!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I&rsquo;m almost done judging event 3, perfect time to share few thoughts about things I&rsquo;ve seen in this event. A lot of great entries, but still few things that could have been done (in my opinion) better. If you want to know my general opinion - you can read it either in<a href="http://becomelotr.wordpress.com/2013/05/17/event-3-my-notes/">English</a> or in<a href="http://powershellpl.net/2013/05/17/scripting-games-moje-notatki-3/">Polish</a>. Enjoy!</p>
]]></content:encoded></item><item><title>Scheduled PowerShell.org Maintenance May 17-18</title><link>https://powershell.org/articles/2013-05-16-scheduled-powershell-org-maintenance-may-17-18/</link><guid>https://powershell.org/articles/2013-05-16-scheduled-powershell-org-maintenance-may-17-18/</guid><pubDate>Fri, 17 May 2013 00:04:59 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;ll be doing some maintenance on the site Friday and Saturday, and it may be down for periods during the maintenance. Don&amp;rsquo;t panic. This will not affect access to The Scripting Games Web site at all.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;ll be doing some maintenance on the site Friday and Saturday, and it may be down for periods during the maintenance. Don&rsquo;t panic. This will not affect access to The Scripting Games Web site at all.</p>
]]></content:encoded></item><item><title>Jan Egil's Event 3 Learning Points</title><link>https://powershell.org/articles/2013-05-16-jan-egils-event-3-learning-points/</link><guid>https://powershell.org/articles/2013-05-16-jan-egils-event-3-learning-points/</guid><pubDate>Thu, 16 May 2013 21:54:14 +0000</pubDate><description>&lt;p&gt;Another judge steps up with some tips! &lt;a href="http://blog.powershell.no/2013/05/16/2013-scripting-games-learning-points-from-event-3/"&gt;http://blog.powershell.no/2013/05/16/2013-scripting-games-learning-points-from-event-3/&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Another judge steps up with some tips!<a href="http://blog.powershell.no/2013/05/16/2013-scripting-games-learning-points-from-event-3/">http://blog.powershell.no/2013/05/16/2013-scripting-games-learning-points-from-event-3/</a></p>
]]></content:encoded></item><item><title>More Updates to the Scripting Games</title><link>https://powershell.org/articles/2013-05-16-more-updates-to-the-scripting-games/</link><guid>https://powershell.org/articles/2013-05-16-more-updates-to-the-scripting-games/</guid><pubDate>Thu, 16 May 2013 20:50:09 +0000</pubDate><description>&lt;p&gt;I&amp;rsquo;ve been making some more programming changes to the Scripting Games, based on folks&amp;rsquo; feedback. &lt;strong&gt;If you run into problems, please notify me via the Feedback Forums link at the bottom of every page on the site.&lt;/strong&gt; Use the email address provided. Don&amp;rsquo;t post a comment here, because I might not see it quickly.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Multiple comments per reviewer -&lt;/strong&gt; you can now leave multiple comments on an entry. Combined with the ability to mark your comment as pertaining to a line or range of lines, this should allow for more granular commenting.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Comment without voting -&lt;/strong&gt; you are now free to offer comments without offering a score.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Delete comments&lt;/strong&gt; - you can now delete the comments you have written.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&amp;rsquo;m still plugging away at some IE9/10-related errors, which are causing the code reviewer/voter/commenter to not display on some entries. In the meantime, Safari, Chrome, and Firefox seem to be working fine.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I&rsquo;ve been making some more programming changes to the Scripting Games, based on folks&rsquo; feedback.<strong>If you run into problems, please notify me via the Feedback Forums link at the bottom of every page on the site.</strong> Use the email address provided. Don&rsquo;t post a comment here, because I might not see it quickly.</p><ul><li><strong>Multiple comments per reviewer -</strong> you can now leave multiple comments on an entry. Combined with the ability to mark your comment as pertaining to a line or range of lines, this should allow for more granular commenting.</li><li><strong>Comment without voting -</strong> you are now free to offer comments without offering a score.</li><li><strong>Delete comments</strong> - you can now delete the comments you have written.</li></ul><p>I&rsquo;m still plugging away at some IE9/10-related errors, which are causing the code reviewer/voter/commenter to not display on some entries. In the meantime, Safari, Chrome, and Firefox seem to be working fine.</p>
]]></content:encoded></item><item><title>Tobias' Notes for Event 3</title><link>https://powershell.org/articles/2013-05-16-tobias-notes-for-event-3/</link><guid>https://powershell.org/articles/2013-05-16-tobias-notes-for-event-3/</guid><pubDate>Thu, 16 May 2013 19:18:04 +0000</pubDate><description>&lt;p&gt;Tobias has some notes for Event 3 for you: &lt;a href="http://www.powertheshell.com/scripting-games-task-3-commentary/"&gt;http://www.powertheshell.com/scripting-games-task-3-commentary/&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Tobias has some notes for Event 3 for you:<a href="http://www.powertheshell.com/scripting-games-task-3-commentary/">http://www.powertheshell.com/scripting-games-task-3-commentary/</a></p>
]]></content:encoded></item><item><title>Judge notes for event 3</title><link>https://powershell.org/articles/2013-05-16-judge-notes-for-event-3/</link><guid>https://powershell.org/articles/2013-05-16-judge-notes-for-event-3/</guid><pubDate>Thu, 16 May 2013 15:33:16 +0000</pubDate><description>&lt;p&gt;This event&amp;rsquo;s entries are impressive. Scoring appears to be higher than in the earlier events, so this one must have been easier to solve. So this time, instead of talking about good and bad scripts, I&amp;rsquo;m going to comment on some of the techniques I saw.&lt;br&gt;
There was some &amp;ldquo;conversation&amp;rdquo; over whether Win32_Volume or Win32_LogicalDisk was the better approach to take. Fact is, either will return the requested data. So it really doesn&amp;rsquo;t matter which one you use. The controversy seemed to include misreading or misunderstanding the requirement of reporting on &amp;ldquo;local hard drives&amp;rdquo;, which implies that you need to use &lt;em&gt;-Filter &amp;ldquo;DriveType=3&amp;rdquo;&lt;/em&gt; (or equivalent) with either to eliminate network or CD/DVD drives.&lt;br&gt;
When passing a Path parameter into a function, it&amp;rsquo;s a good practice to include &lt;em&gt;[ValidateScript ({Test-Path -PathType Container})]&lt;/em&gt; in the definition to avoid having a file name passed in error. Doing the existence test for the path and creating it if necessary in the Begin section of the function would save some time over the various techniques used in the Process section.&lt;br&gt;
One thing to remember when using a CIMSession is to close it when you&amp;rsquo;ve finished using it. A couple other points to pay attention to include accounting for the DCOM/WSMAN options when looking at remote computers and including &lt;em&gt;#requires -version 3&lt;/em&gt; in scripts that might be run by other people on computers that might not have PowerShell 3 installed.&lt;br&gt;
Using a REGEX to validate a string parameter, such as a computer name, isn&amp;rsquo;t a bad idea, but it&amp;rsquo;s important to understand exactly what the match string means. As an example, some of the match strings included a pattern like this: &lt;em&gt;&amp;quot;[a-zA-Z0-9.-]&amp;quot;&lt;/em&gt;. This means all lower and upper case letters, any numeric digit, any character, or a minus sign. The any character (&amp;quot;.&amp;quot;) defeats the whole purpose of the match. It really should have been escaped to &amp;ldquo;.&amp;rdquo; to mean a period. This error would probably never appear due to the unlikelihood of a badly formatted computer name being fed into the function.&lt;br&gt;
Lastly, a caution when including an optional credentials parameter. It&amp;rsquo;s probably not a good idea to default it to an empty credential object &lt;em&gt;($Credential = [System.Management.Automation.PSCredential]::Empty)&lt;/em&gt;. If you do a &lt;em&gt;if ($Credential) {}&lt;/em&gt; call later in the script, it will always be $true and you may end up calling for the user to enter credentials far too many times. A better solution would be to check PSBoundParameters to see if a credential object was passed in.&lt;br&gt;
Hope these ideas help. Good luck in Event 4.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>This event&rsquo;s entries are impressive. Scoring appears to be higher than in the earlier events, so this one must have been easier to solve. So this time, instead of talking about good and bad scripts, I&rsquo;m going to comment on some of the techniques I saw.<br>
There was some &ldquo;conversation&rdquo; over whether Win32_Volume or Win32_LogicalDisk was the better approach to take. Fact is, either will return the requested data. So it really doesn&rsquo;t matter which one you use. The controversy seemed to include misreading or misunderstanding the requirement of reporting on &ldquo;local hard drives&rdquo;, which implies that you need to use<em>-Filter &ldquo;DriveType=3&rdquo;</em> (or equivalent) with either to eliminate network or CD/DVD drives.<br>
When passing a Path parameter into a function, it&rsquo;s a good practice to include<em>[ValidateScript ({Test-Path -PathType Container})]</em> in the definition to avoid having a file name passed in error. Doing the existence test for the path and creating it if necessary in the Begin section of the function would save some time over the various techniques used in the Process section.<br>
One thing to remember when using a CIMSession is to close it when you&rsquo;ve finished using it. A couple other points to pay attention to include accounting for the DCOM/WSMAN options when looking at remote computers and including<em>#requires -version 3</em> in scripts that might be run by other people on computers that might not have PowerShell 3 installed.<br>
Using a REGEX to validate a string parameter, such as a computer name, isn&rsquo;t a bad idea, but it&rsquo;s important to understand exactly what the match string means. As an example, some of the match strings included a pattern like this:<em>"[a-zA-Z0-9.-]"</em>. This means all lower and upper case letters, any numeric digit, any character, or a minus sign. The any character (".") defeats the whole purpose of the match. It really should have been escaped to &ldquo;.&rdquo; to mean a period. This error would probably never appear due to the unlikelihood of a badly formatted computer name being fed into the function.<br>
Lastly, a caution when including an optional credentials parameter. It&rsquo;s probably not a good idea to default it to an empty credential object<em>($Credential = [System.Management.Automation.PSCredential]::Empty)</em>. If you do a<em>if ($Credential) {}</em> call later in the script, it will always be $true and you may end up calling for the user to enter credentials far too many times. A better solution would be to check PSBoundParameters to see if a credential object was passed in.<br>
Hope these ideas help. Good luck in Event 4.</p>
]]></content:encoded></item><item><title>Scripting Games 2013: Event 3 Notes</title><link>https://powershell.org/articles/2013-05-15-scripting-games-2013-event-3-notes/</link><guid>https://powershell.org/articles/2013-05-15-scripting-games-2013-event-3-notes/</guid><pubDate>Thu, 16 May 2013 03:03:08 +0000</pubDate><description>&lt;p&gt;Wow, it is hard to believe that we are now halfway through the Scripting Games! As the events have progressed, I have seen a lot of improvement with the techniques as well as seeing new techniques that continue to impress me. On the flip side, I have seen some mistakes or assumptions when coding that cause a potential 5 star script to be a 2 or 3 star script. The best part about all of this is that we are all (yes, even the judges) learning new things that can only help to improve everyone&amp;quot;™s scripting knowledge. Check out the rest of the &lt;a href="http://learn-powershell.net/2013/05/15/scripting-games-2013-event-3-notes/"&gt;article here&lt;/a&gt;.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Wow, it is hard to believe that we are now halfway through the Scripting Games! As the events have progressed, I have seen a lot of improvement with the techniques as well as seeing new techniques that continue to impress me. On the flip side, I have seen some mistakes or assumptions when coding that cause a potential 5 star script to be a 2 or 3 star script. The best part about all of this is that we are all (yes, even the judges) learning new things that can only help to improve everyone"™s scripting knowledge. Check out the rest of the<a href="http://learn-powershell.net/2013/05/15/scripting-games-2013-event-3-notes/">article here</a>.</p>
]]></content:encoded></item><item><title>Meet the Scripting Games Judges: Bartek Bielawski</title><link>https://powershell.org/articles/2013-05-15-meet-the-scripting-games-judges-bartek-bielawski/</link><guid>https://powershell.org/articles/2013-05-15-meet-the-scripting-games-judges-bartek-bielawski/</guid><pubDate>Wed, 15 May 2013 21:18:14 +0000</pubDate><description>&lt;p&gt;Bartosz (Bartek) Bielawski is a busy IT Administrator with an international company, PAREXEL. He loves PowerShell and automation. That love earned him the honor of Microsoft MVP. He shares his knowledge mainly on his blogs: in English (&lt;a href="http://becomelotr.wordpress.com"&gt;http://becomelotr.wordpress.com&lt;/a&gt;) and Polish (&lt;a href="http://powershellpl.net"&gt;http://powershellpl.net&lt;/a&gt;) and through articles published in the Polish IT Professional (&lt;a href="http://it-professional.pl"&gt;http://it-professional.pl&lt;/a&gt;) magazine. He is co-author of PowerShell Deep Dives book (&lt;a href="http://www.manning.com/hicks/)"&gt;http://www.manning.com/hicks/)&lt;/a&gt;. He loves good code that takes advantage of PowerShell pipeline and advanced functions grouped in modules.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Bartosz (Bartek) Bielawski is a busy IT Administrator with an international company, PAREXEL. He loves PowerShell and automation. That love earned him the honor of Microsoft MVP. He shares his knowledge mainly on his blogs: in English (<a href="http://becomelotr.wordpress.com">http://becomelotr.wordpress.com</a>) and Polish (<a href="http://powershellpl.net">http://powershellpl.net</a>) and through articles published in the Polish IT Professional (<a href="http://it-professional.pl">http://it-professional.pl</a>) magazine. He is co-author of PowerShell Deep Dives book (<a href="http://www.manning.com/hicks/)">http://www.manning.com/hicks/)</a>. He loves good code that takes advantage of PowerShell pipeline and advanced functions grouped in modules.</p>
]]></content:encoded></item><item><title>Scripting Games Event 2 Winners</title><link>https://powershell.org/articles/2013-05-14-scripting-games-event-1-winners-1/</link><guid>https://powershell.org/articles/2013-05-14-scripting-games-event-1-winners-1/</guid><pubDate>Tue, 14 May 2013 15:22:41 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;re pleased to announce the winners for Event 2 of The Scripting Games 2013!&lt;br&gt;
Winners: You can log into &lt;a href="http://scriptinggames.org/"&gt;The Scripting Games Web site&lt;/a&gt; and go to your Profile page to see your prize. You will be given a prize redemption code and either a URL where you can redeem it, or an e-mail address of the prize provider (they will need the redemption code). All prizes must be claimed by the end of July 2013. I will list winners by username; if you used your e-mail address as your username, then a portion of that will be truncated for your privacy. Anyone can log in and check their Profile page to see if they&amp;rsquo;ve won a prize.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;re pleased to announce the winners for Event 2 of The Scripting Games 2013!<br>
Winners: You can log into<a href="http://scriptinggames.org/">The Scripting Games Web site</a> and go to your Profile page to see your prize. You will be given a prize redemption code and either a URL where you can redeem it, or an e-mail address of the prize provider (they will need the redemption code). All prizes must be claimed by the end of July 2013. I will list winners by username; if you used your e-mail address as your username, then a portion of that will be truncated for your privacy. Anyone can log in and check their Profile page to see if they&rsquo;ve won a prize.</p><ul><li><p>Event 2 Beginner First Place: kurtdg (free ebook from Manning)</p></li><li><p>Event 2 Beginner Second Place: JayJay (6 months video training from Interface)</p></li><li><p>Event 2 Beginner Third Place: wesleyhaut (1 year of Phoneominal from Start-Automating)</p></li><li><p>Event 2 Advanced First Place:<em>Emin</em> (free ebook from Manning)</p></li><li><p>Event 2 Advanced Second Place: mikefrobbins (6 months video training from Interface)</p></li><li><p>Event 2 Advanced Third Place: SimonW (1 year of Phonenominal from Start-Automating)</p></li><li><p>Event 2 Beginner Top CrowdScore: taygibb (free ebook from Manning)</p></li><li><p>Event 2 Advanced Top CrowdScore: mikefrobbins (free ebook from Manning)</p></li></ul><p>These are now listed on our<a href="http://scriptinggames.org/winners.php">consolidated list of winners</a>, which includes links to the winning entries.<br>
Our CrowdScore winners get a selection of free ebooks from Manning, 1 month of video training from Interface, and $50 gift cards from SAPIEN; 1 prize per winner.</p><ul><li>CrowdScore Voter: SimonW</li><li>CrowdScore Voter: khopcroft</li><li>CrowdScore Voter: markashley1961</li><li>CrowdScore Voter: kbrucej</li><li>CrowdScore Voter: kraanr</li><li>CrowdScore Voter: takenow350@_.com</li></ul><p>Congratulations to all of our winners! Note that our top three prizes in each category were awarded by our Mighty Panel of Celebrity Judges. Each judge nominated a first, second, and third place winner from the entries that our expert commentators identified as &ldquo;best.&rdquo; Those nominations were compiled, and in the event of a tie the earliest entry was deemed winner.</p>
]]></content:encoded></item><item><title>Announcing the PowerShell Summit North America 2014</title><link>https://powershell.org/articles/2013-05-14-announcing-the-powershell-summit-north-america-2014/</link><guid>https://powershell.org/articles/2013-05-14-announcing-the-powershell-summit-north-america-2014/</guid><pubDate>Tue, 14 May 2013 14:39:11 +0000</pubDate><description>&lt;p&gt;The PowerShell Summit North America 2014 will be held April 28, 29, and 30 at the Meydenbauer Center on Northeast 6th Street in Bellevue, WA.&lt;br&gt;
Your membership in the PowerShell Summit also makes you a yearlong member of PowerShell.org, the online hub for the PowerShell community. Membership includes a daily continental breakfast, daily hot lunch, and three tracks of expert-led lectures and discussions. 2014 tracks include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;INTERNALS: Inner secrets of PowerShell, suitable for developers and admins alike.&lt;/li&gt;
&lt;li&gt;DEEP DIVES: Dig into technically rich topics related to the shell itself and broad administrative tasks.&lt;/li&gt;
&lt;li&gt;DOMAIN SPECIFIC: Focus on managing specific server products and technologies using the shell.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;[NB: For tax reasons, you become a &amp;ldquo;member&amp;rdquo; of the organization and go to our meeting as part of that; we don&amp;rsquo;t sell &amp;ldquo;tickets.&amp;rdquo;]&lt;br&gt;
&lt;strong&gt;Pricing&lt;/strong&gt; will range from $750-$950. We&amp;rsquo;d originally hoped to do a flat price, but the logistics of our venue is pushing this decision. So we&amp;rsquo;ll be offering discounted tickets first, and then moving up the price as we go. Get in early to get the cheap seats!&lt;br&gt;
If you choose to stay at one of our official hotels, you&amp;rsquo;ll enjoy a reduced room rate, complimentary in-room Internet, and a short 15-minute walk to the Meydenbauer Center. We recommend taking a shuttle from the airport (&lt;a href="http://bit.ly/ZNWGcw"&gt;http://bit.ly/ZNWGcw&lt;/a&gt; $20oneway; taxis $65+) instead of a rental car; parking is NOT complimentary.&lt;br&gt;
NEARBY HOTELS include: Sheraton (&lt;a href="http://bit.ly/10mVQog)"&gt;http://bit.ly/10mVQog)&lt;/a&gt;, Hilton (&lt;a href="http://bit.ly/YsQiq8)"&gt;http://bit.ly/YsQiq8)&lt;/a&gt;, and Red Lion (&lt;a href="http://bit.ly/10gXH8v)"&gt;http://bit.ly/10gXH8v)&lt;/a&gt;. All are adjacent to each other and are a .6 mile walk to the Meydenbauer Center. Courtyard by Marriott (&lt;a href="http://bit.ly/12RvG9a"&gt;http://bit.ly/12RvG9a&lt;/a&gt;) is across the street from the Meydenbauer Center. We do not yet have official room availability and rates.&lt;br&gt;
These hotels are also less than a 4-minute taxi ride (under $5oneway) to downtown Bellevue, full of retail, dining, bars, and nightlife. You will probably spend MORE on a rental car (around $100 best-case, plus parking fees and fuel).&lt;br&gt;
We will have a small-bandwidth Internet pipe available for WiFi use at the conference center. We recommend that you NOT rely on it for mission-critical or business-sensitive tasks, as it is a shared pipe and will likely have poor performance during peak usage.&lt;br&gt;
We are not currently planning to offer power outlets in rooms. You may NOT stretch power cords across walkways to plug in your laptop. We are seeking out a Power Sponsor - the cost to have enough power for everyone&amp;rsquo;s laptop is about $20,000 (it&amp;rsquo;s one way conference centers make their profits), so this is a significant expense.&lt;br&gt;
We are planning a brief private meet-and-greet reception for PowerShell.org, Inc. shareholders. We are also planning general evening events.&lt;br&gt;
MEMBERSHIP SALES WILL BEGIN IN JULY with a private announcement to our 2013 alumni and our shareholders. After that, we will offer a block of memberships to our TechLetter subscribers. These folks will have first dibs not only on the event, but also on our limited block of nearby and discounted hotel rooms. We will release subsequent blocks in 2013 and 2014 for the public.&lt;br&gt;
FULL DETAILS will always be available online at &lt;a href="http://PowerShellSummit.org"&gt;http://PowerShellSummit.org&lt;/a&gt; (this will redirect to the appropriate page for information and news).&lt;br&gt;
&lt;strong&gt;UPDATE&lt;/strong&gt;: I know there&amp;rsquo;s a bit of disappointment that we&amp;rsquo;re not &amp;ldquo;on campus.&amp;rdquo; First&amp;hellip; understand that we were a little under-the-radar in 2013, in terms of outside groups doing what we did in those particular locations. We also need to grow the event a bit in order to make it financially self-sustaining. And, the real clincher, no place &amp;ldquo;on campus&amp;rdquo; could accommodate us. However, &amp;ldquo;campus&amp;rdquo; (this is why I keep putting it in quotes) spans Redmond and Bellevue - we&amp;rsquo;re actually adjacent to Microsoft offices, in 2014, and we&amp;rsquo;re scheduling an evening event (community/team mixer, with team Q&amp;amp;A stations) in MS facilities. We&amp;rsquo;ll also try to wrangle a company store/museum visit (there&amp;rsquo;s a company Connector Shuttle that runs to Commons, which is where the store and museum are located). Most importantly, our location will ensure team participation - which is what doing this in the Seattle metro was all about. In fact, we&amp;rsquo;re planning expanded team participation, with the addition of team-led &amp;ldquo;lightning demos&amp;rdquo; that will highlight cool features and tricks, and which will be a prelude to that evening&amp;rsquo;s community/team mixer (so you can ask follow-up questions in smaller groups). So&amp;hellip; given all of the possible alternatives, we felt this was the best solution. After all, the main session content is just you sitting in a room - shouldn&amp;rsquo;t matter where that room is. The big thing for us is the team engagement, and the opportunity to do &lt;em&gt;fun&lt;/em&gt; stuff on campus, and we think we&amp;rsquo;ve got that nailed. More to come.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>The PowerShell Summit North America 2014 will be held April 28, 29, and 30 at the Meydenbauer Center on Northeast 6th Street in Bellevue, WA.<br>
Your membership in the PowerShell Summit also makes you a yearlong member of PowerShell.org, the online hub for the PowerShell community. Membership includes a daily continental breakfast, daily hot lunch, and three tracks of expert-led lectures and discussions. 2014 tracks include:</p><ul><li>INTERNALS: Inner secrets of PowerShell, suitable for developers and admins alike.</li><li>DEEP DIVES: Dig into technically rich topics related to the shell itself and broad administrative tasks.</li><li>DOMAIN SPECIFIC: Focus on managing specific server products and technologies using the shell.</li></ul><p>[NB: For tax reasons, you become a &ldquo;member&rdquo; of the organization and go to our meeting as part of that; we don&rsquo;t sell &ldquo;tickets.&rdquo;]<br><strong>Pricing</strong> will range from $750-$950. We&rsquo;d originally hoped to do a flat price, but the logistics of our venue is pushing this decision. So we&rsquo;ll be offering discounted tickets first, and then moving up the price as we go. Get in early to get the cheap seats!<br>
If you choose to stay at one of our official hotels, you&rsquo;ll enjoy a reduced room rate, complimentary in-room Internet, and a short 15-minute walk to the Meydenbauer Center. We recommend taking a shuttle from the airport (<a href="http://bit.ly/ZNWGcw">http://bit.ly/ZNWGcw</a> $20oneway; taxis $65+) instead of a rental car; parking is NOT complimentary.<br>
NEARBY HOTELS include: Sheraton (<a href="http://bit.ly/10mVQog)">http://bit.ly/10mVQog)</a>, Hilton (<a href="http://bit.ly/YsQiq8)">http://bit.ly/YsQiq8)</a>, and Red Lion (<a href="http://bit.ly/10gXH8v)">http://bit.ly/10gXH8v)</a>. All are adjacent to each other and are a .6 mile walk to the Meydenbauer Center. Courtyard by Marriott (<a href="http://bit.ly/12RvG9a">http://bit.ly/12RvG9a</a>) is across the street from the Meydenbauer Center. We do not yet have official room availability and rates.<br>
These hotels are also less than a 4-minute taxi ride (under $5oneway) to downtown Bellevue, full of retail, dining, bars, and nightlife. You will probably spend MORE on a rental car (around $100 best-case, plus parking fees and fuel).<br>
We will have a small-bandwidth Internet pipe available for WiFi use at the conference center. We recommend that you NOT rely on it for mission-critical or business-sensitive tasks, as it is a shared pipe and will likely have poor performance during peak usage.<br>
We are not currently planning to offer power outlets in rooms. You may NOT stretch power cords across walkways to plug in your laptop. We are seeking out a Power Sponsor - the cost to have enough power for everyone&rsquo;s laptop is about $20,000 (it&rsquo;s one way conference centers make their profits), so this is a significant expense.<br>
We are planning a brief private meet-and-greet reception for PowerShell.org, Inc. shareholders. We are also planning general evening events.<br>
MEMBERSHIP SALES WILL BEGIN IN JULY with a private announcement to our 2013 alumni and our shareholders. After that, we will offer a block of memberships to our TechLetter subscribers. These folks will have first dibs not only on the event, but also on our limited block of nearby and discounted hotel rooms. We will release subsequent blocks in 2013 and 2014 for the public.<br>
FULL DETAILS will always be available online at<a href="http://PowerShellSummit.org">http://PowerShellSummit.org</a> (this will redirect to the appropriate page for information and news).<br><strong>UPDATE</strong>: I know there&rsquo;s a bit of disappointment that we&rsquo;re not &ldquo;on campus.&rdquo; First&hellip; understand that we were a little under-the-radar in 2013, in terms of outside groups doing what we did in those particular locations. We also need to grow the event a bit in order to make it financially self-sustaining. And, the real clincher, no place &ldquo;on campus&rdquo; could accommodate us. However, &ldquo;campus&rdquo; (this is why I keep putting it in quotes) spans Redmond and Bellevue - we&rsquo;re actually adjacent to Microsoft offices, in 2014, and we&rsquo;re scheduling an evening event (community/team mixer, with team Q&amp;A stations) in MS facilities. We&rsquo;ll also try to wrangle a company store/museum visit (there&rsquo;s a company Connector Shuttle that runs to Commons, which is where the store and museum are located). Most importantly, our location will ensure team participation - which is what doing this in the Seattle metro was all about. In fact, we&rsquo;re planning expanded team participation, with the addition of team-led &ldquo;lightning demos&rdquo; that will highlight cool features and tricks, and which will be a prelude to that evening&rsquo;s community/team mixer (so you can ask follow-up questions in smaller groups). So&hellip; given all of the possible alternatives, we felt this was the best solution. After all, the main session content is just you sitting in a room - shouldn&rsquo;t matter where that room is. The big thing for us is the team engagement, and the opportunity to do<em>fun</em> stuff on campus, and we think we&rsquo;ve got that nailed. More to come.</p>
]]></content:encoded></item><item><title>Event 3: My way…</title><link>https://powershell.org/articles/2013-05-13-event-3-my-way/</link><guid>https://powershell.org/articles/2013-05-13-event-3-my-way/</guid><pubDate>Tue, 14 May 2013 07:09:35 +0000</pubDate><description>&lt;p&gt;Third event is open for voting, but as usual - before I see any of the scripts submitted by you, I&amp;rsquo;m posting my version. Tried to sneak in few tricks I&amp;rsquo;ve learned here and there, hope you will enjoy reading and will tell me why I&amp;rsquo;m wrong. 😉 You can find whole post &lt;a href="http://becomelotr.wordpress.com/2013/05/14/event-3-my-way/"&gt;here&lt;/a&gt;.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Third event is open for voting, but as usual - before I see any of the scripts submitted by you, I&rsquo;m posting my version. Tried to sneak in few tricks I&rsquo;ve learned here and there, hope you will enjoy reading and will tell me why I&rsquo;m wrong. 😉 You can find whole post<a href="http://becomelotr.wordpress.com/2013/05/14/event-3-my-way/">here</a>.</p>
]]></content:encoded></item><item><title>Scripting Games 2013: Event 2 Notes</title><link>https://powershell.org/articles/2013-05-12-scripting-games-2013-event-2-notes/</link><guid>https://powershell.org/articles/2013-05-12-scripting-games-2013-event-2-notes/</guid><pubDate>Mon, 13 May 2013 02:32:40 +0000</pubDate><description>&lt;p&gt;I spent some time last week and this weekend to compile a list of notes of what I have seen with the Event 2 submissions that could show improvement. I touched up on some items with my &lt;a href="http://learn-powershell.net/2013/05/08/scripting-games-2013-event-2-favorite-and-not-so-favorite/"&gt;previous article&lt;/a&gt; where I picked out some submissions that I liked and didn&amp;rsquo;t quite like but wanted to touch on a few more things. Some of this feels like a repeat of last week and even last years games, but that is Ok. This is all about learning and as long as everyone takes what all of the judges have been writing about, then there will be nothing but great improvements during the course of the games. &lt;a href="http://learn-powershell.net/2013/05/12/scripting-games-2013-event-2-notes/"&gt;Click here&lt;/a&gt; to go to continue reading this article.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I spent some time last week and this weekend to compile a list of notes of what I have seen with the Event 2 submissions that could show improvement. I touched up on some items with my<a href="http://learn-powershell.net/2013/05/08/scripting-games-2013-event-2-favorite-and-not-so-favorite/">previous article</a> where I picked out some submissions that I liked and didn&rsquo;t quite like but wanted to touch on a few more things. Some of this feels like a repeat of last week and even last years games, but that is Ok. This is all about learning and as long as everyone takes what all of the judges have been writing about, then there will be nothing but great improvements during the course of the games.<a href="http://learn-powershell.net/2013/05/12/scripting-games-2013-event-2-notes/">Click here</a> to go to continue reading this article.</p>
]]></content:encoded></item><item><title>People Who are Blogging About the 2013 Scripting Games</title><link>https://powershell.org/articles/2013-05-11-people-who-are-blogging-about-the-2013-scripting-games/</link><guid>https://powershell.org/articles/2013-05-11-people-who-are-blogging-about-the-2013-scripting-games/</guid><pubDate>Sat, 11 May 2013 23:13:49 +0000</pubDate><description>&lt;p&gt;I&amp;rsquo;m sure that most people can easily find any of the blogs of the official judges from the 2013 Scripting Games. I recommend reading those blogs whether you&amp;rsquo;re competing in the scripting games or not since there&amp;rsquo;s a wealth of great information contained in them. The best place to find those blogs if you don&amp;rsquo;t know already is the &lt;a href="https://powershell.org/category/announcements/scripting-games/judges-notes/"&gt;Judges Notes section&lt;/a&gt; under the &lt;a href="https://powershell.org/category/announcements/scripting-games/"&gt;Scripting Games area&lt;/a&gt; on &lt;a href="https://powershell.org/"&gt;PowerShell.org&lt;/a&gt; so there&amp;rsquo;s no reason to duplicate them here.&lt;br&gt;
There are also a number of people who are competing in the Scripting Games that are writing blog articles of their own blog sites. A couple of the ones that I&amp;rsquo;m aware of are listed below and while they&amp;rsquo;re my competition in the advanced class and have links promoting their Scripting Games entries in their blogs (I do the same thing),  I don&amp;rsquo;t mind promoting their blog articles because there&amp;rsquo;s some great information to be found in them. I&amp;rsquo;m actually glad they provided links to their entries because both of these guys are excellent PowerShell scripters and you could learn a lot from viewing their Scripting Games entries. Ultimately the scripting games is all about the community learning more about using PowerShell best practices in a friendly competition that&amp;rsquo;s just for fun. &lt;a href="http://mikefrobbins.com/2013/05/11/people-who-are-blogging-about-the-2013-scripting-games/"&gt;Click here&lt;/a&gt; to be redirected to the original post of this article on the author&amp;rsquo;s blog site where you can read the remainder of the article.&lt;br&gt;
µ&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I&rsquo;m sure that most people can easily find any of the blogs of the official judges from the 2013 Scripting Games. I recommend reading those blogs whether you&rsquo;re competing in the scripting games or not since there&rsquo;s a wealth of great information contained in them. The best place to find those blogs if you don&rsquo;t know already is the <a href="https://powershell.org/category/announcements/scripting-games/judges-notes/">Judges Notes section</a> under the <a href="https://powershell.org/category/announcements/scripting-games/">Scripting Games area</a> on <a href="https://powershell.org/">PowerShell.org</a> so there&rsquo;s no reason to duplicate them here.<br>
There are also a number of people who are competing in the Scripting Games that are writing blog articles of their own blog sites. A couple of the ones that I&rsquo;m aware of are listed below and while they&rsquo;re my competition in the advanced class and have links promoting their Scripting Games entries in their blogs (I do the same thing),  I don&rsquo;t mind promoting their blog articles because there&rsquo;s some great information to be found in them. I&rsquo;m actually glad they provided links to their entries because both of these guys are excellent PowerShell scripters and you could learn a lot from viewing their Scripting Games entries. Ultimately the scripting games is all about the community learning more about using PowerShell best practices in a friendly competition that&rsquo;s just for fun.<a href="http://mikefrobbins.com/2013/05/11/people-who-are-blogging-about-the-2013-scripting-games/">Click here</a> to be redirected to the original post of this article on the author&rsquo;s blog site where you can read the remainder of the article.<br>
µ</p>
]]></content:encoded></item><item><title>Changes in Scripting Games Displays</title><link>https://powershell.org/articles/2013-05-10-changes-in-scripting-games-displays/</link><guid>https://powershell.org/articles/2013-05-10-changes-in-scripting-games-displays/</guid><pubDate>Fri, 10 May 2013 23:52:49 +0000</pubDate><description>&lt;p&gt;I want to point out some changes that are being made to the Games:&lt;br&gt;
Effective immediately, entry author names and current scores will not be shown for events that are still open for new votes. This is intended to help ensure everyone submitting a score isn&amp;rsquo;t influenced by other people. I&amp;rsquo;ve seen a bit of ganging-up that I&amp;rsquo;d rather not see.&lt;br&gt;
Archived events - those completely closed and for which prizes have been awarded - will display full information, including user names of comment authors.&lt;br&gt;
The new event viewer, which is currently under development, will display comment author names. These will be visible to an entry&amp;rsquo;s author immediately, and to the public once the event is no longer open for voting.&lt;br&gt;
Entry authors: This means you won&amp;rsquo;t be able to see your score while it&amp;rsquo;s still open for voting, unless you use the new beta viewer (which I&amp;rsquo;ll be wrapping up this weekend).&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I want to point out some changes that are being made to the Games:<br>
Effective immediately, entry author names and current scores will not be shown for events that are still open for new votes. This is intended to help ensure everyone submitting a score isn&rsquo;t influenced by other people. I&rsquo;ve seen a bit of ganging-up that I&rsquo;d rather not see.<br>
Archived events - those completely closed and for which prizes have been awarded - will display full information, including user names of comment authors.<br>
The new event viewer, which is currently under development, will display comment author names. These will be visible to an entry&rsquo;s author immediately, and to the public once the event is no longer open for voting.<br>
Entry authors: This means you won&rsquo;t be able to see your score while it&rsquo;s still open for voting, unless you use the new beta viewer (which I&rsquo;ll be wrapping up this weekend).</p>
]]></content:encoded></item><item><title>Scripting Games beta entry viewer</title><link>https://powershell.org/articles/2013-05-10-scripting-games-beta-entry-viewer/</link><guid>https://powershell.org/articles/2013-05-10-scripting-games-beta-entry-viewer/</guid><pubDate>Fri, 10 May 2013 19:43:04 +0000</pubDate><description>&lt;p&gt;If you&amp;rsquo;d like a quick peek at something, log into the &lt;a href="http://scriptinggames.org/"&gt;Scripting Games Web site&lt;/a&gt;, and go look at the entries in Event 1. Your URL should look like this:&lt;br&gt;
&lt;strong&gt;&lt;a href="http://scriptinggames.org/entrylist.php?eventid=11"&gt;http://scriptinggames.org/entrylist.php?eventid=11&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
Change it to this:&lt;br&gt;
&lt;strong&gt;&lt;a href="http://scriptinggames.org/entrylist_.php?eventid=11"&gt;http://scriptinggames.org/entrylist_.php?eventid=11&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
This is the new viewer I&amp;rsquo;m building. It isn&amp;rsquo;t rigged up to accept votes or comments, yet, but I&amp;rsquo;m working on that. It&amp;rsquo;s being developed for Firefox; I&amp;rsquo;ll test the other major browsers once it&amp;rsquo;s a bit more complete. This is under development, so it may be offline or unreliable. Don&amp;rsquo;t &lt;em&gt;tell&lt;/em&gt; me about it - I&amp;rsquo;m &lt;em&gt;already working on it&lt;/em&gt; .&lt;br&gt;
You can probably use this on Event 2 as well. The voting and commenting should be working. Note that you must vote before you can comment, and right now it&amp;rsquo;ll only accept one comment per person. That will probably remain the case for the current iteration of the Games based on some back-end dependencies. However, you CAN tie a comment to a particular line number or range of lines, and when viewing the comment it&amp;rsquo;ll highlight those lines. It&amp;rsquo;s pretty neat, I think.&lt;br&gt;
Oh, and I know the coloring on block comments is wonky. I need to dive into the color-er&amp;rsquo;s regexes and see if I can tweak that. Any regex wizards who want to volunteer to help with that, drop me a line. Right now the PowerShell syntax in the color-er is a little primitive. Actually, there are probably several regexes we could add to this to spruce up the listings.&lt;br&gt;
And yes, I know the comments now show the author&amp;rsquo;s user name. That&amp;rsquo;s been a big back-and-forth. I&amp;rsquo;m not a huge fan of anonymous commenting, and right now it&amp;rsquo;s just your username anyway. Hopefully nobody said anything truly offensive simply because they thought they were anonymous :).&lt;br&gt;
Back to work.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>If you&rsquo;d like a quick peek at something, log into the<a href="http://scriptinggames.org/">Scripting Games Web site</a>, and go look at the entries in Event 1. Your URL should look like this:<br><strong><a href="http://scriptinggames.org/entrylist.php?eventid=11">http://scriptinggames.org/entrylist.php?eventid=11</a></strong><br>
Change it to this:<br><strong><a href="http://scriptinggames.org/entrylist_.php?eventid=11">http://scriptinggames.org/entrylist_.php?eventid=11</a></strong><br>
This is the new viewer I&rsquo;m building. It isn&rsquo;t rigged up to accept votes or comments, yet, but I&rsquo;m working on that. It&rsquo;s being developed for Firefox; I&rsquo;ll test the other major browsers once it&rsquo;s a bit more complete. This is under development, so it may be offline or unreliable. Don&rsquo;t<em>tell</em> me about it - I&rsquo;m<em>already working on it</em> .<br>
You can probably use this on Event 2 as well. The voting and commenting should be working. Note that you must vote before you can comment, and right now it&rsquo;ll only accept one comment per person. That will probably remain the case for the current iteration of the Games based on some back-end dependencies. However, you CAN tie a comment to a particular line number or range of lines, and when viewing the comment it&rsquo;ll highlight those lines. It&rsquo;s pretty neat, I think.<br>
Oh, and I know the coloring on block comments is wonky. I need to dive into the color-er&rsquo;s regexes and see if I can tweak that. Any regex wizards who want to volunteer to help with that, drop me a line. Right now the PowerShell syntax in the color-er is a little primitive. Actually, there are probably several regexes we could add to this to spruce up the listings.<br>
And yes, I know the comments now show the author&rsquo;s user name. That&rsquo;s been a big back-and-forth. I&rsquo;m not a huge fan of anonymous commenting, and right now it&rsquo;s just your username anyway. Hopefully nobody said anything truly offensive simply because they thought they were anonymous :).<br>
Back to work.</p>
]]></content:encoded></item><item><title>Some notes on Event 2 Advanced</title><link>https://powershell.org/articles/2013-05-10-some-notes-on-event-2-advanced/</link><guid>https://powershell.org/articles/2013-05-10-some-notes-on-event-2-advanced/</guid><pubDate>Fri, 10 May 2013 16:17:32 +0000</pubDate><description>&lt;p&gt;I hate to seem negative, but I&amp;rsquo;ve noticed a few things about a number of the advanced entries that seem like folks didn&amp;rsquo;t read the instructions, or just weren&amp;rsquo;t careful about details.&lt;br&gt;
There were a surprising number of entries that had [string]$ComputerName instead of [string[]]$ComputerName in the params section and then went on to treat the parameter as if it were an array.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Somewhat related to the array issue, the problem statement indicated that there could be several files that had computer identification for piping into the solution. Several scripts went beyond the minimum by accepting a filename property to process those files directly. I don&amp;rsquo;t think that extension is out-of-bounds, but  scripts that accepted only filenames and excluded ComputerName input didn&amp;rsquo;t get my vote.&lt;/li&gt;
&lt;li&gt;The instructions asked for a &amp;ldquo;full help display&amp;rdquo;, but many of the entries had fairly limited documentation. One thing I especially missed was a .PARAMETER description.&lt;/li&gt;
&lt;li&gt;My last negative comment is about parameter names. Although there&amp;rsquo;s nothing in PowerShell to prevent it, best practices in parameter names should be followed. The parameter ought to be $ComputerName, not $Name, $Server, $Computer, etc. I know it&amp;rsquo;s easier with verbs and nouns because of the Get-Verb and Get-Noun cmdlets, but please pay attention to how you name your parameters.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On the whole, though I really liked the effort everyone put into their scripts. Those that exactly met the requirements were short, sweet, and to the point. There were several extensions that I also liked.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I hate to seem negative, but I&rsquo;ve noticed a few things about a number of the advanced entries that seem like folks didn&rsquo;t read the instructions, or just weren&rsquo;t careful about details.<br>
There were a surprising number of entries that had [string]$ComputerName instead of [string[]]$ComputerName in the params section and then went on to treat the parameter as if it were an array.</p><ul><li>Somewhat related to the array issue, the problem statement indicated that there could be several files that had computer identification for piping into the solution. Several scripts went beyond the minimum by accepting a filename property to process those files directly. I don&rsquo;t think that extension is out-of-bounds, but  scripts that accepted only filenames and excluded ComputerName input didn&rsquo;t get my vote.</li><li>The instructions asked for a &ldquo;full help display&rdquo;, but many of the entries had fairly limited documentation. One thing I especially missed was a .PARAMETER description.</li><li>My last negative comment is about parameter names. Although there&rsquo;s nothing in PowerShell to prevent it, best practices in parameter names should be followed. The parameter ought to be $ComputerName, not $Name, $Server, $Computer, etc. I know it&rsquo;s easier with verbs and nouns because of the Get-Verb and Get-Noun cmdlets, but please pay attention to how you name your parameters.</li></ul><p>On the whole, though I really liked the effort everyone put into their scripts. Those that exactly met the requirements were short, sweet, and to the point. There were several extensions that I also liked.</p><ul><li>Working with optional credentials. It was reasonable to assume that the script would be run using appropriate credentials, some of the scripts accepted alternate credentials for making the CIM or WMI queries. I consider it a best practice to log in and execute tasks at low permissions levels (standard user) and to use elevated credentials only on the specific commands that need them. Kudos also to those of you who accepted either a credentials object or a user name and found the credentials.</li><li>Using parallel execution to speed up the process. PowerShell provides runspaces, workspaces, and jobs to allow multiple commands to execute concurrently. Nothing in the event hinted at using parallelism, so I put these on my &ldquo;clever&rdquo; list.</li><li>Using PowerShell 3&rsquo;s CIM cmdlets. Using the new features of the latest version of PowerShell is quite good, especially when making use of the backwards compatibility features. I would have done this a bit differently than most, though. Instead of always using the Dcom session option, I would have opened a SimSession using a<em>try {WSMAN} Catch {DCOM}</em> and running the queries against the session.</li></ul><p>So, good work, everybody. Let&rsquo;s see what more we can learn in event 3.</p>
]]></content:encoded></item><item><title>Scripting Games Week 2: Formatting edition</title><link>https://powershell.org/articles/2013-05-10-scripting-games-week-2-formatting-edition/</link><guid>https://powershell.org/articles/2013-05-10-scripting-games-week-2-formatting-edition/</guid><pubDate>Fri, 10 May 2013 12:40:16 +0000</pubDate><description>&lt;p&gt;This time of the year always feels like someone is holding down the fast forward button.  I blinked and here we are Friday morning another week of scripts in the rear view.  I spent most of my week in the beginner class this week, and was greeted by a combination of beginners and scripters who weren&amp;quot;™t quite ready to step up to advanced.  More of the latter if I&amp;quot;™m to be honest.  This was a pleasant surprise as it&amp;quot;™s another sign of the continuing growth of our community.  Now on to the scripts I knew when I signed up to do this, that at least one of these weeks I&amp;quot;™d talk about formatting.  It&amp;quot;™s one of those best practices that you don&amp;quot;™t appreciate until you&amp;quot;™re asked to review someone else&amp;quot;™s code.&lt;br&gt;
&lt;strong&gt;Don&amp;quot;™t Crunch the Code, and for the love of all things, Hit Enter!&lt;/strong&gt;&lt;br&gt;
I did not deduct any points for readability, but you didn&amp;quot;™t make my good list either.  Personally I find it disrespectful to share an ungodly one-liner, but it&amp;quot;™s downright wrong if that single line has semicolons!  We&amp;quot;™re not printing these scripts the crunch gets us nothing. I&amp;quot;™m not going to call out the litany of scripts that were manually formatting the data directly which is even worse, but consider the following.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>This time of the year always feels like someone is holding down the fast forward button.  I blinked and here we are Friday morning another week of scripts in the rear view.  I spent most of my week in the beginner class this week, and was greeted by a combination of beginners and scripters who weren"™t quite ready to step up to advanced.  More of the latter if I"™m to be honest.  This was a pleasant surprise as it"™s another sign of the continuing growth of our community.  Now on to the scripts I knew when I signed up to do this, that at least one of these weeks I"™d talk about formatting.  It"™s one of those best practices that you don"™t appreciate until you"™re asked to review someone else"™s code.<br><strong>Don"™t Crunch the Code, and for the love of all things, Hit Enter!</strong><br>
I did not deduct any points for readability, but you didn"™t make my good list either.  Personally I find it disrespectful to share an ungodly one-liner, but it"™s downright wrong if that single line has semicolons!  We"™re not printing these scripts the crunch gets us nothing. I"™m not going to call out the litany of scripts that were manually formatting the data directly which is even worse, but consider the following.</p><p><code>Get-Content C:\IpList.txt | Foreach-Object { $Processor = Get-WmiObject -ComputerName $_ -NameSpace "Root\CIMV2" -Class "Win32_Processor"; $OpSystem = Get-WmiObject -ComputerName $_ -Namespace "Root\CIMV2" -Class "Win32_OperatingSystem"; New-Object -TypeName PSObject -Property @{ Name = $Processor.SystemName; Cores = $Processor.NumberOfCores; OS = $OpSystem.Caption; Version = $OpSystem.Version; Memory = $OpSystem.TotalVisibleMemorySize } }</code>This is an almost perfect solution and it"™s utilizing my next tip for this week already, but the formatting made it unnecessarily hard to read. Let just clean this up a bit by inserting a proper CR in place of all those semi-colons.</p><p><code>Get-Content C:\IpList.txt | Foreach-Object { $Processor = Get-WmiObject -ComputerName $_ -Class "Win32_Processor" $OpSystem = Get-WmiObject -ComputerName $_ -Class "Win32_OperatingSystem" New-Object -TypeName PSObject -Property @{ "Name" = $Processor.SystemName "Cores" = $Processor.NumberOfCores "OS" = $OpSystem.Caption "Version" = $OpSystem.Version "Memory" = $OpSystem.TotalVisibleMemorySize } }</code>Does anyone honestly not think the latter is better? The whitespace cost nothing at execution, and makes it an order of magnitude easier for a human being to read, process, and comprehend! I don"™t care what you do in your own scripts but when another human being is going to be asked to read it take a moment and format it. By the way for those in audience in love with the all-powerful one-liner both those examples are one-liners.<br><strong>That"™s Sooooo 2006!</strong><br>
Seriously, it"™s okay to use the latest features of the language! Heck how about we just agree to use the features from the last version! What am I talking about? object creation! Again I didn"™t take any points off for this, and you may have made my good list, but I didn"™t like it. Select-Object and Add-Member NoteProperty were how we built custom object in 2006 with PowerShell v1. PowerShell V2 added an extremely powerful &ldquo;“Property parameter to New-Object that completely removed the need for Add-Member, and PowerShell V3 introduced the [PSCustomObject] type accelerator that removed them all! Consider the following look back at the past six years of PowerShell Object Creation.</p><p>`# 2006
Get-Content .\IpList.txt | Foreach-Object {
$Processor = Get-WmiObject -ComputerName $_ -Class &ldquo;Win32_Processor&rdquo;
$OpSystem = Get-WmiObject -ComputerName $_ -Class &ldquo;Win32_OperatingSystem&rdquo;
New-Object -TypeName PSObject |
Add-Member -MemberType Noteproperty -Name &ldquo;Name&rdquo; -value $Processor.SystemName -PassThru |
Add-Member -MemberType Noteproperty -Name &ldquo;Cores&rdquo; -value $Processor.NumberOfCores -PassThru |
Add-Member -MemberType Noteproperty -Name &ldquo;OS&rdquo; -value $OpSystem.Caption -PassThru |
Add-Member -MemberType Noteproperty -Name &ldquo;Version&rdquo; -value $OpSystem.Version -PassThru |
Add-Member -MemberType Noteproperty -Name &ldquo;Memory&rdquo; -value $OpSystem.TotalVisibleMemorySize -PassThru
}</p><h1 id="2007-this-worked-in-2006-but-it-took-a-little-while-to-catch-on" class="ps-heading">2007 This worked in 2006, but it took a little while to catch on.<a class="ps-heading-anchor" href="#2007-this-worked-in-2006-but-it-took-a-little-while-to-catch-on" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>Get-Content .\IpList.txt | Foreach-Object {
$OpSystem = Get-WmiObject -ComputerName $_ -Class &ldquo;Win32_OperatingSystem&rdquo;
Get-WmiObject -ComputerName $_ -Class &ldquo;Win32_Processor&rdquo;|
Select-Object -Property SystemName, NumberOfCores,
@{&lsquo;Name&rsquo;=&ldquo;OS&rdquo;;&ldquo;Expression&rdquo;={$OpSystem.Caption}},
@{&lsquo;Name&rsquo;=&ldquo;Version&rdquo;;&ldquo;Expression&rdquo;={$OpSystem.Version}},
@{&lsquo;Name&rsquo;=&ldquo;Memory&rdquo;;&ldquo;Expression&rdquo;={$OpSystem.TotalVisibleMemorySize}}
}</p><h1 id="2009" class="ps-heading">2009<a class="ps-heading-anchor" href="#2009" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>Get-Content .\IpList.txt | Foreach-Object {
$Processor = Get-WmiObject -ComputerName $_ -Class &ldquo;Win32_Processor&rdquo;
$OpSystem = Get-WmiObject -ComputerName $_ -Class &ldquo;Win32_OperatingSystem&rdquo;
New-Object -TypeName PSObject -Property @{
&ldquo;Name&rdquo; = $Processor.SystemName
&ldquo;Cores&rdquo; = $Processor.NumberOfCores
&ldquo;OS&rdquo; = $OpSystem.Caption
&ldquo;Version&rdquo;= $OpSystem.Version
&ldquo;Memory&rdquo; = $OpSystem.TotalVisibleMemorySize
}
}</p><h1 id="2012" class="ps-heading">2012<a class="ps-heading-anchor" href="#2012" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>Get-Content .\IpList.txt | Foreach-Object {
$Processor = Get-WmiObject -ComputerName $_ -Class &ldquo;Win32_Processor&rdquo;
$OpSystem = Get-WmiObject -ComputerName $_ -Class &ldquo;Win32_OperatingSystem&rdquo;
[PSCustomObject]@{
&ldquo;Name&rdquo; = $Processor.SystemName
&ldquo;Cores&rdquo; = $Processor.NumberOfCores
&ldquo;OS&rdquo; = $OpSystem.Caption
&ldquo;Version&rdquo;= $OpSystem.Version
&ldquo;Memory&rdquo; = $OpSystem.TotalVisibleMemorySize
}
}
`They are all more or less the same. When properly formatted they are all equally readable. Most of them use a hash table of some sort. Therefor there are some language hurdles that need to be cleared, so why bother, why does it matter?&hellip; simple performance, with every release the PowerShell team have refined Object creation and the new way is always just a little bit faster. I used measure-command to measure the execution times for the above examples and well as you can see while minute every subsequent technique is slightly faster.<br>
New-Object/Add-Member = 1128 Milliseconds<br>
Select-Object                    = 1114 Milliseconds<br>
New-Object &ldquo;“property      = 1107 Milliseconds<br>
PSCustomObject             = 1100 Milliseconds<br>
Again not a huge deal but given a large enough dataset every tick counts. There were a litany of other things that I saw this week that made my list. The good news is this is all nitpicky stuff which is awesome!   Keep it up, and for the rest of you voters out there lets ease up with the ones and twos these are awesome scripts.  They may not use the technique you&rsquo;d prefer but for the most part they&rsquo;re getting the job done.<br>
~Glenn</p>
]]></content:encoded></item><item><title>As Event 3 gets underway, here are some Event 2 stats…</title><link>https://powershell.org/articles/2013-05-09-as-event-3-gets-underway-here-are-some-event-2-stats/</link><guid>https://powershell.org/articles/2013-05-09-as-event-3-gets-underway-here-are-some-event-2-stats/</guid><pubDate>Thu, 09 May 2013 23:50:57 +0000</pubDate><description>&lt;p&gt;Event 3 will be open for entries in about ten minutes, but I thought I&amp;rsquo;d share some Event 2 information. Keep in mind that Event 2 is open for voting until the 14th, GMT.&lt;br&gt;
Our Beginner Track had 120 entries this time, while the Advanced had 124. That contrasts with 165 and 159 from Event 1 - a perfectly normal falloff that&amp;rsquo;s occurred during every edition of past Games. Folks get busy, maybe get discouraged, but we&amp;rsquo;re keeping right on the trendline.&lt;br&gt;
Voting is down&amp;hellip; that happens, too, as the thrill of event 1 falls off. We had 3,966 Beginner votes and 2,775 Advanced votes in Event 1; so far we&amp;rsquo;ve gotten 1,446 Beginner and 1,131 Advanced in Event 2. Of course, we still have almost a week of voting left to go in Event 2, and in Event 1 we took a lot of votes up to the last minute.&lt;br&gt;
The good news is that Event 2&amp;rsquo;s votes have, so far, included a much higher percentage of comments. Event 1 Beginner has about 55% comments, while Advanced had 58%. In Event 2, Beginner is tracking to 63%, while Advanced is at 59%. Good job, guys - those comments are a big help. As you know, we&amp;rsquo;ve also put up some general guidelines to help keep everyone on the same page with what the score levels mean, so hopefully that&amp;rsquo;s helping, too.&lt;br&gt;
Something&amp;rsquo;s sure helping. The average score in Event 1 Beginner was 2.5585, and Advanced 2.3870. Event 2 is up a notch, at 2.6957 and 2.6631. That&amp;rsquo;s a 5% jump in Beginner scores and over 11% jump in Advanced scores. I know, people are tough on the scoring. And in some cases, I&amp;rsquo;m seeing comments that indicate the comment author had some misunderstandings. That&amp;rsquo;s okay - it&amp;rsquo;s an opportunity for us all to learn together, especially after the Games complete and we can start diving into this mess of data.&lt;br&gt;
I hope you&amp;rsquo;re already to start on Event 3! Our fastest entry so far is just over 51 minutes, and I might be saving some special prizes for the overall fastest entry (don&amp;rsquo;t worry - I&amp;rsquo;m going to look at it to make sure it&amp;rsquo;s decent).&lt;br&gt;
May the Games be Ever in Your Fav&amp;hellip; ugh, sorry. Don&amp;rsquo;t know where that came from. Good luck!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Event 3 will be open for entries in about ten minutes, but I thought I&rsquo;d share some Event 2 information. Keep in mind that Event 2 is open for voting until the 14th, GMT.<br>
Our Beginner Track had 120 entries this time, while the Advanced had 124. That contrasts with 165 and 159 from Event 1 - a perfectly normal falloff that&rsquo;s occurred during every edition of past Games. Folks get busy, maybe get discouraged, but we&rsquo;re keeping right on the trendline.<br>
Voting is down&hellip; that happens, too, as the thrill of event 1 falls off. We had 3,966 Beginner votes and 2,775 Advanced votes in Event 1; so far we&rsquo;ve gotten 1,446 Beginner and 1,131 Advanced in Event 2. Of course, we still have almost a week of voting left to go in Event 2, and in Event 1 we took a lot of votes up to the last minute.<br>
The good news is that Event 2&rsquo;s votes have, so far, included a much higher percentage of comments. Event 1 Beginner has about 55% comments, while Advanced had 58%. In Event 2, Beginner is tracking to 63%, while Advanced is at 59%. Good job, guys - those comments are a big help. As you know, we&rsquo;ve also put up some general guidelines to help keep everyone on the same page with what the score levels mean, so hopefully that&rsquo;s helping, too.<br>
Something&rsquo;s sure helping. The average score in Event 1 Beginner was 2.5585, and Advanced 2.3870. Event 2 is up a notch, at 2.6957 and 2.6631. That&rsquo;s a 5% jump in Beginner scores and over 11% jump in Advanced scores. I know, people are tough on the scoring. And in some cases, I&rsquo;m seeing comments that indicate the comment author had some misunderstandings. That&rsquo;s okay - it&rsquo;s an opportunity for us all to learn together, especially after the Games complete and we can start diving into this mess of data.<br>
I hope you&rsquo;re already to start on Event 3! Our fastest entry so far is just over 51 minutes, and I might be saving some special prizes for the overall fastest entry (don&rsquo;t worry - I&rsquo;m going to look at it to make sure it&rsquo;s decent).<br>
May the Games be Ever in Your Fav&hellip; ugh, sorry. Don&rsquo;t know where that came from. Good luck!</p>
]]></content:encoded></item><item><title>Event 2: My notes…</title><link>https://powershell.org/articles/2013-05-09-event-2-my-notes/</link><guid>https://powershell.org/articles/2013-05-09-event-2-my-notes/</guid><pubDate>Thu, 09 May 2013 21:50:28 +0000</pubDate><description>&lt;p&gt;Today I finally had some time to look at all entries in both categories. What I liked, and what I did not like about them? You can find answers, as previously, either in &lt;a href="http://powershellpl.net/2013/05/09/scripting-games-moje-notatki-2/"&gt;Polish&lt;/a&gt;, or in &lt;a href="http://becomelotr.wordpress.com/2013/05/09/event-2-my-notes/"&gt;English&lt;/a&gt;. I focused mainly on things I did not like, but I would anyway say that scripts are really good (overall) this year. Still: few poppies died. If you are responsible for it - remember: at the end of the day, it is you who is tossing away strength that PowerShell offers: Object Oriented Pipeline. 1* note is nothing in comparison with report, that will exists only as long as your &lt;strong&gt;host&lt;/strong&gt;, very same that you want to &lt;strong&gt;write&lt;/strong&gt; on so much&amp;hellip; 😉&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Today I finally had some time to look at all entries in both categories. What I liked, and what I did not like about them? You can find answers, as previously, either in<a href="http://powershellpl.net/2013/05/09/scripting-games-moje-notatki-2/">Polish</a>, or in<a href="http://becomelotr.wordpress.com/2013/05/09/event-2-my-notes/">English</a>. I focused mainly on things I did not like, but I would anyway say that scripts are really good (overall) this year. Still: few poppies died. If you are responsible for it - remember: at the end of the day, it is you who is tossing away strength that PowerShell offers: Object Oriented Pipeline. 1* note is nothing in comparison with report, that will exists only as long as your<strong>host</strong>, very same that you want to<strong>write</strong> on so much&hellip; 😉</p>
]]></content:encoded></item><item><title>Meet the Scripting Games Judges: Jan Egil Ring</title><link>https://powershell.org/articles/2013-05-09-meet-the-scripting-games-judges-jan-egil-ring/</link><guid>https://powershell.org/articles/2013-05-09-meet-the-scripting-games-judges-jan-egil-ring/</guid><pubDate>Thu, 09 May 2013 13:37:33 +0000</pubDate><description>&lt;p&gt;&lt;a href="http://twitter.com/janegilring"&gt;Jan Egil Ring&lt;/a&gt; is a multiple-year recipient of the Microsoft Most Valuable Professional Award for his contributions in the Windows PowerShell technical community.&lt;br&gt;
He has a strong passion for Windows PowerShell, and regularly writes articles on his &lt;a href="http://blog.powershell.no"&gt;blog&lt;/a&gt;. He occasionally also writes articles for others, such as the &lt;a href="http://www.powershellmagazine.com"&gt;PowerShell Magazine.&lt;/a&gt;&lt;br&gt;
As a judge in the Scripting Games, he will be writing articles on his blog reviewing both good and bad observations in the reviewed scripts. Clean formatting and avoidance of using aliases in scripts is among the things he will be paying attention to.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p><a href="http://twitter.com/janegilring">Jan Egil Ring</a> is a multiple-year recipient of the Microsoft Most Valuable Professional Award for his contributions in the Windows PowerShell technical community.<br>
He has a strong passion for Windows PowerShell, and regularly writes articles on his<a href="http://blog.powershell.no">blog</a>. He occasionally also writes articles for others, such as the<a href="http://www.powershellmagazine.com">PowerShell Magazine.</a><br>
As a judge in the Scripting Games, he will be writing articles on his blog reviewing both good and bad observations in the reviewed scripts. Clean formatting and avoidance of using aliases in scripts is among the things he will be paying attention to.</p>
]]></content:encoded></item><item><title>Scripting Games 2013: Event 2 "˜Favorite"™ and "˜Not So Favorite"™</title><link>https://powershell.org/articles/2013-05-08-scripting-games-2013-event-2-favorite-and-not-so-favorite/</link><guid>https://powershell.org/articles/2013-05-08-scripting-games-2013-event-2-favorite-and-not-so-favorite/</guid><pubDate>Thu, 09 May 2013 03:27:44 +0000</pubDate><description>&lt;p&gt;Event 2 is in the books and with that, it is time to take a look at all of the scripts submitted and make the difficult decisions as to which ones I liked and which ones I didn&amp;rsquo;t quite like.  Just because a script landed on my &amp;ldquo;˜Not so Favorite&amp;rdquo;™ list doesn&amp;rsquo;t mean it was terrible. It was just that I felt that there were some things here and there that could have been looked at a little differently. In fact, the amount of submissions that were great really made my decisions much for difficult. Everyone has really shown just how much knowledge is out there and how there are many different approaches to a single problem!&lt;br&gt;
Check out my picks &lt;a href="http://learn-powershell.net/2013/05/08/scripting-games-2013-event-2-favorite-and-not-so-favorite/"&gt;here&lt;/a&gt;.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Event 2 is in the books and with that, it is time to take a look at all of the scripts submitted and make the difficult decisions as to which ones I liked and which ones I didn&rsquo;t quite like.  Just because a script landed on my &ldquo;˜Not so Favorite&rdquo;™ list doesn&rsquo;t mean it was terrible. It was just that I felt that there were some things here and there that could have been looked at a little differently. In fact, the amount of submissions that were great really made my decisions much for difficult. Everyone has really shown just how much knowledge is out there and how there are many different approaches to a single problem!<br>
Check out my picks<a href="http://learn-powershell.net/2013/05/08/scripting-games-2013-event-2-favorite-and-not-so-favorite/">here</a>.</p>
]]></content:encoded></item><item><title>Event 2 Smart-Aleck</title><link>https://powershell.org/articles/2013-05-08-event-2-smart-aleck/</link><guid>https://powershell.org/articles/2013-05-08-event-2-smart-aleck/</guid><pubDate>Wed, 08 May 2013 21:08:11 +0000</pubDate><description>&lt;p&gt;Very funny.&lt;a href="https://powershell.org/wp-content/uploads/2013/05/FirefoxScreenSnapz001.jpg"&gt;
&lt;/a&gt;&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/05/FirefoxScreenSnapz001.jpg"&gt;&lt;img src="https://powershell.org/wp-content/uploads/2013/05/FirefoxScreenSnapz001.jpg" alt="FirefoxScreenSnapz001"&gt;&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Very funny.<a href="https://powershell.org/wp-content/uploads/2013/05/FirefoxScreenSnapz001.jpg"/><br><a href="https://powershell.org/wp-content/uploads/2013/05/FirefoxScreenSnapz001.jpg"><img src="https://powershell.org/wp-content/uploads/2013/05/FirefoxScreenSnapz001.jpg" alt="FirefoxScreenSnapz001"/></p>
]]></content:encoded></item><item><title>More Judges' Notes on Event 2</title><link>https://powershell.org/articles/2013-05-08-more-judges-notes-on-event-2/</link><guid>https://powershell.org/articles/2013-05-08-more-judges-notes-on-event-2/</guid><pubDate>Wed, 08 May 2013 19:42:02 +0000</pubDate><description>&lt;p&gt;Tobias Weltner: &lt;a href="http://www.powertheshell.com/scripting-games-task-2-commentary/"&gt;http://www.powertheshell.com/scripting-games-task-2-commentary/&lt;/a&gt;&lt;br&gt;
Jan Egil Ring: &lt;a href="http://blog.powershell.no/2013/05/08/2013-scripting-games-learning-points-from-event-2/"&gt;http://blog.powershell.no/2013/05/08/2013-scripting-games-learning-points-from-event-2/&lt;/a&gt;&lt;br&gt;
Voting for Event 2 is going strong, and you&amp;rsquo;ve got several more days in which to vote and (most importantly) add comments. Hopefully, you&amp;rsquo;re also considering the judges&amp;rsquo; notes and adjusting your approach for each event.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Tobias Weltner:<a href="http://www.powertheshell.com/scripting-games-task-2-commentary/">http://www.powertheshell.com/scripting-games-task-2-commentary/</a><br>
Jan Egil Ring:<a href="http://blog.powershell.no/2013/05/08/2013-scripting-games-learning-points-from-event-2/">http://blog.powershell.no/2013/05/08/2013-scripting-games-learning-points-from-event-2/</a><br>
Voting for Event 2 is going strong, and you&rsquo;ve got several more days in which to vote and (most importantly) add comments. Hopefully, you&rsquo;re also considering the judges&rsquo; notes and adjusting your approach for each event.</p>
]]></content:encoded></item><item><title>Notes on Beginner Event 2</title><link>https://powershell.org/articles/2013-05-08-notes-on-beginner-event-2/</link><guid>https://powershell.org/articles/2013-05-08-notes-on-beginner-event-2/</guid><pubDate>Wed, 08 May 2013 15:29:51 +0000</pubDate><description>&lt;p&gt; First of all, congratulations! It looks to me like a lot of learning is going on; the 2nd event entries look really good to me. I especially liked the way a number of you built up a one-liner by starting with a_ Get-WmiObject Win32_ComputerSystem -ComputerName (Get-Content file.txt)_ and piping it into &lt;em&gt;Select-Object&lt;/em&gt; to generate the data. However, there were a couple of areas within the Select block that make me think that some more discussion of what $_ means in a pipeline would be helpful.&lt;br&gt;
Within the Select block, it is necessary to make a call to &lt;em&gt;Get-WmiObject Win32_OperatingSystem&lt;/em&gt; to get come additional information. It looks like everybody got the format correct: &lt;em&gt;@{Name=&amp;lsquo;OS&amp;rsquo;;Expression={Get-WmiObject}}&lt;/em&gt; where folks got into trouble was in specifying the ComputerName property. Some didn&amp;rsquo;t even include it, meaning that the OS value would be taken from the local computer and not the remote one. But, more often than not, the code contained a plain $_ : &lt;em&gt;@{Name=&amp;lsquo;OS&amp;rsquo;;Expression={(Get-WmiObject Win32_OperatingSystem -ComputerName $&lt;/em&gt;).Caption}}&lt;em&gt;. So, what&amp;rsquo;s wrong with this? The problem is the value of $&lt;/em&gt; at this point in the pipeline.&lt;br&gt;
Let&amp;rsquo;s try an experiment to show what I mean. Try this:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p> First of all, congratulations! It looks to me like a lot of learning is going on; the 2nd event entries look really good to me. I especially liked the way a number of you built up a one-liner by starting with a_ Get-WmiObject Win32_ComputerSystem -ComputerName (Get-Content file.txt)_ and piping it into<em>Select-Object</em> to generate the data. However, there were a couple of areas within the Select block that make me think that some more discussion of what $_ means in a pipeline would be helpful.<br>
Within the Select block, it is necessary to make a call to<em>Get-WmiObject Win32_OperatingSystem</em> to get come additional information. It looks like everybody got the format correct:<em>@{Name=&lsquo;OS&rsquo;;Expression={Get-WmiObject}}</em> where folks got into trouble was in specifying the ComputerName property. Some didn&rsquo;t even include it, meaning that the OS value would be taken from the local computer and not the remote one. But, more often than not, the code contained a plain $_ :<em>@{Name=&lsquo;OS&rsquo;;Expression={(Get-WmiObject Win32_OperatingSystem -ComputerName $</em>).Caption}}<em>. So, what&rsquo;s wrong with this? The problem is the value of $</em> at this point in the pipeline.<br>
Let&rsquo;s try an experiment to show what I mean. Try this:</p><p><code>Get-WmiObject Win32_ComputerSystem | Select-Object @{Name='OS';Expression={Get-WmiObject Win32_OperatingSystem -ComputerName $_}}</code>What does it return? Only the label &ldquo;OS&rdquo; with no data and no error message. Why? To find out, lets change the code a little and see.</p><p><code>Get-WmiObject Win32_ComputerSystem | foreach {Get-WmiObject Win32_OperatingSystem -ComputerName $_}</code>This time, we do get an error message:</p><p><code>Get-WmiObject : Invalid parameter At line:1 char:47 + Get-WmiObject Win32_ComputerSystem | foreach {Get-WmiObject Win32_OperatingSyste ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand</code> &ldquo;Invalid Parameter&rdquo; means that $_ isn&rsquo;t a computer name. What is it? It&rsquo;s actually the entire Win32_ComputerSystem object. What you need to do is to select one of the object properties that contains the system&rsquo;s name ($<em>.__SERVER, $</em>.Name, or $<em>.PSComputerName).<br>
Hopefully, this wasn&rsquo;t too long or complex a description. The point is be careful in your pipelines that you know exactly what $</em> means at each step.</p><blockquote/>]]></content:encoded></item><item><title>Tips on Implementing Pipeline Support</title><link>https://powershell.org/articles/2013-05-07-tips-on-implementing-pipeline-support/</link><guid>https://powershell.org/articles/2013-05-07-tips-on-implementing-pipeline-support/</guid><pubDate>Wed, 08 May 2013 03:16:27 +0000</pubDate><description>&lt;p&gt;While reviewing Event 1 (and now Event 2) I&amp;rsquo;ve seen some scripts that don&amp;rsquo;t quite have the correct pipeline support and others that do a great job with it. Whether it is an unneeded Begin or End statement, or throwing everything into a Process block and not quite getting the expected output or even having a Process block when ValueFromPipeline/ValueFromPipelineByPropertyName is not even enabled. Before I start working through my notes for Event 2, I wanted to get this post out of the way. I hope that what I put together here will help those out who are working to implement pipeline support in their code as well as providing a method of troubleshooting the parameter binding using Trace-Command. The blog post is available &lt;a href="http://learn-powershell.net/2013/05/07/tips-on-implementing-pipeline-support/"&gt;here to view&lt;/a&gt;.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>While reviewing Event 1 (and now Event 2) I&rsquo;ve seen some scripts that don&rsquo;t quite have the correct pipeline support and others that do a great job with it. Whether it is an unneeded Begin or End statement, or throwing everything into a Process block and not quite getting the expected output or even having a Process block when ValueFromPipeline/ValueFromPipelineByPropertyName is not even enabled. Before I start working through my notes for Event 2, I wanted to get this post out of the way. I hope that what I put together here will help those out who are working to implement pipeline support in their code as well as providing a method of troubleshooting the parameter binding using Trace-Command. The blog post is available<a href="http://learn-powershell.net/2013/05/07/tips-on-implementing-pipeline-support/">here to view</a>.</p>
]]></content:encoded></item><item><title>PhillyPoSH 05/02/2013 meeting summary and presentation materials</title><link>https://powershell.org/articles/2013-05-07-phillyposh-05022013-meeting-summary-and-presentation-materials/</link><guid>https://powershell.org/articles/2013-05-07-phillyposh-05022013-meeting-summary-and-presentation-materials/</guid><pubDate>Wed, 08 May 2013 02:56:14 +0000</pubDate><description>&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://jeffwouters.nl/"&gt;Jeff Wouters&lt;/a&gt; gave an excellent &lt;a href="https://powershell.org/wp-content/uploads/2013/05/PhillyPosh_2013-05-02_Presentation_JeffWouters.zip"&gt;presentation &lt;/a&gt;via Lync on:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; Avoiding the pipeline
-
Improving your learning curve
-
Improving your teaching curve
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://technet.microsoft.com/en-us/library/hh529924%28v=exchg.141%29.aspx#BKMK_MultiValueCustom"&gt;John Mello&lt;/a&gt; gave a &lt;a href="https://powershell.org/wp-content/uploads/2013/05/PhillyPosh_2013-05-02_ScriptClub.zip"&gt;presentation and demo of script &lt;/a&gt;that uses &lt;a href="http://technet.microsoft.com/en-us/library/hh529924%28v=exchg.141%29.aspx#BKMK_MultiValueCustom"&gt;Exchange multi-valued custom attributes&lt;/a&gt; to store information on when to remove users from a security group after a specified amount of days.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Standalone meeting material links&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[PhillyPosh_2013-05-02_ScriptClub](https://powershell.org/wp-content/uploads/2013/05/PhillyPosh_2013-05-02_ScriptClub.zip)
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://powershell.org/wp-content/uploads/2013/05/PhillyPosh_2013-05-02_Presentation_JeffWouters.zip"&gt;PhillyPosh_2013-05-02_Presentation_JeffWouters&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</description><content:encoded>&lt;![CDATA[<ul><li><p><a href="http://jeffwouters.nl/">Jeff Wouters</a> gave an excellent<a href="https://powershell.org/wp-content/uploads/2013/05/PhillyPosh_2013-05-02_Presentation_JeffWouters.zip">presentation</a>via Lync on:</p><pre><code> Avoiding the pipeline
-
Improving your learning curve
-
Improving your teaching curve</code></pre><ul><li><p><a href="http://technet.microsoft.com/en-us/library/hh529924%28v=exchg.141%29.aspx#BKMK_MultiValueCustom">John Mello</a> gave a<a href="https://powershell.org/wp-content/uploads/2013/05/PhillyPosh_2013-05-02_ScriptClub.zip">presentation and demo of script</a>that uses<a href="http://technet.microsoft.com/en-us/library/hh529924%28v=exchg.141%29.aspx#BKMK_MultiValueCustom">Exchange multi-valued custom attributes</a> to store information on when to remove users from a security group after a specified amount of days.</p></li><li><p>Standalone meeting material links</p><pre><code>[PhillyPosh_2013-05-02_ScriptClub](https://powershell.org/wp-content/uploads/2013/05/PhillyPosh_2013-05-02_ScriptClub.zip)</code></pre><ul><li><a href="https://powershell.org/wp-content/uploads/2013/05/PhillyPosh_2013-05-02_Presentation_JeffWouters.zip">PhillyPosh_2013-05-02_Presentation_JeffWouters</a></li></ul></li></ul></li></ul>
]]></content:encoded></item><item><title>Don's Event 2 Notes</title><link>https://powershell.org/articles/2013-05-07-dons-event-2-notes/</link><guid>https://powershell.org/articles/2013-05-07-dons-event-2-notes/</guid><pubDate>Tue, 07 May 2013 23:02:02 +0000</pubDate><description>&lt;p&gt;I thought I&amp;rsquo;d mentioned this last time (tap tap, this thing on?), but maybe not: don&amp;rsquo;t format the output of your functions. The minute a function includes Format-*, you&amp;rsquo;ve trapped me into on-screen display, a text file or piece of paper modeled after the on-screen display, or not a lot of other choices. If I want formatting, I&amp;rsquo;ll pipe your function to my own Format-* command of choice. But if I want CSV, or HTML, or XML, I&amp;rsquo;d like that option. Thanks.&lt;br&gt;
This is not a favorite technique of mine:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I thought I&rsquo;d mentioned this last time (tap tap, this thing on?), but maybe not: don&rsquo;t format the output of your functions. The minute a function includes Format-*, you&rsquo;ve trapped me into on-screen display, a text file or piece of paper modeled after the on-screen display, or not a lot of other choices. If I want formatting, I&rsquo;ll pipe your function to my own Format-* command of choice. But if I want CSV, or HTML, or XML, I&rsquo;d like that option. Thanks.<br>
This is not a favorite technique of mine:</p><p><code>$ServerInfo = "" | Select-Object Name, SerialNumber, OS, Model, CPU, CPUCount, Memory, GBMemory $ServerInfo.Name = $Server.ToUpper() $ServerInfo.SerialNumber =(Get-WmiObject -Class Win32_BIOS -ComputerName $Server -Credential $Credential).SerialNumber</code>That said, it&rsquo;s not &ldquo;wrong&rdquo; so I only knock of like 1/10th of a point. For me, this technique is a bit of a hack, and it doesn&rsquo;t parse well visually. You&rsquo;re relying on Select-Object accepting non-existent property names and turning them into blank properties for you. It&rsquo;s&hellip; well, it&rsquo;s weird, and frankly this behavior - while convenient in this instance - causes more harm than good. Ever typo a property name on Select, and get a blank column as a result? Yeah, that. I wish Select didn&rsquo;t work this way, and so as a result I&rsquo;m not a fan of this technique.<br>
-&ndash;</p><p><code>if ($ServerInfo.CPU -is [array]) { $ServerInfo.CPU = $ServerInfo.CPU[0] }</code>Nice thinking, muchacho. You don&rsquo;t know if you&rsquo;ve got more than one object, so you check. I&rsquo;ll note, however, that this could have been done more concisely when you got the property:</p><p><code>$ServerInfo.CPU = (Get-WmiObject -Class Win32_Processor -ComputerName $Server -Credential $Credential).Name</code>Add a<strong>Select -First 1</strong> to the end of that and you&rsquo;d be guaranteed of only having one.<br>
-&ndash;</p><p><code>$ServerInfo.SerialNumber =(Get-WmiObject -Class Win32_BIOS -ComputerName $Server -Credential $Credential).SerialNumber $ServerInfo.OS = (Get-WmiObject -Class Win32_OperatingSystem -ComputerName $Server -Credential $Credential).Caption $ServerInfo.Model = (Get-WmiObject -Class Win32_ComputerSystem -ComputerName $Server -Credential $Credential).Model $ServerInfo.CPU = (Get-WmiObject -Class Win32_Processor -ComputerName $Server -Credential $Credential).Name $ServerInfo.CPUCount = (Get-WmiObject -Class Win32_Processor -ComputerName $Server -Credential $Credential).count $ServerInfo.Memory = (Get-WmiObject -Class Win32_ComputerSystem -ComputerName $Server -Credential $Credential).TotalPhysicalMemory</code>Saw a lotta this. I&rsquo;m kinda picking examples from one script, but this happened a lot. You&rsquo;re executing 6 queries. You needed 3. Double the effort, double the time. Bad call. Query it once, save it in a variable, extract what you need from that.<br>
-&ndash;</p><p><code>param( [Parameter( Position=0, Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true )] [string[]]$computers )</code>This hurts a little. Look at every native PowerShell command that accepts computer names, and it does so on a -ComputerName parameter. So why pick -computers for your function and be all nonstandard? Stay consistent.<br>
-&ndash;</p><p><code>$s = New-Object System.Object $os = Get-WmiObject -Class Win32_OperatingSystem -ComputerName $computer $s | Add-Member -Type NoteProperty -Name "Server Name" -Value $os.CSName $s | Add-Member -Type NoteProperty -Name "OS Version" -Value $os.Caption $cs = Get-WmiObject -Class Win32_ComputerSystem -ComputerName $computer $mem = [string]([Math]::Round(($cs.TotalPhysicalMemory / 1MB),2)) + " MB" $s | Add-Member -Type NoteProperty -Name "PhysicalMem" -Value $mem $s | Add-Member -Type NoteProperty -Name "# CPUs" -Value $cs.NumberOfProcessors $cpu = Get-WmiObject -Class Win32_Processor -ComputerName $computer</code>Ahh, that&rsquo;s better. One query per class, then extract what you want from a variable. You can be a bit more concise using a hashtable, but I&rsquo;m jiggy with this technique.<br>
I said &ldquo;jiggy.&rdquo;<br>
-&ndash;<br>
I want to point out that Dr. Scripto was optional about the &ldquo;number of cores in each socket&rdquo; thing. He said, &ldquo;if you can do it.&rdquo; You can&rsquo;t. Not readily; XP doesn&rsquo;t expose that information (having existed before the advent of cores, um, time to upgrade okaythanksbuhbye) so you couldn&rsquo;t get it consistently for all of the operating systems you were asked for. Sometimes, the test is about seeing when you know to quit, not seeing if you can piledrive your way into a half-answer.<br>
-&ndash;<br>
You know you totally get downvoted if you don&rsquo;t include comment-based help with functions, right? Advanced track only. Just saying.-&ndash;</p><p><code>"Server name: " + $Info.Caption "OS: " + $Info2.Caption + $Info2.CSDVersion "Processor sockets: " + $Info.NumberOfProcessors "Processor cores: " + $Info.NumberOfLogicalProcessors "Physical memory: " + [Math]::Round(($Info.TotalPhysicalMemory/1GB),2) + "GB"</code>Yeah. Outputting formatted text instead of objects. I know. I cried for the dead puppies, and then drank. I drank<em>vodka.</em> I hate vodka, but the puppies. There is seriously a better way to output - outputting text prevents PowerShell from doing ANYTHING USEFUL with your output.<a href="http://scriptinggames.org/entrylist.php?entryid=519">See how this guy did it</a>? Do that. I&rsquo;m not a huge ordered hashtable fan, but that&rsquo;s just me. I don&rsquo;t hate them as much as vodka. Or text output.<br>
-&ndash;<br><a href="http://scriptinggames.org/entrylist.php?entryid=552">This one is trending well</a>. I get it. It&rsquo;s beautiful. I think I wrote a book about this. My ONLY SINGLE NITPICK is that it&rsquo;s maybe a wee bit overwrought. I think it&rsquo;s because of the whole try CIM, then try DCOM, thing. He probably had to do it this way. I wish the new CIM cmdlets didn&rsquo;t require an explicit session to do DCOM. I think that&rsquo;s a big fail, because it forces you to write functions like this. Meh. I should write a proxy function for this. Anyway.<br>
-&ndash;</p><p><code>Write-Verbose -Message 'Creating runspace pool' $rp = [System.Management.Automation.Runspaces.RunspaceFactory]::CreateRunspacePool(1, $ThrottleLimit, $iss, $Host) $rp.Open()</code>I have no idea what to do with this.<a href="http://scriptinggames.org/entrylist.php?entryid=482">Here&rsquo;s the whole thing</a>. This person is likely a LOT smarter than me. Certainly WAY more patient. I&rsquo;m not sure Dr. Scripto anticipated a 317-line solution. I think he&rsquo;s rolled his own multithreading here. Just&hellip; wow. It&rsquo;s definitely overkill, by an order of magnitude, but props, man.<br>
Someone can explain it to me sometime after the vodka wears off, yeah?<br>
-&ndash;<br>
People are<a href="http://scriptinggames.org/entrylist.php?entryid=513">hating on this one</a>. They&rsquo;re wrong. It&rsquo;s a good entry. Let me tell you something, stop giving a score of &ldquo;2&rdquo; because someone did something<em>extra</em> like add logging. If it works, they went above and beyond. Do you not reward people for going above and beyond in your organization? No? Well, you should.</p>
]]></content:encoded></item><item><title>Are you getting unfair comments in the Games?</title><link>https://powershell.org/articles/2013-05-07-are-you-geting-unfair-comments-in-the-games/</link><guid>https://powershell.org/articles/2013-05-07-are-you-geting-unfair-comments-in-the-games/</guid><pubDate>Tue, 07 May 2013 17:33:59 +0000</pubDate><description>&lt;p&gt;I continue to be amused by folks&amp;rsquo; reactions to the Games this year.&lt;br&gt;
There&amp;rsquo;s been some buzz on Twitter this morning from folks who feel some of their comments - and the corresponding low scores - aren&amp;rsquo;t warranted. In a couple of cases I&amp;rsquo;ve looked at, they&amp;rsquo;re right - their entries are being downrated for reasons that are actually not best practices; by following the best practices, these entries are getting lower scores.&lt;br&gt;
This reinforces a point I keep trying to make: The Games &lt;em&gt;&lt;strong&gt;aren&amp;rsquo;t about YOU. They&amp;rsquo;re about US.&lt;/strong&gt;&lt;/em&gt; ****&lt;br&gt;
Let me put it another way: if you&amp;rsquo;re getting comments from folks whose opinions are founded in a misunderstanding or misconception, that&amp;rsquo;s an opportunity to educate. Not to attack that commenter - which is why commenter names aren&amp;rsquo;t shown - but to educate the community in general. The community took the time to give you comments, and although some of them might be misguided, &lt;em&gt;you&lt;/em&gt; can take the time to offer a productive counterpoint and perhaps lay some misunderstandings to rest.&lt;br&gt;
That&amp;rsquo;s the point of the Games: to learn. Maybe not for &lt;strong&gt;you&lt;/strong&gt; to learn, but maybe for you to help &lt;strong&gt;someone else&lt;/strong&gt; learn. Or to put it another way, I haven&amp;rsquo;t received Microsoft&amp;rsquo;s MVP Award for ten years straight because I got a good &amp;ldquo;score&amp;rdquo; on something. I got it because I look for teachable moments and try to offer explanations. Being able to teach something shows that you &lt;em&gt;really&lt;/em&gt; know it.&lt;br&gt;
Think of your Games entries as a honeypot. If you can attract some folks who don&amp;rsquo;t quite get what you&amp;rsquo;re doing, then through the comments you&amp;rsquo;ll spot broad areas of educational opportunity, or what I call &amp;ldquo;teachable moments.&amp;rdquo; Seize on those and help bring the community as a whole to a higher level.&lt;br&gt;
Does that mean the educational opportunity has to come at the cost of you getting a lower score? Yup. Will that score in any other way impact your life? Nope. It&amp;rsquo;s not going on your permanent record. Human Resources will never know. It won&amp;rsquo;t affect your salary, or your ability to choose which movie you will see this weekend (Iron Man 3, BTW). Thicken up that skin a little - every vote isn&amp;rsquo;t a personal attack on you. Every &amp;ldquo;unqualified&amp;rdquo; comment is not a stain upon your honor.&lt;br&gt;
I really wish I could use some of the cooler interjections from &lt;em&gt;Spartacus&lt;/em&gt; here, but none of that stuff is suitable for a professional environment :(.&lt;br&gt;
In short: Cool yer jets. Take the opportunity to educate. Not on Twitter. Man, you guys with the tweets. You don&amp;rsquo;t have a blog, drop me an e-mail and I&amp;rsquo;ll give you authoring permissions right here on PowerShell.org. Help us, as a community, educate each other.&lt;br&gt;
And hey, remember not ALL of your comments are non-constructive. Learn from the ones you can, tune out the rest. Like watching CNN. Ever notice how, on a slow news day, the talk about Atlanta&amp;rsquo;s traffic? Exactly.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I continue to be amused by folks&rsquo; reactions to the Games this year.<br>
There&rsquo;s been some buzz on Twitter this morning from folks who feel some of their comments - and the corresponding low scores - aren&rsquo;t warranted. In a couple of cases I&rsquo;ve looked at, they&rsquo;re right - their entries are being downrated for reasons that are actually not best practices; by following the best practices, these entries are getting lower scores.<br>
This reinforces a point I keep trying to make: The Games<em><strong>aren&rsquo;t about YOU. They&rsquo;re about US.</strong></em> ****<br>
Let me put it another way: if you&rsquo;re getting comments from folks whose opinions are founded in a misunderstanding or misconception, that&rsquo;s an opportunity to educate. Not to attack that commenter - which is why commenter names aren&rsquo;t shown - but to educate the community in general. The community took the time to give you comments, and although some of them might be misguided,<em>you</em> can take the time to offer a productive counterpoint and perhaps lay some misunderstandings to rest.<br>
That&rsquo;s the point of the Games: to learn. Maybe not for<strong>you</strong> to learn, but maybe for you to help<strong>someone else</strong> learn. Or to put it another way, I haven&rsquo;t received Microsoft&rsquo;s MVP Award for ten years straight because I got a good &ldquo;score&rdquo; on something. I got it because I look for teachable moments and try to offer explanations. Being able to teach something shows that you<em>really</em> know it.<br>
Think of your Games entries as a honeypot. If you can attract some folks who don&rsquo;t quite get what you&rsquo;re doing, then through the comments you&rsquo;ll spot broad areas of educational opportunity, or what I call &ldquo;teachable moments.&rdquo; Seize on those and help bring the community as a whole to a higher level.<br>
Does that mean the educational opportunity has to come at the cost of you getting a lower score? Yup. Will that score in any other way impact your life? Nope. It&rsquo;s not going on your permanent record. Human Resources will never know. It won&rsquo;t affect your salary, or your ability to choose which movie you will see this weekend (Iron Man 3, BTW). Thicken up that skin a little - every vote isn&rsquo;t a personal attack on you. Every &ldquo;unqualified&rdquo; comment is not a stain upon your honor.<br>
I really wish I could use some of the cooler interjections from<em>Spartacus</em> here, but none of that stuff is suitable for a professional environment :(.<br>
In short: Cool yer jets. Take the opportunity to educate. Not on Twitter. Man, you guys with the tweets. You don&rsquo;t have a blog, drop me an e-mail and I&rsquo;ll give you authoring permissions right here on PowerShell.org. Help us, as a community, educate each other.<br>
And hey, remember not ALL of your comments are non-constructive. Learn from the ones you can, tune out the rest. Like watching CNN. Ever notice how, on a slow news day, the talk about Atlanta&rsquo;s traffic? Exactly.</p>
]]></content:encoded></item><item><title>Scripting Games Event 1 Winners</title><link>https://powershell.org/articles/2013-05-07-scripting-games-event-1-winners/</link><guid>https://powershell.org/articles/2013-05-07-scripting-games-event-1-winners/</guid><pubDate>Tue, 07 May 2013 16:11:57 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;re pleased to announce the winners for Event 1 of The Scripting Games 2013!&lt;br&gt;
Winners: You can log into &lt;a href="http://scriptinggames.org/"&gt;The Scripting Games Web site&lt;/a&gt; and go to your Profile page to see your prize. You will be given a prize redemption code and either a URL where you can redeem it, or an e-mail address of the prize provider (they will need the redemption code). All prizes must be claimed by the end of July 2013. I will list winners by username; if you used your e-mail address as your username, then a portion of that will be truncated for your privacy. Anyone can log in and check their Profile page to see if they&amp;rsquo;ve won a prize.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;re pleased to announce the winners for Event 1 of The Scripting Games 2013!<br>
Winners: You can log into<a href="http://scriptinggames.org/">The Scripting Games Web site</a> and go to your Profile page to see your prize. You will be given a prize redemption code and either a URL where you can redeem it, or an e-mail address of the prize provider (they will need the redemption code). All prizes must be claimed by the end of July 2013. I will list winners by username; if you used your e-mail address as your username, then a portion of that will be truncated for your privacy. Anyone can log in and check their Profile page to see if they&rsquo;ve won a prize.</p><ul><li><p>Event 1 Beginner First Place (free ebook from Manning): taygibb</p></li><li><p>Event 1 Beginner Second Place (free video training from Interface Technical Training): alvaroBT</p></li><li><p>Event 1 Beginner Third Place (free year of Phoneominal service from Start-Automating): Novice</p></li><li><p>Event 1 Advanced First Place (free ebook from Manning): mikefrobbins</p></li><li><p>Event 1 Advanced Second Place (free video training from Interface Technical Training): Toni</p></li><li><p>Event 1 Advanced Third Place (free year of Phoneominal service from Start-Automating): lido</p></li><li><p>Event 1 Beginner Top CrowdScore (free ebook from Manning): taygibb</p></li><li><p>Event 1 Advanced Top CrowdScore (free ebook from Manning): mikefrobbins</p></li><li><p>CrowdScore Voter (free month of video training from Interface Technical Training): kirkaldrin</p></li><li><p>CrowdScore Voter (free month of video training from Interface Technical Training): KmTatar</p></li><li><p>CrowdScore Voter (free ebook from Manning): Klaus_Schulte</p></li><li><p>CrowdScore Voter (free ebook from Manning): Daniel</p></li><li><p>CrowdScore Voter ($50 Gift Certificate from SAPIEN Technologies): theotherkidd@__.com</p></li></ul><p>Congratulations to all of our winners! Note that our top three prizes in each category were awarded by our Mighty Panel of Celebrity Judges. Each judge nominated a first, second, and third place winner from the entries that our expert commentators identified as &ldquo;best.&rdquo; Those nominations were compiled, and in the event of a tie the earliest entry was deemed winner (that didn&rsquo;t happen, actually). I&rsquo;m mildly surprised that our community voting identified the same top scripters in each track - the 1st, 2nd, and 3rd-place award process didn&rsquo;t factor in the CrowdScore at all.</p>
]]></content:encoded></item><item><title>PowerShell Summit Videos</title><link>https://powershell.org/articles/2013-05-07-powershell-summit-videos/</link><guid>https://powershell.org/articles/2013-05-07-powershell-summit-videos/</guid><pubDate>Tue, 07 May 2013 15:52:59 +0000</pubDate><description>&lt;p&gt;Aaron Hoover, one of our Summit attendees, was kind enough to record via webcam the sessions he attended - and he&amp;rsquo;s posted about 13 hours of video on YouTube for your viewing pleasure.&lt;br&gt;
What I&amp;rsquo;d like to know from you, if you don&amp;rsquo;t mind dropping a comment below, is what you think of these. If we offered this KIND of recording in the future, would it be helpful? This is something we can do easily and is affordable from a technical perspective; there&amp;rsquo;s obviously a production quality compromise. We can do more&amp;hellip; but it costs more, and someone&amp;rsquo;s going to have to pay for it. So&amp;hellip; where do you sit on this kind of recording?&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Aaron Hoover, one of our Summit attendees, was kind enough to record via webcam the sessions he attended - and he&rsquo;s posted about 13 hours of video on YouTube for your viewing pleasure.<br>
What I&rsquo;d like to know from you, if you don&rsquo;t mind dropping a comment below, is what you think of these. If we offered this KIND of recording in the future, would it be helpful? This is something we can do easily and is affordable from a technical perspective; there&rsquo;s obviously a production quality compromise. We can do more&hellip; but it costs more, and someone&rsquo;s going to have to pay for it. So&hellip; where do you sit on this kind of recording?</p><ul><li><a href="http://youtu.be/0NeEU3FHp8I">http://youtu.be/0NeEU3FHp8I</a> Device Management With PowerShell - Ricardo Mendes - PowerShell Summit 2013</li><li><a href="http://youtu.be/XsnE_OQGvdo">http://youtu.be/XsnE_OQGvdo</a> Creating a Complex and Reusable HTML Reporting Structure - Alan Renouf - PowerShell Summit 2013</li><li><a href="http://youtu.be/iV6cYsQDL0Y">http://youtu.be/iV6cYsQDL0Y</a> How Secure Can You Be - Jeff Hicks PowerShell Summit 2013</li><li><a href="http://youtu.be/qSE06GkQWV4">http://youtu.be/qSE06GkQWV4</a> Standards Based Hardware Management - Steve Lee - PowerShell Summit 2013</li><li><a href="http://youtu.be/7C53pawPw3Y">http://youtu.be/7C53pawPw3Y</a> Workshop - Automating for DevOps - Kenneth Hansen and Hemant Mahawar - PowerShell Summit 2013</li><li><a href="http://youtu.be/KFA-zSojxqw">http://youtu.be/KFA-zSojxqw</a> CIM Sessions - Richard Siddaway - PowerShell Summit 2013</li><li><a href="http://youtu.be/EloMKpvfES8">http://youtu.be/EloMKpvfES8</a> PowerShell Web Access - Richard Siddaway - PowerShell Summit 2013</li><li><a href="http://youtu.be/3deY6e6Npzo">http://youtu.be/3deY6e6Npzo</a> Sapien PowerShell Products - David Corrales - PowerShell Summit 2013</li><li><a href="http://youtu.be/xZtapxf1ytI">http://youtu.be/xZtapxf1ytI</a> What I learned Judging 5000 Scripts - Ed Wilson - PowerShell Summit 2013</li><li><a href="http://youtu.be/Ahvs1rGPk1s">http://youtu.be/Ahvs1rGPk1s</a> PowerShell Events - Richard Siddaway - PowerShell Summit 2013</li><li><a href="http://youtu.be/U_niW85TtJE">http://youtu.be/U_niW85TtJE</a> Write Modules, Not Scripts - Ed Wilson - PowerShell Summit 2013</li><li><a href="http://youtu.be/Y8IbadEHoPg">http://youtu.be/Y8IbadEHoPg</a> PoshMon - PowerShell Does Performance Counters - Ed Wilson - PowerShell Summit 2013</li><li><a href="http://youtu.be/1XuB71tLNvg">http://youtu.be/1XuB71tLNvg</a> Configuring Your PowerShell Workflow Environment - Aleksandar Nikolic - PowerShell Summit 2013</li><li><a href="http://youtu.be/msHGx-mxWJA">http://youtu.be/msHGx-mxWJA</a> Practical PowerShell Integration from Bare Metal to the Cloud - Alan Renouf - PowerShell Summit 2013</li><li><a href="http://youtu.be/eAZ-agh182g">http://youtu.be/eAZ-agh182g</a> Source Control for IT Pros - Andy Schneider - PowerShell Summit 2013</li><li><a href="http://youtu.be/pL_Ry5LzX3w">http://youtu.be/pL_Ry5LzX3w</a> Creating HTML Reports with Style - Jeff Hicks - PowerShell Summit 2013</li><li><a href="http://youtu.be/-ERyfmOmyoI">http://youtu.be/-ERyfmOmyoI</a> Remoting Configuration Deep Dive - Don Jones - PowerShell Summit 2013</li><li><a href="http://youtu.be/jMVBN5V0G4Y">http://youtu.be/jMVBN5V0G4Y</a> Advanced Network Scripting with PowerShell - Lee Holmes - PowerShell Summit 2013</li><li><a href="http://youtu.be/GXkLtEOM-DM">http://youtu.be/GXkLtEOM-DM</a> Build Your Demo Environment with Windows PowerShell - Aleksandar Nikolic - PowerShell Summit 2013</li></ul>
]]></content:encoded></item><item><title>Event 2: My way…</title><link>https://powershell.org/articles/2013-05-06-event-2-my-way/</link><guid>https://powershell.org/articles/2013-05-06-event-2-my-way/</guid><pubDate>Tue, 07 May 2013 04:26:03 +0000</pubDate><description>&lt;p&gt;I haven&amp;rsquo;t received any negative feedback on idea to blog about &amp;ldquo;&lt;em&gt;how would I do it&lt;/em&gt;&amp;rdquo; (what you think about my approach is different topic) so I decided to continue. Again: because I don&amp;rsquo;t want to be influenced by your ideas and make my task as close to your work as possible I post it early, before I see any of cool techniques I haven&amp;rsquo;t thought of and you did, so that I can regret it later. &lt;a href="http://becomelotr.wordpress.com/2013/05/07/event-2-my-way/"&gt;You can find whole article on my blog&lt;/a&gt;. Enjoy, and please - if you see something silly, let me know. I really &lt;strong&gt;do&lt;/strong&gt; appreciate negative feedback!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I haven&rsquo;t received any negative feedback on idea to blog about &ldquo;<em>how would I do it</em>&rdquo; (what you think about my approach is different topic) so I decided to continue. Again: because I don&rsquo;t want to be influenced by your ideas and make my task as close to your work as possible I post it early, before I see any of cool techniques I haven&rsquo;t thought of and you did, so that I can regret it later.<a href="http://becomelotr.wordpress.com/2013/05/07/event-2-my-way/">You can find whole article on my blog</a>. Enjoy, and please - if you see something silly, let me know. I really<strong>do</strong> appreciate negative feedback!</p>
]]></content:encoded></item><item><title>Event 2 is final!</title><link>https://powershell.org/articles/2013-05-06-event-2-is-final/</link><guid>https://powershell.org/articles/2013-05-06-event-2-is-final/</guid><pubDate>Tue, 07 May 2013 00:23:43 +0000</pubDate><description>&lt;p&gt;Event 2 has closed for submissions and will open for voting later this evening. Good luck! And voters: remember that quality comments will vastly increase your chances of winning a prize!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Event 2 has closed for submissions and will open for voting later this evening. Good luck! And voters: remember that quality comments will vastly increase your chances of winning a prize!</p>
]]></content:encoded></item><item><title>A Helpful Message about HelpMessage</title><link>https://powershell.org/articles/2013-05-06-a-helpful-message-about-helpmessage/</link><guid>https://powershell.org/articles/2013-05-06-a-helpful-message-about-helpmessage/</guid><pubDate>Mon, 06 May 2013 23:39:21 +0000</pubDate><description>&lt;p&gt;The Scripting Games 2013 winners have not yet been announced, but for the 3rd year running, I&amp;rsquo;m in the lead for the &amp;ldquo;Learned Most from the Scripting Games&amp;rdquo; award. I&amp;rsquo;m making space for the prize on my bookshelf. Seriously, I play with PowerShell all the time and read lots of blogs, but nothing compares to looking at dozens of scripts and commands and seeing how people do things in the real world.&lt;br&gt;
One of the practices I&amp;rsquo;ve noticed is use of the &lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/system.management.automation.parameterattribute.helpmessage(v=vs.85).aspx"&gt;HelpMessage parameter attribute&lt;/a&gt; to document a parameter. It&amp;rsquo;s a real thing, but I didn&amp;rsquo;t know that anyone used it any more.&lt;br&gt;
Here&amp;rsquo;s my help message about HelpMessage:&lt;br&gt;
&lt;strong&gt;Don&amp;rsquo;t use it!&lt;/strong&gt; Users can&amp;rsquo;t see it. It does no harm, but it has no value. Danger lurks in writing a HelpMessage instead of writing help that users can see. Write help that Get-Help gets, that is, XML help or comment-based help.&lt;br&gt;
Here&amp;rsquo;s what I&amp;rsquo;m talking about. This code is valid. The language permits it. But it&amp;rsquo;s not useful. And I saw it in several of the advanced solutions.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>The Scripting Games 2013 winners have not yet been announced, but for the 3rd year running, I&rsquo;m in the lead for the &ldquo;Learned Most from the Scripting Games&rdquo; award. I&rsquo;m making space for the prize on my bookshelf. Seriously, I play with PowerShell all the time and read lots of blogs, but nothing compares to looking at dozens of scripts and commands and seeing how people do things in the real world.<br>
One of the practices I&rsquo;ve noticed is use of the<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/system.management.automation.parameterattribute.helpmessage(v=vs.85).aspx">HelpMessage parameter attribute</a> to document a parameter. It&rsquo;s a real thing, but I didn&rsquo;t know that anyone used it any more.<br>
Here&rsquo;s my help message about HelpMessage:<br><strong>Don&rsquo;t use it!</strong> Users can&rsquo;t see it. It does no harm, but it has no value. Danger lurks in writing a HelpMessage instead of writing help that users can see. Write help that Get-Help gets, that is, XML help or comment-based help.<br>
Here&rsquo;s what I&rsquo;m talking about. This code is valid. The language permits it. But it&rsquo;s not useful. And I saw it in several of the advanced solutions.</p><p><code>function Get-PowerShellLog { [CmdletBinding()] Param ( [Parameter(Mandatory=$true, HelpMessage="Your message goes here")] $InstanceID ) Get-Eventlog -LogName "Windows PowerShell" -InstanceId $InstanceID }</code>But Get-Help doesn&rsquo;t get the HelpMessage string.<br>
There are two ways for the user to see this help message. Here&rsquo;s one way. These commands get the value of the HelpMessage property of the parameter. I don&rsquo;t think people run commands like these very often, but I don&rsquo;t get out much.</p><p><code>#Windows PowerShell 3.0 C:\&gt; ((Get-Command Get-PowerShellLog).ParameterSets.Parameters | Where-Object Name -eq InstanceId).HelpMessage Your message goes here #Windows PowerShell 2.0 C:\&gt; ((Get-Command Get-PowerShellLog).ParameterSets | Foreach {$_.Parameters} | Where-Object {$_.Name -eq InstanceId).HelpMessage Your message goes here</code>Here&rsquo;s the other way. It works only on mandatory (required) parameters. When you omit a mandatory parameter, you get a message like this one:</p><p><code>PS C:\&gt; Get-PowerShellLog cmdlet Get-PowerShellLog at command pipeline position 1 Supply values for the following parameters: (Type !? for Help.) InstanceID:</code>And then you type &ldquo;!?&rdquo; to get the HelpMessage value.</p><p><code>InstanceID: !? Your message goes here</code>You&rsquo;ve never done that? Me neither!<br>
To get a sense of how often HelpMessage is used, I played Nate Silver with Kim&rsquo;s famous test server. My dear friend, Kim Ditto, is famous for many things &ndash; she&rsquo;s a fabulous person and a renowned Microsoft Certified Trainer &ndash; but, in addition, she set up and maintains a test server on which she&rsquo;s installed almost all of the Windows PowerShell modules from Microsoft. I could not live without Kim&rsquo;s test server.<br>
Here are the results. Out of 2468 commands with 8471 parameters, 8 have the HelpMessage attribute and none are mandatory, so the HelpMessage is<em>NEVER DISPLAYED</em> unless you go hunting for it.</p><p>`# How many commands?
PS C:&gt; Invoke-Command -Session $s {(Get-Command).Count}
2468</p><h1 id="how-many-parameters" class="ps-heading">How many parameters?<a class="ps-heading-anchor" href="#how-many-parameters" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>PS C:&gt; $a = Invoke-Command -Session $s `
{(Get-Command).ParameterSets.Parameters.Count}
8471</p><h1 id="how-many-parameters-have-helpmessage" class="ps-heading">How many parameters have HelpMessage?<a class="ps-heading-anchor" href="#how-many-parameters-have-helpmessage" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>PS C:&gt; Invoke-Command -Session $s `
{((Get-Command).ParameterSets.Parameters | where HelpMessage).Count}
8</p><h1 id="how-many-of-the-parameters-with-helpmessage-are-mandatory" class="ps-heading">How many of the parameters with HelpMessage are mandatory?<a class="ps-heading-anchor" href="#how-many-of-the-parameters-with-helpmessage-are-mandatory" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>PS C:&gt; Invoke-Command -Session $s<code>{((Get-Command).ParameterSets.Parameters | where HelpMessage -and isMandatory).Count} 0</code>If you want to be helpful, the correct way to provide help for a parameter in a script or function is this:</p><p><code>&lt;# .PARAMETER InstanceId Specifies the instance IDs of events in the event log. Get-PowerShellLog gets only logs with the specified ID. #&gt;</code>Or, this:</p><p>`[Parameter(Mandatory=$true, HelpMessage=&ldquo;Your message goes here&rdquo;)]</p><h1 id="specifies-the-instance-ids-of-events-in-the" class="ps-heading">Specifies the instance IDs of events in the<a class="ps-heading-anchor" href="#specifies-the-instance-ids-of-events-in-the" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><h1 id="event-log-get-powershelllog-gets-only-logs" class="ps-heading">event log. Get-PowerShellLog gets only logs<a class="ps-heading-anchor" href="#event-log-get-powershelllog-gets-only-logs" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><h1 id="with-the-specified-id" class="ps-heading">with the specified ID.<a class="ps-heading-anchor" href="#with-the-specified-id" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>$InstanceID
`Hope that&rsquo;s helpful.</p>
]]></content:encoded></item><item><title>Placing Comment-Based Help</title><link>https://powershell.org/articles/2013-05-03-placing-comment-based-help/</link><guid>https://powershell.org/articles/2013-05-03-placing-comment-based-help/</guid><pubDate>Fri, 03 May 2013 19:03:39 +0000</pubDate><description>&lt;p&gt;What an amazing event. I&amp;rsquo;m now reading through each of the Advanced entries in a vain attempt to whittle the entries down to a short list. It&amp;rsquo;s an incredibly difficult task, which is testament to your skill and diligence. We are so lucky to have so many competent scripters in the community.&lt;br&gt;
As I read through the comments on each script, I&amp;rsquo;ve noticed several that say:&lt;br&gt;
&amp;ldquo;Help should be nested under the function to work properly.&amp;rdquo;&lt;br&gt;
Au contraire! This is not true and I want to make sure that people who see this comment are not misled. The Windows PowerShell team designed comment-based help to be really flexible.&lt;br&gt;
As I explained in &lt;a href="http://go.microsoft.com/fwlink/?LinkID=144309"&gt;about_Comment_Based_Help&lt;/a&gt;, you can put comment-based help for a function in one of three positions:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>What an amazing event. I&rsquo;m now reading through each of the Advanced entries in a vain attempt to whittle the entries down to a short list. It&rsquo;s an incredibly difficult task, which is testament to your skill and diligence. We are so lucky to have so many competent scripters in the community.<br>
As I read through the comments on each script, I&rsquo;ve noticed several that say:<br>
&ldquo;Help should be nested under the function to work properly.&rdquo;<br>
Au contraire! This is not true and I want to make sure that people who see this comment are not misled. The Windows PowerShell team designed comment-based help to be really flexible.<br>
As I explained in<a href="http://go.microsoft.com/fwlink/?LinkID=144309">about_Comment_Based_Help</a>, you can put comment-based help for a function in one of three positions:</p><ul><li>At the beginning of the function body</li><li>At the end of the function body</li><li>On the line before the Function keyword</li></ul><p>So, all of these work.</p><p><code>function Move-OldFiles { &lt;# .Synopsis Moves old log files to an archive directory. #&gt; Param ( [parameter(Mandatory=$true)] [String] $InputDirectory ) }</code>function Move-OldFiles
{
Param
(
[parameter(Mandatory=$true)]
[String]
$InputDirectory
)
#Script logic goes here
&lt;#
.Synopsis
Moves old log files to an archive directory.
#&gt;
}<code>&lt;# .Synopsis Moves old log files to an archive directory. #&gt; function Move-OldFiles { Param ( [parameter(Mandatory=$true)] [String] $InputDirectory ) #Script logic goes here }</code>If you place the comment-based help on the line before the Function keyword, make sure that there is, at most, one blank line between the end of the comment-based help and the line with the function keyword. To avoid this problem, I always make sure that there are no blank lines between the end of the comment-based help and the Function keyword.<br>
When reading the comments about your solutions, please remember that we are all volunteers. Everyone who takes the time to comment on your solution is trying to help, and should be appreciated, but not every comment is correct. Trust, but verify!</p>
]]></content:encoded></item><item><title>Scripting Games: What Should We Do With Comments?</title><link>https://powershell.org/articles/2013-05-03-scripting-games-what-should-we-do-with-comments/</link><guid>https://powershell.org/articles/2013-05-03-scripting-games-what-should-we-do-with-comments/</guid><pubDate>Fri, 03 May 2013 19:02:08 +0000</pubDate><description>&lt;p&gt;Right now, I&amp;rsquo;ve got the Scripting Games Web site built to only make comments visible to a entry&amp;rsquo;s author. Some of the comments have been a little snarky, and I don&amp;rsquo;t want to create an online argument forum.&lt;br&gt;
I&amp;rsquo;m curious what folks think we should do as a next step.&lt;br&gt;
I could, for example, make comments visible to everyone once voting has ended for an event (I don&amp;rsquo;t want to make comments visible while we&amp;rsquo;re still accepting comments, because it&amp;rsquo;ll run a big risk of creating a discussion, which isn&amp;rsquo;t the intent).&lt;br&gt;
We do have a plan to dump all the entries into static files for long-term reference; I could insert entries&amp;rsquo; comments at the end of each entry, in a PowerShell comment block.&lt;br&gt;
Or, we could just leave comments visible to the entry&amp;rsquo;s author. That provides a learning experience for the author, although not for the public, and only until we purge the database for the next event.&lt;br&gt;
Thoughts?&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Right now, I&rsquo;ve got the Scripting Games Web site built to only make comments visible to a entry&rsquo;s author. Some of the comments have been a little snarky, and I don&rsquo;t want to create an online argument forum.<br>
I&rsquo;m curious what folks think we should do as a next step.<br>
I could, for example, make comments visible to everyone once voting has ended for an event (I don&rsquo;t want to make comments visible while we&rsquo;re still accepting comments, because it&rsquo;ll run a big risk of creating a discussion, which isn&rsquo;t the intent).<br>
We do have a plan to dump all the entries into static files for long-term reference; I could insert entries&rsquo; comments at the end of each entry, in a PowerShell comment block.<br>
Or, we could just leave comments visible to the entry&rsquo;s author. That provides a learning experience for the author, although not for the public, and only until we purge the database for the next event.<br>
Thoughts?</p>
]]></content:encoded></item><item><title>Beginner Event Tips</title><link>https://powershell.org/articles/2013-05-03-beginner-event-tips/</link><guid>https://powershell.org/articles/2013-05-03-beginner-event-tips/</guid><pubDate>Fri, 03 May 2013 15:57:10 +0000</pubDate><description>&lt;p&gt;Folks, as we dive into Event 2, I want to offer some advice based on the &lt;em&gt;comments&lt;/em&gt; I saw for Event 1.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Don&amp;rsquo;t overthink the Beginner event. We&amp;rsquo;re not looking for a script or function - a one-liner, if possible. Don&amp;rsquo;t overdeliver.&lt;/li&gt;
&lt;li&gt;Avoid aliases and positional parameters - this is a practice outlined in the Competitor Guide.&lt;/li&gt;
&lt;li&gt;TEST YOUR CODE. You can&amp;rsquo;t modify it. Also, judges can&amp;rsquo;t see any comment you might leave when &amp;ldquo;voting&amp;rdquo; on your own entry, so you can&amp;rsquo;t use comments to mitigate an error. TEST. Submitting an entry is like pushing a script into production.&lt;/li&gt;
&lt;li&gt;If there&amp;rsquo;s a straightforward, native way to do something - do it. People seemed to down-vote a lot of entries in Event 1 for using Robocopy. Not that it&amp;rsquo;s wrong&amp;hellip; but the general community opinion seems to be, &amp;ldquo;use native commands when they exist and can solve the problem.&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Remember, these aren&amp;rsquo;t my guidelines - this is what I&amp;rsquo;m seeing in the comments that I&amp;rsquo;m reviewing, and wanted to pass them along as a sense of what the community seems to favor and disfavor.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Folks, as we dive into Event 2, I want to offer some advice based on the<em>comments</em> I saw for Event 1.</p><ul><li>Don&rsquo;t overthink the Beginner event. We&rsquo;re not looking for a script or function - a one-liner, if possible. Don&rsquo;t overdeliver.</li><li>Avoid aliases and positional parameters - this is a practice outlined in the Competitor Guide.</li><li>TEST YOUR CODE. You can&rsquo;t modify it. Also, judges can&rsquo;t see any comment you might leave when &ldquo;voting&rdquo; on your own entry, so you can&rsquo;t use comments to mitigate an error. TEST. Submitting an entry is like pushing a script into production.</li><li>If there&rsquo;s a straightforward, native way to do something - do it. People seemed to down-vote a lot of entries in Event 1 for using Robocopy. Not that it&rsquo;s wrong&hellip; but the general community opinion seems to be, &ldquo;use native commands when they exist and can solve the problem.&rdquo;</li></ul><p>Remember, these aren&rsquo;t my guidelines - this is what I&rsquo;m seeing in the comments that I&rsquo;m reviewing, and wanted to pass them along as a sense of what the community seems to favor and disfavor.</p>
]]></content:encoded></item><item><title>OK i'm impressed: Scripting Games Week 1</title><link>https://powershell.org/articles/2013-05-03-ok-im-impressed-scripting-games-week-1/</link><guid>https://powershell.org/articles/2013-05-03-ok-im-impressed-scripting-games-week-1/</guid><pubDate>Fri, 03 May 2013 14:44:21 +0000</pubDate><description>&lt;p&gt;Well guys, and gals another year has passed, and the annual scripting games are upon us again.  After a week of reviewing submissions for their technique and style I must say that I am truly impressed!  As a community the average ability seems to be growing by leaps and bounds.  That&amp;quot;™s not to say we&amp;quot;™re all Samurai just yet, but we&amp;quot;™re getting there!&lt;br&gt;
Before I go off and nit-pick I want to congratulate you all on a small mountain of really well written scripts.  Some of the things that the community was preaching 5 years ago are now just standard.  Stuff like comment your code, format for readability, and Parameters.  At this point I&amp;quot;™m convinced those who still aren&amp;rsquo;t conforming are simply non-conformist and well that&amp;quot;™s a lost cause.  For the rest of us great work and keep it up!&lt;br&gt;
**Where is the Help!&lt;br&gt;
**
What I 
didn&amp;rsquo;t
 see enough of in the advanced category is help.  Honestly if you&amp;quot;™re going to write a 200 line script fill out the help!  It&amp;quot;™s not that hard and it is THE difference between a good script and a great solution! It&amp;quot;™s also one of the fundamental differences between hacking and tool building, both are focused around automating a given problem set.  The hacker just gets it to work, the tool builder makes it usable by the masses.  If you haven&amp;quot;™t figured it out yet the real money is in tool building, I&amp;quot;™m just sayin!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Well guys, and gals another year has passed, and the annual scripting games are upon us again.  After a week of reviewing submissions for their technique and style I must say that I am truly impressed!  As a community the average ability seems to be growing by leaps and bounds.  That"™s not to say we"™re all Samurai just yet, but we"™re getting there!<br>
Before I go off and nit-pick I want to congratulate you all on a small mountain of really well written scripts.  Some of the things that the community was preaching 5 years ago are now just standard.  Stuff like comment your code, format for readability, and Parameters.  At this point I"™m convinced those who still aren&rsquo;t conforming are simply non-conformist and well that"™s a lost cause.  For the rest of us great work and keep it up!<br>
**Where is the Help!<br>
**
What I 
didn&rsquo;t
 see enough of in the advanced category is help.  Honestly if you"™re going to write a 200 line script fill out the help!  It"™s not that hard and it is THE difference between a good script and a great solution! It"™s also one of the fundamental differences between hacking and tool building, both are focused around automating a given problem set.  The hacker just gets it to work, the tool builder makes it usable by the masses.  If you haven"™t figured it out yet the real money is in tool building, I"™m just sayin!</p><p>**Trust but Validate.<br>
**
I was pleasantly surprised by the amount of error handling in this first round of submissions, however I was disappointed by the lack of parameter validation.  When done correctly parameter validation can remove most of the potential errors a script can run into, and the best part is you find out that it"™s not going to work before the script does anything!  For example in this week"™s scenario every single script was asked to supply a source and destination path.  The following would have removed all but an access denied error.</p><p><code>Param ( [Parameter(Mandatory=$true, ValuefrompipelineByPropertyName=$true)] [ValidateScript({Test-Path $_ -PathType Container})] [Alias("FullName")] [string]$Source , [Parameter(Mandatory=$true, ValuefrompipelineByPropertyName=$true)] [ValidateScript({Test-Path $_ -PathType Container})] [Alias("FullName")] [string]$Destination )</code>This is the equivalent of filter to the left, and 
I&rsquo;ve
 talked to endless developers who are a little jealous of our ability to use an arbitrary scriptblock for parameter validation. For more static values the ValidateSet attribute will perform the same function, but with the added benefit of Intelli-sense and tab completion.* Guys use this* I"™m telling you it"™s one of the most powerful features in PowerShell and I just don"™t see it use often enough, but then again<a href="http://blogs.technet.com/b/heyscriptingguy/archive/2011/05/15/simplify-your-powershell-script-with-parameter-validation.aspx"> I"™ve been tilting at this windmill for years now.</a></p><p>**Parameter names<br>
**
This one is a little more nitpicky than the average, but honestly there simply isn"™t an excuse for a script with three parameters to all start with the same letter.  Meaning the following is just disrespectful to yourself and your users.</p><p><code>Param( [String]$ArchiveSource, [String]$ArchiveDestination, [String]$ArchiveAge )</code>I mean that"™s a no-brainer right?  I don"™t assume malice here just a lack of focus.  Anyone who stops and thinks about it immediately sees the problem, and solution. So I guess what I"™m asking is that we collectively take a second to think about usability.  For those of you that haven"™t had your coffee yet. The solution is that since three parameters all contain Archive we need to move that bit from the beginning of each parameter name.   In this case since there is no real need to differentiate I would suggest removing it all together.</p><p><code>Param( [String]$Source, [String]$Destination, [String]$Age )</code>Here we"™re focusing on what"™s really important which makes the parameters easier to comprehend, but also lets us get to TAB faster which is a huge part of usability!<br>
**Bring it in<br>
**
In summary all in all I would say we had a fantastic showing for our industry this initial week.  I really like the new site and voting has been very productive which is nice.  As we head into week two I look forward to what"™s to come as we collectively build upon what we"™ve learned this week.</p><p>~Glenn</p>
]]></content:encoded></item><item><title>Scripting Games 2013: Event 1 "˜Favorite' and "˜Not So Favorite' Submissions</title><link>https://powershell.org/articles/2013-05-02-scripting-games-2013-event-1-favorite-and-not-so-favorite-submissions/</link><guid>https://powershell.org/articles/2013-05-02-scripting-games-2013-event-1-favorite-and-not-so-favorite-submissions/</guid><pubDate>Fri, 03 May 2013 03:07:27 +0000</pubDate><description>&lt;p&gt;As a follow-up to my &lt;a href="http://learn-powershell.net/2013/05/01/scripting-games-2013-thoughts-after-event-1/"&gt;previous blog&lt;/a&gt; post, I plan to pick out a submission or two or three which stood out as my personal favorite and least favorite and tell you why I think this by pointing pieces of code that was either put together nicely or could have been improved in one way or another. Depending on my time, I will do at least 1 Advanced and 1 Beginner submission for both &amp;ldquo;˜Favorite&amp;rdquo;™ and &amp;ldquo;˜Not so Favorite. I&amp;rsquo;ll start out by listing the code and then discussing it bullet point style to highlight my thoughts. So with that, lets begin this journey through the Event 1 submissions by &lt;a href="http://learn-powershell.net/2013/05/02/scripting-games-2013-event-1-favorite-and-not-so-favorite-submissions/"&gt;following this link to my blog!&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>As a follow-up to my<a href="http://learn-powershell.net/2013/05/01/scripting-games-2013-thoughts-after-event-1/">previous blog</a> post, I plan to pick out a submission or two or three which stood out as my personal favorite and least favorite and tell you why I think this by pointing pieces of code that was either put together nicely or could have been improved in one way or another. Depending on my time, I will do at least 1 Advanced and 1 Beginner submission for both &ldquo;˜Favorite&rdquo;™ and &ldquo;˜Not so Favorite. I&rsquo;ll start out by listing the code and then discussing it bullet point style to highlight my thoughts. So with that, lets begin this journey through the Event 1 submissions by<a href="http://learn-powershell.net/2013/05/02/scripting-games-2013-event-1-favorite-and-not-so-favorite-submissions/">following this link to my blog!</a></p>
]]></content:encoded></item><item><title>Event #1: Moving Old Files</title><link>https://powershell.org/articles/2013-05-02-event-1-moving-old-files/</link><guid>https://powershell.org/articles/2013-05-02-event-1-moving-old-files/</guid><pubDate>Thu, 02 May 2013 21:31:40 +0000</pubDate><description>&lt;p&gt;As a celebrity judge, I&amp;rsquo;m not required to blog &amp;ldquo;“ I&amp;rsquo;m just here for my good looks :&amp;gt; &amp;ndash; but I&amp;rsquo;m having a great time reading the blogs posted by the Expert Judges about the &lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/04/25/2013-scripting-games-beginner-event-1.aspx"&gt;Event #1&lt;/a&gt; candidate solutions.  Much of the judging is subjective, but I&amp;rsquo;ll add the criteria that I use to distinguish a working solution from a great solution.&lt;br&gt;
Before I do, though, I want to congratulate everyone who submitted an entry. Most of the entries work and you probably learned just from playing with the challenge. Keep it up and come back year after year.&lt;br&gt;
One hint to everyone: &lt;strong&gt;TEST!&lt;/strong&gt; Most of the entries work, but many fail if the directory for the application (e.g. App1 in \NASServer\Archives\App1) does not already exist. And, a few fail with regular expression errors on the Replace operator (more in the blog). There are lots of great test strategies, but you can just run your code on file in your own directories or step through the code in the Windows PowerShell ISE debugger.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>As a celebrity judge, I&rsquo;m not required to blog &ldquo;“ I&rsquo;m just here for my good looks :&gt; &ndash; but I&rsquo;m having a great time reading the blogs posted by the Expert Judges about the<a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/04/25/2013-scripting-games-beginner-event-1.aspx">Event #1</a> candidate solutions.  Much of the judging is subjective, but I&rsquo;ll add the criteria that I use to distinguish a working solution from a great solution.<br>
Before I do, though, I want to congratulate everyone who submitted an entry. Most of the entries work and you probably learned just from playing with the challenge. Keep it up and come back year after year.<br>
One hint to everyone:<strong>TEST!</strong> Most of the entries work, but many fail if the directory for the application (e.g. App1 in \NASServer\Archives\App1) does not already exist. And, a few fail with regular expression errors on the Replace operator (more in the blog). There are lots of great test strategies, but you can just run your code on file in your own directories or step through the code in the Windows PowerShell ISE debugger.</p><h2 id="get-help-an-archival-atrocity" class="ps-heading">Get-Help: An Archival Atrocity<a class="ps-heading-anchor" href="#get-help-an-archival-atrocity" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Let&rsquo;s start with a quick review of the event challenge. You can read the beginner challenge<a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/04/25/2013-scripting-games-beginner-event-1.aspx">here</a>.<br>
Basically, the task is to move log files older than 90 days old from their current locations in application-specific subdirectories of C:\Application\Log  (such as C:\Application\Log\.log) to an archive share, \NASServer\Archives.<br>
The files have GUID filenames (read: you can&rsquo;t predict them). You need to maintain the subdirectory structure, so if a log file starts in the App582 subdirectory of C:\Application\Log, after the move, it should be in the App852 subdirectory of NASServer\Archives.<br>
The final instruction/hint is that the applications generate the files and never touch them again. I&rsquo;m not an expert, but I interpreted this to mean that the CreationTime property and the LastWriteTime property of these log files will be the same and you can use either in your solution. (Is that right?)<br>
The advanced challenge involves the same task, but generalized into a reusable tool, so you want to create a script with parameters for the log path and archive paths. This is one of those advanced challenges that many beginners should be able to do. For giggles, try it on your beginner solution.<br>
To recap, here are the elements of this challenge and solutions, all of which I think are acceptable in a beginner challenge.</p><ul><li>Find the log files</li><li>Get only the ones that are at least 90 days old (CreationTime or LastWriteTime)</li><li>Move them to the same subdirectory in the archive directory</li></ul><p>Finding the log files is pretty easy:</p><p><code>Get-ChildItem C:\Application\Log\*.log "“Recurse Get-ChildItem C:\Application\Log -Include *.log "“Recurse Get-ChildItem C:\Application\Log -Filter *.log "“Recurse Get-ChildItem C:\Application\Log\ *\*.log</code>Calculating 90 days is only a bit harder:</p><p><code>(Get-Date).AddDays(-90) #Yes, a negative number! (Get-Date).Subtract(New-TimeSpan -Days 90) ((Get-Date) - $file.LastWriteTime).Days -gt 90</code>Because the only really tricky part in this challenge is moving the file and maintaining the directory structure, I&rsquo;m concentrating on that part.</p><ul><li>First,  you need to get the current subdirectory and make sure the file goes in that same subdirectory in the new location.</li><li>Second, if you try to copy or move an item to a directory that doesn&rsquo;t exist, the command fails &ldquo;“ and the Force parameter will not build the path for you.</li></ul><h2 id="get-myvote" class="ps-heading">Get-MyVote<a class="ps-heading-anchor" href="#get-myvote" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Here are the elements that I look for in a solution.</p><ul><li><strong>Preserve the path</strong>:  I look for solutions that preserve or build the new path correctly. This is required by the challenge, but it&rsquo;s also a place for some creativity.</li><li><strong>Test-Path/New-Item</strong>: I look for solutions that test to see if the path exists in the new location (Test-Path) and creates the directories in the path if they don&rsquo;t already exist, typically by using Mkdir (md) or New-Item &ldquo;“Type Directory.</li><li><strong>New-Item | Out-Null</strong>:  When you create a new path, New-Item and Mkdir return a directory object. This can be confusing to users who run your script, so I give extra points for suppressing the output. I typically do this by piping the output to Out-Null. Here&rsquo;s a possible solution, but I&rsquo;m open to creative variation.</li></ul><p><code>New-Item -Type Directory -Path C:\Application\Log\$p | Out-Null</code>*<strong>Help</strong> (of course). More below</p><ul><li><strong>Test.</strong> Don&rsquo;t share a solution that you haven&rsquo;t tested. There are many ways to test, but running the solution on datasets with different elements is a great way. I always run my code in the Windows PowerShell ISE debugger before using it or sharing it. ****</li></ul><h2 id="get-help" class="ps-heading">Get-Help<a class="ps-heading-anchor" href="#get-help" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>All shared functions and scripts should have help. Help helps the end user and makes the script maintainable. Unless you plan a use a command once and toss it, you need help.<br>
Comment-based help for a simple script like this is easy to write:<br>
&lt;#</p><p><code>.SYNOPSIS Move-Oldfiles.ps1 By juneb 4/25/2013 .DESCRIPTION Moves files that are at least 90 days old from a subdirectory of C:\Application\Log to the same subdirectory in NASServer\Archives. .EXAMPLE Move-OldFiles.ps1</code>#&gt;<br>
Additional comments are great, especially if you&rsquo;re doing something clever. For example, if you use the $Path.Directory.Name to get the path (thanks to<a href="http://becomelotr.wordpress.com/2013/04/30/event-1-my-way/">Bartek Bielawski</a> for this hint), a comment that it gets only the immediate parent directory would be very helpful to someone reading the script.<br>
I actually deduct points for &ldquo;help&rdquo; that Get-Help can&rsquo;t get, such as this sort of stuff:</p><p>`# This script moves files that are older than 90 days</p><h1 id="old-from-a-subdirectory-of-capplicationlog-to-the" class="ps-heading">old from a subdirectory of C:\Application\Log to the<a class="ps-heading-anchor" href="#old-from-a-subdirectory-of-capplicationlog-to-the" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><h1 id="same-subdirectory-in-nasserverarchives-i-wrote-it" class="ps-heading">same subdirectory in NASServer\Archives. I wrote it<a class="ps-heading-anchor" href="#same-subdirectory-in-nasserverarchives-i-wrote-it" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><h1 id="for-scripting-games-2013-event-1" class="ps-heading">for Scripting Games 2013, Event 1<a class="ps-heading-anchor" href="#for-scripting-games-2013-event-1" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>`It&rsquo;s so easy to do it right that doing it wrong is pretty silly.</p><h2 id="efficiency-calculating-90-days" class="ps-heading">Efficiency: Calculating 90 Days<a class="ps-heading-anchor" href="#efficiency-calculating-90-days" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>I&rsquo;ve seen a lot of this approach in solutions, usually in one-liners.</p><p><code>Get-ChildItem C:\Application\Log\*\*.log | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-90)} | Move-Item -Destination ...</code>This approach recalculates the archive date FOR EVERY FILE. That would make sense only if the script took more than a day to run. Computers are pretty fast these days, but there&rsquo;s no reason to be purposefully inefficient. It&rsquo;s much better to calculate the archive date once, save it, and reuse it.</p><p><code>$ArchiveDate = (Get-Date).AddDays(-90) Get-ChildItem C:\Application\Log\*\*.log | Where-Object {$_.LastWriteTime -lt $ArchiveDate} | Move-Item -Destination ...</code>## Get-ChildItem: -File, -Directory -Hidden -ReadOnly, -Attributes</p><p>The FileSystem provider in Windows PowerShell 3.0 adds awesome new parameters to the Get-ChildItem cmdlet. For help, Get-Help<a href="http://technet.microsoft.com/en-us/library/hh847897.aspx">Get-ChildItem for FileSystem</a>. I give extra points to people who use them correctly and deduct points for the more old-fashioned PSISContainer.<br>
The following code works:</p><p><code>Get-ChildItem C:\Application\Log -Recurse | Where-Object {$_.PSIsContainer}</code>But the preferred version uses the new features and it is really much easier to interpret:</p><p><code>Get-ChildItem C:\Application\Log -Directory -Recurse</code>On the same note, I noticed the following:</p><p><code>Get-ChildItem -Attributes D ...</code>Like a lot of solutions, this works &ndash; it gets only directories in the path &ndash; but it&rsquo;s more confusing than the simpler equivalent:</p><p><code>Get-ChildItem -Directory</code>The Attributes parameter is designed for attribute combinations and for attributes that cannot be expressed with the simpler parameters, like this expression, which gets files that are compressed and not hidden.</p><p><code>Get-ChildItem -File -Attributes Compressed+!Hidden</code>## Regular Expressions in Replace Statements</p><p>One of the tricky parts of this challenge was preserving the original path in the new archive directory. There were many clever ways to do this. But several (presumably untested) solutions will fail with a regular expression error.<br>
For example:</p><p><code>foreach ($file in $files) { $newName = $file.fullname -replace 'C:\Application\Log','\\NASServer\Archives' move-item -Destination $newName }</code>Generates this error:</p><p>`Regular expression pattern is not valid: C:\Application\Log.
At C:\ps-test\ScriptingGames2013\Move-TestEsc.ps1:5 char:5
+     $newName = $file.fullname -replace &lsquo;C:\Application\Log&rsquo;,&rsquo;\NASServer\Archive &hellip;
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</p><ul><li>CategoryInfo          : InvalidOperation: (C:\Application\Log:String) [], RuntimeException</li><li>FullyQualifiedErrorId : InvalidRegularExpression
`The problem here is that you didn&rsquo;t intend to supply a regular expression as input, but the Replace operator interprets the text that it is replacing (the first operand) as a regular expression. In this case, it interprets the backslashes as escape characters.  To resolve the error, escape the backslashes by doubling them, that is, preceding each backslash with another backslash.<br>
For example:</li></ul><p><code>-replace 'C:\\Application\\Log' ...</code>Here is the corrected code:</p><p><code>foreach ($file in $files) { $newName = $file.fullname -replace 'C:\\Application\\Log','\\NASServer\Archives' move-item -Destination $newName }</code>You don&rsquo;t need to escape the backslash in the replacement text (second operand), because the Replace operator doesn&rsquo;t interpret that text as a regular expression. It just pastes it.<br>
NOTE: The<a href="http://msdn.microsoft.com/en-us/library/fk49wtc1.aspx">Replace method of strings</a> does not use regular expressions, so you don&rsquo;t need to worry about those backslashes.</p><p><code>$newName = ($file.fullname).Replace('C:\ps-test','\\NASServer\Archives')</code>## Simplify Booleans</p><p>Here&rsquo;s a very frequent pattern:</p><p><code>if ($a -eq $true) {} elseif ($a -eq $false) {}</code>But notice that:</p><p><code>$a -eq $true</code>Is equivalent to:</p><p><code>$a</code>Similarly:</p><p><code>$a -eq $false</code>Is equivalent to:</p><p><code>!$a</code>And, if $a is not true, the only alternative, is that it&rsquo;s false. So you can simplify that original code to:</p><p><code>if ($a) {} else {}</code>So, when you see yourself typing:</p><p><code>Where {$_.PSIsContainer -eq $true}</code>You can react immediately and change it to:</p><p><code>Where {$_.PSIsContainer }</code>Or change:</p><p><code>$_.PsISContainer -ne $True</code>To:</p><p><code>!$_.PsISContainer</code>A side note: In some languages, $a is true if it contains a true statement or any numeric value other than zero. In Windows PowerShell $a is true if it contains a true statement or a value of 1; otherwise, it is false.</p><h2 id="enumerating-the-paths" class="ps-heading">Enumerating the paths<a class="ps-heading-anchor" href="#enumerating-the-paths" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Many of the solutions included enumerated paths, like this:</p><p><code>Get-Childitem -Path "C:\Application\Log\App1",</code>
&ldquo;C:\Application\Log\OtherApp&rdquo;,<code>"C:\Application\Log\OtherApp" -Recurse ...</code>I feel badly, but I think these folks misinterpreted examples to be absolute paths. It&rsquo;s really important for us to write the challenges clearly and unambiguously, especially because we have a truly international audience, but participants need to read carefully, too.</p><h2 id="dont-use-aliases" class="ps-heading">Don&rsquo;t use aliases<a class="ps-heading-anchor" href="#dont-use-aliases" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Aliases are terrific for interactive commands and commands that you don&rsquo;t share with others. But for anything else, including the Scritping Games, avoid them. Can you imagine a beginner trying to intepret a solution in which &ldquo;?&rdquo; is used instead of Where-Object? How would the person search for that &ldquo;?"?  Because understanding is the goal, I have no trouble with eliminating the &ldquo;Object&rdquo; in Where-Object, Sort-Object, Select-Object, but it&rsquo;s better to leave it in.<br>
In general, you should also include the names of positional parameters, although I don&rsquo;t mind omitting the most frequently used ones. Other people might be pickier, but I don&rsquo;t use &ldquo;Where-Object -Property&rdquo; or &ldquo;Get-ChildItem -Path&rdquo; in my own code and I don&rsquo;t require it from others.</p><h2 id="one-liners" class="ps-heading">One-Liners<a class="ps-heading-anchor" href="#one-liners" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>A final note: one-liners are very useful, but I don&rsquo;t count lines of code or characters in a command when evaluating solutions. Solutions that use fancy regular expression statements are impressive but they can be difficult to interpret and maintain. If you can get your code onto one line, that&rsquo;s terrific, but it&rsquo;s not necessary and I don&rsquo;t give it any extra points.<br>
Now, we can get ready for Event #2. Good luck, everyone!</p>
]]></content:encoded></item><item><title>Judge Notes for Event 1</title><link>https://powershell.org/articles/2013-05-02-judge-notes-for-event-1/</link><guid>https://powershell.org/articles/2013-05-02-judge-notes-for-event-1/</guid><pubDate>Thu, 02 May 2013 17:24:49 +0000</pubDate><description>&lt;p&gt; A lot of you have been working too hard at solving the problem (both beginner and advanced). Some of this is clearly related to trying to offer a very complete solution but some look like attempts to write extra clever or elegant code. In the &amp;ldquo;real world&amp;rdquo;, there&amp;quot;™s probably not enough time or interest in putting lots of effort into these extras. The minimum it takes to achieve the goal is most often good enough. Here are a couple of examples to illustrate this (with the intent of providing a learning opportunity).&lt;br&gt;
Working with the destination folder address.&lt;br&gt;
A common error here was missing the subdirectory. Most folks got this correct by using some version of &lt;em&gt;$&lt;/em&gt;.FullName.Replace(&amp;quot;˜C:\Application\Log&amp;quot;™,&amp;quot;™\NASServer\Archives&amp;quot;™)_ or &lt;em&gt;Join-Path &amp;ldquo;˜\NASServer\Archives&amp;rdquo;™ $&lt;/em&gt;.Directory.Name_, but there were a number who just used the root destination folder name without looking for the subfolder. And some others had solutions that (although I thought were innovative), took too much effort. Among them are:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p> A lot of you have been working too hard at solving the problem (both beginner and advanced). Some of this is clearly related to trying to offer a very complete solution but some look like attempts to write extra clever or elegant code. In the &ldquo;real world&rdquo;, there"™s probably not enough time or interest in putting lots of effort into these extras. The minimum it takes to achieve the goal is most often good enough. Here are a couple of examples to illustrate this (with the intent of providing a learning opportunity).<br>
Working with the destination folder address.<br>
A common error here was missing the subdirectory. Most folks got this correct by using some version of<em>$</em>.FullName.Replace("˜C:\Application\Log"™,"™\NASServer\Archives"™)_ or<em>Join-Path &ldquo;˜\NASServer\Archives&rdquo;™ $</em>.Directory.Name_, but there were a number who just used the root destination folder name without looking for the subfolder. And some others had solutions that (although I thought were innovative), took too much effort. Among them are:</p><p><code>Join-Path "˜\\NASServer\Archives"™ ($_.Directory.Split("˜\"™)[-1]) $_.FullName "“Replace [regex]::Escape("˜C:\Application\Log"™,"™\\NASServer\Archives"™)</code>Once computing the destination, most solutions checked to see if the folder existed and created it if it was missing. But some just tried to create it anyway (too much effort) and others who did not (too little effort).<br>
I"™m not going to comment on the use of Copy-Object vs. Move-Object other than to say that (related to the destination folder) it looks like some people thought the cmdlets would create the path structure but never tested to see that they don"™t. Don&rsquo;t forget to test your solution to verify that it works: working code is far more important that &ldquo;pretty&rdquo; or &ldquo;elegant&rdquo; code.<br><strong>Using Try-Catch-Finally.</strong><br>
Try-Catch-Finally is an awesomely potent construct but you really need to understand how it works. Here&rsquo;s why I think it is serious overkill for this problem. Compare these:</p><p><code>If (-not (Test-Path $DestinationFolder)) {New-Item "“ItemType Directory "“Path $DestinationFolder}</code>Try {Test-Path $DestinationFolder &ldquo;“ErrorAction Stop} Catch {New-Item &ldquo;“ItemType Directory &ldquo;“Path $DestinationFolder}
`Look the same, right? But they have very different results, not to mention different typing efforts. If the destination folder does not exist, then with IF, the folder gets created, but with Try-Catch it will not. This is because Test-Path will return $false, but NO error, so the catch clause will never execute.<br>
Most folks understand that a terminating error has to occur in the Try script block in order for the Catch block to execute. But, instead of using the &ldquo;“ErrorAction Stop parameter in the cmdlet, some of the solutions set $ErrorActionPreference to Stop and then reset it to Continue in a Finally block. There are two problems with this. First, it forces every command in the Try block to generate terminating errors, when there&rdquo;™s normally only one that you care about. Second, $ErrorActionPreference might not have been originally set to Continue. Shouldn&rdquo;™t the previous value be saved and then restored in Finally?<br>
So, going forward, think about how hard you&rdquo;™re working to get to an answer. Don&rdquo;™t use a more complex method than you need to in order to solve a problem. Make good use of Get-Help to verify the parameters and outputs of the cmdlets that you use. And test your objects with Format-List and Get-Member to make sure that the properties really are what you think they are.</p>
]]></content:encoded></item><item><title>Event 2 Opens / Event 1 Winding Down</title><link>https://powershell.org/articles/2013-05-02-event-2-opens-event-1-winding-down/</link><guid>https://powershell.org/articles/2013-05-02-event-2-opens-event-1-winding-down/</guid><pubDate>Thu, 02 May 2013 14:25:12 +0000</pubDate><description>&lt;p&gt;Event 2 is scheduled to open this evening in The Scripting Games - &lt;em&gt;remember, all times on the &lt;a href="http://scriptinggames.org/"&gt;Scripting Games Web site&lt;/a&gt; are GMT.&lt;/em&gt; You will need to adjust for your local time zone.&lt;br&gt;
Voting on Event 1 is scheduled to end on May 7th, so you still have 5 days to earn pointlets and leave comments for your colleagues. As of right now, we have over 330 entries, and an astounding 4,900 votes - an average ratio of more than 14 votes per entry. Folks, that&amp;rsquo;s &lt;em&gt;seven times more&lt;/em&gt; than we&amp;rsquo;ve been able to provide in the past by just having &amp;ldquo;expert judges&amp;rdquo; voting.&lt;br&gt;
Those experts are now being put to better use, providing the learning experience we so much want to deliver. They&amp;rsquo;re posting in their own blogs (&lt;a href="https://powershell.org/the-scripting-games/scripting-games-judges-notes/"&gt;list&lt;/a&gt;) as well as &lt;a href="https://powershell.org/category/announcements/scripting-games/judges-notes/"&gt;here on PowerShell.org&lt;/a&gt;, and there&amp;rsquo;s a lot to read. I&amp;rsquo;m delighted that we&amp;rsquo;ve been able to provide so much commentary before Event 2 starts, since that&amp;rsquo;ll doubtlessly help everyone do better.&lt;br&gt;
The average CrowdScore is 2.551 per entry - obviously there&amp;rsquo;s everything from 1-point entries to 5-point entries. Folks are being pretty critical, and identifying things they don&amp;rsquo;t like, as well as things they do. With more than 1800 comments (that&amp;rsquo;s an average of more than 5 per entry), hopefully competitors are starting to get some take-aways from the community as well.&lt;br&gt;
On Mighty Panel of Celebrity Judges will start awarding first, second, and third place in Event 1 very soon, and that process will take a few days. Keep in mind that their decisions are in no way connected to the community-based CrowdScore. Instead, they&amp;rsquo;re exploring entries on their own, stating with the ones &amp;ldquo;favorited&amp;rdquo; by our expert commentary judges.&lt;br&gt;
Also, I&amp;rsquo;ve heard some concern about people trying to &amp;ldquo;cheat&amp;rdquo; the system by simply dropping in random votes in order to rack up pointlets and win prizes. We&amp;rsquo;re watching for that - we log IP addresses, vote times, and a lot of other data. We&amp;rsquo;ll be filtering the votes before awarding prizes, so there&amp;rsquo;s just no value in cheating. &lt;em&gt;You won&amp;rsquo;t see that filtering -&lt;/em&gt; we&amp;rsquo;re doing it on an offline copy of the data so that there&amp;rsquo;s no chance of accidentally deleting anything valuable - but you&amp;rsquo;ll also be happy to know that, right now, there&amp;rsquo;s very little in the way of anything suspicious, and nothing that&amp;rsquo;s been confirmed.&lt;br&gt;
I want to re-emphasize that the CrowdScore activity doesn&amp;rsquo;t become a true learning experience until &lt;em&gt;after the Games are over,&lt;/em&gt; which is when we can start mining that data and divining some crowdsourced best practices and patterns - creating our own community sense of &amp;ldquo;right and wrong&amp;rdquo; in PowerShell. I also want to point out that, after the Games, we&amp;rsquo;ll be posting all entries, and their comments, into easier-to-download archives (I know the Web site doesn&amp;rsquo;t make copy n paste super-easy; that&amp;rsquo;s largely an artifact of what we need to do to display things properly; we&amp;rsquo;re not offering downloads at this time mainly to control server load).&lt;br&gt;
Enjoy Event 2!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Event 2 is scheduled to open this evening in The Scripting Games -<em>remember, all times on the<a href="http://scriptinggames.org/">Scripting Games Web site</a> are GMT.</em> You will need to adjust for your local time zone.<br>
Voting on Event 1 is scheduled to end on May 7th, so you still have 5 days to earn pointlets and leave comments for your colleagues. As of right now, we have over 330 entries, and an astounding 4,900 votes - an average ratio of more than 14 votes per entry. Folks, that&rsquo;s<em>seven times more</em> than we&rsquo;ve been able to provide in the past by just having &ldquo;expert judges&rdquo; voting.<br>
Those experts are now being put to better use, providing the learning experience we so much want to deliver. They&rsquo;re posting in their own blogs (<a href="https://powershell.org/the-scripting-games/scripting-games-judges-notes/">list</a>) as well as<a href="https://powershell.org/category/announcements/scripting-games/judges-notes/">here on PowerShell.org</a>, and there&rsquo;s a lot to read. I&rsquo;m delighted that we&rsquo;ve been able to provide so much commentary before Event 2 starts, since that&rsquo;ll doubtlessly help everyone do better.<br>
The average CrowdScore is 2.551 per entry - obviously there&rsquo;s everything from 1-point entries to 5-point entries. Folks are being pretty critical, and identifying things they don&rsquo;t like, as well as things they do. With more than 1800 comments (that&rsquo;s an average of more than 5 per entry), hopefully competitors are starting to get some take-aways from the community as well.<br>
On Mighty Panel of Celebrity Judges will start awarding first, second, and third place in Event 1 very soon, and that process will take a few days. Keep in mind that their decisions are in no way connected to the community-based CrowdScore. Instead, they&rsquo;re exploring entries on their own, stating with the ones &ldquo;favorited&rdquo; by our expert commentary judges.<br>
Also, I&rsquo;ve heard some concern about people trying to &ldquo;cheat&rdquo; the system by simply dropping in random votes in order to rack up pointlets and win prizes. We&rsquo;re watching for that - we log IP addresses, vote times, and a lot of other data. We&rsquo;ll be filtering the votes before awarding prizes, so there&rsquo;s just no value in cheating.<em>You won&rsquo;t see that filtering -</em> we&rsquo;re doing it on an offline copy of the data so that there&rsquo;s no chance of accidentally deleting anything valuable - but you&rsquo;ll also be happy to know that, right now, there&rsquo;s very little in the way of anything suspicious, and nothing that&rsquo;s been confirmed.<br>
I want to re-emphasize that the CrowdScore activity doesn&rsquo;t become a true learning experience until<em>after the Games are over,</em> which is when we can start mining that data and divining some crowdsourced best practices and patterns - creating our own community sense of &ldquo;right and wrong&rdquo; in PowerShell. I also want to point out that, after the Games, we&rsquo;ll be posting all entries, and their comments, into easier-to-download archives (I know the Web site doesn&rsquo;t make copy n paste super-easy; that&rsquo;s largely an artifact of what we need to do to display things properly; we&rsquo;re not offering downloads at this time mainly to control server load).<br>
Enjoy Event 2!</p>
]]></content:encoded></item><item><title>Few notes written after event 1.</title><link>https://powershell.org/articles/2013-05-01-few-notes-written-after-event-1/</link><guid>https://powershell.org/articles/2013-05-01-few-notes-written-after-event-1/</guid><pubDate>Thu, 02 May 2013 06:48:11 +0000</pubDate><description>&lt;p&gt;As promised, today more general thoughts on scripts I&amp;rsquo;ve seen in both categories in the first event. I&amp;rsquo;m Polish, so I decided to blog notes both in my own language, and in English, &amp;ldquo;just in case&amp;rdquo;. Also, my Polish is much better than my English (I hope!), so for people from Poland: they can read Polish version, without the pain of translating my-English to English-English. Enjoy!&lt;br&gt;
&lt;a href="http://becomelotr.wordpress.com/2013/05/02/event-1-my-notes/"&gt;English version&lt;/a&gt;&lt;br&gt;
&lt;a href="http://powershellpl.net/2013/05/02/scripting-games-moje-notatki-1/"&gt;Polish version&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>As promised, today more general thoughts on scripts I&rsquo;ve seen in both categories in the first event. I&rsquo;m Polish, so I decided to blog notes both in my own language, and in English, &ldquo;just in case&rdquo;. Also, my Polish is much better than my English (I hope!), so for people from Poland: they can read Polish version, without the pain of translating my-English to English-English. Enjoy!<br><a href="http://becomelotr.wordpress.com/2013/05/02/event-1-my-notes/">English version</a><br><a href="http://powershellpl.net/2013/05/02/scripting-games-moje-notatki-1/">Polish version</a></p>
]]></content:encoded></item><item><title>Scripting Games 2013: Thoughts After Event 1</title><link>https://powershell.org/articles/2013-05-01-scripting-games-2013-thoughts-after-event-1/</link><guid>https://powershell.org/articles/2013-05-01-scripting-games-2013-thoughts-after-event-1/</guid><pubDate>Thu, 02 May 2013 02:21:16 +0000</pubDate><description>&lt;p&gt;With Event 1 in the books for the 2013 Scripting Games, we are now in the voting period where the community gets the chance to play judge on all of the scripts submitted by voting and commenting on the submissions. I aim to take a look at the common items that pose problems and recommendations on what to do to fix this. The full article is available &lt;a href="http://learn-powershell.net/2013/05/01/scripting-games-2013-thoughts-after-event-1/"&gt;here&lt;/a&gt;.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>With Event 1 in the books for the 2013 Scripting Games, we are now in the voting period where the community gets the chance to play judge on all of the scripts submitted by voting and commenting on the submissions. I aim to take a look at the common items that pose problems and recommendations on what to do to fix this. The full article is available<a href="http://learn-powershell.net/2013/05/01/scripting-games-2013-thoughts-after-event-1/">here</a>.</p>
]]></content:encoded></item><item><title>Do you really Support Should Process…?</title><link>https://powershell.org/articles/2013-05-01-do-you-really-support-should-process/</link><guid>https://powershell.org/articles/2013-05-01-do-you-really-support-should-process/</guid><pubDate>Wed, 01 May 2013 22:02:38 +0000</pubDate><description>&lt;p&gt;While working on my notes for first event of Scripting Games I was looking around what others wrote, and was surprised that people really think that enabling SupportsShouldProcess is good enough. In my opinion - it is not. And because this is relatively big topic I decided to write separate blog post just about that. You can find it &lt;a href="http://becomelotr.wordpress.com/2013/05/01/supports-should-process-oh-really/"&gt;here&lt;/a&gt;. I hope it will highlight the difference between &lt;strong&gt;enabling&lt;/strong&gt; this feature and actually &lt;strong&gt;implementing&lt;/strong&gt; it. And remember: &lt;strong&gt;do not&lt;/strong&gt; kill the messenger. 😉 More from me (mainly on other topics related to first event) tomorrow.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>While working on my notes for first event of Scripting Games I was looking around what others wrote, and was surprised that people really think that enabling SupportsShouldProcess is good enough. In my opinion - it is not. And because this is relatively big topic I decided to write separate blog post just about that. You can find it<a href="http://becomelotr.wordpress.com/2013/05/01/supports-should-process-oh-really/">here</a>. I hope it will highlight the difference between<strong>enabling</strong> this feature and actually<strong>implementing</strong> it. And remember:<strong>do not</strong> kill the messenger. 😉 More from me (mainly on other topics related to first event) tomorrow.</p>
]]></content:encoded></item><item><title>And the Norweigian judge says…</title><link>https://powershell.org/articles/2013-05-01-and-the-norweigian-judge-says/</link><guid>https://powershell.org/articles/2013-05-01-and-the-norweigian-judge-says/</guid><pubDate>Wed, 01 May 2013 20:22:12 +0000</pubDate><description>&lt;p&gt;Jan Egil Ring weighs in with his thoughts on Event 1: &lt;a href="http://blog.powershell.no/category/2013-Scripting-Games-Judges-Notes/feed/"&gt;http://blog.powershell.no/category/2013-Scripting-Games-Judges-Notes/feed/&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Jan Egil Ring weighs in with his thoughts on Event 1:<a href="http://blog.powershell.no/category/2013-Scripting-Games-Judges-Notes/feed/">http://blog.powershell.no/category/2013-Scripting-Games-Judges-Notes/feed/</a></p>
]]></content:encoded></item><item><title>Why Doesn't My ValidateScript() work correctly?</title><link>https://powershell.org/articles/2013-05-01-why-doesnt-my-validatescript-work-correctly/</link><guid>https://powershell.org/articles/2013-05-01-why-doesnt-my-validatescript-work-correctly/</guid><pubDate>Wed, 01 May 2013 13:52:06 +0000</pubDate><description>&lt;p&gt;I&amp;rsquo;ve received a few comments from folks after my observations on the Scripting Games Event 1. In those observations, I noted how much I loved:&lt;br&gt;
&lt;strong&gt;[ValidateScript({Test-Path $_})][string]$path&lt;/strong&gt;&lt;br&gt;
As a way of testing to make sure your -Path parameter got a valid value, I love this. I&amp;rsquo;d never thought of it, and I plan to use it in classes. I may write a book about it someday, or maybe even an ode. Seriously good logic. But&amp;hellip; I also bemoaned some scripts that provided an additional Test-Path, in the script&amp;rsquo;s main body of code. Why have a redundant check?&lt;br&gt;
So, first, thanks for the e-mails you all sent. Second&amp;hellip; please understand that I can&amp;rsquo;t respond to you all. I&amp;rsquo;ve got this full-time job thing, and I&amp;rsquo;ve &lt;em&gt;got&lt;/em&gt; to do it or the grocery store will stop taking our checks. You&amp;rsquo;re &lt;em&gt;welcome&lt;/em&gt; to drop comments here, and I &lt;em&gt;really appreciate&lt;/em&gt; when you say stuff like, &amp;ldquo;can you explain ___ in a future post?&amp;rdquo; because it gives me ideas to write about. I just can&amp;rsquo;t get into private e-mail based education for a dozen folks. Teaching is kinda what I do for my job, so most of my time has to go to that.&lt;br&gt;
But - there&amp;rsquo;s a great teaching point here. Let&amp;rsquo;s take this example:&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/05/valid-default-path.png"&gt;&lt;img src="https://powershell.org/wp-content/uploads/2013/05/valid-default-path.png" alt="valid-default-path"&gt;&lt;/a&gt;&lt;br&gt;
This works as you would hopefully expect. When given a valid path, it&amp;rsquo;s fine. When allowed to use a valid default, it&amp;rsquo;s fine. When given an invalid path, it barfs in the ValidateScript. Now look at the next example - which more closely approximates what people have been seeing in their Scripting Games scripts:&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/05/invalid-default-path.png"&gt;&lt;img src="https://powershell.org/wp-content/uploads/2013/05/invalid-default-path.png" alt="invalid-default-path"&gt;&lt;/a&gt;&lt;br&gt;
In the Games, you were given a default path that &lt;em&gt;wasn&amp;rsquo;t valid on your computer.&lt;/em&gt; So folks allowed their script to run with that default, and got errors, and were annoyed that ValidateScript() didn&amp;rsquo;t catch the problem.&lt;br&gt;
It never will.&lt;br&gt;
When you run a command, PowerShell goes through a process called parameter binding, wherein it attaches values to parameters and runs any declarative validation - like ValidateScript(). That validation will &lt;em&gt;always&lt;/em&gt; catch invalid incoming data that&amp;rsquo;s been manually specified or sent in via the pipeline (for parameters that accept pipeline input). Because my -Path parameter wasn&amp;rsquo;t declared as mandatory, the validation routine will let me run the script and not specify -path.&lt;br&gt;
&lt;em&gt;Then&lt;/em&gt; the shell actually &lt;em&gt;runs&lt;/em&gt; my code - and &lt;em&gt;that&amp;rsquo;s&lt;/em&gt; when it assigns the default value to $path if one wasn&amp;rsquo;t specified on -path. Validation is over by this point, so an invalid default value will sneak by. The assumption by the shell is that &lt;em&gt;you&amp;rsquo;re&lt;/em&gt; providing the default value, so &lt;em&gt;you&amp;rsquo;re&lt;/em&gt; smart enough to provide a valid one. If you don&amp;rsquo;t, it&amp;rsquo;s your problem.&lt;br&gt;
So do you just add a second, in-code check for the parameter? I&amp;rsquo;d still say no. I really dislike redundancy. If you know, because of your situation, that you can&amp;rsquo;t rely on ValidateScript(), then don&amp;rsquo;t use it at all - one check should suffice, and if it needs to be in-code instead of declarative, that&amp;rsquo;s fine. What&amp;rsquo;d be nice is if there was a declarative way of specifying a default, like &lt;strong&gt;[Default(&amp;lsquo;whatever&amp;rsquo;)]&lt;/strong&gt; that ran before the validation checks, but such a thing doesn&amp;rsquo;t exist. Frankly, you could probably argue that if you can&amp;rsquo;t guarantee the validity of a default, then you shouldn&amp;rsquo;t provide one - and I&amp;rsquo;d probably buy into that argument, and subscribe to your newsletter.&lt;br&gt;
In this case, the problem is entirely artificial. The default path value given to you in the Games scenario &lt;em&gt;is&lt;/em&gt; valid &lt;em&gt;in the context of the Games;&lt;/em&gt; it&amp;rsquo;s just when you test it on &lt;em&gt;your&lt;/em&gt; system, &lt;em&gt;outside&lt;/em&gt; that context, that a problem crops up.&lt;br&gt;
Hopefully this helps explain how the ValidateXXX() attributes work, and how they interact with other features, like a default value.&lt;br&gt;
&lt;em&gt;Now&lt;/em&gt; explain why this will never assign C:\ as a default value:&lt;br&gt;
&lt;strong&gt;[Parameter(Mandatory=$True)][string]$path = &amp;lsquo;c:'&lt;/strong&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I&rsquo;ve received a few comments from folks after my observations on the Scripting Games Event 1. In those observations, I noted how much I loved:<br><strong>[ValidateScript({Test-Path $_})][string]$path</strong><br>
As a way of testing to make sure your -Path parameter got a valid value, I love this. I&rsquo;d never thought of it, and I plan to use it in classes. I may write a book about it someday, or maybe even an ode. Seriously good logic. But&hellip; I also bemoaned some scripts that provided an additional Test-Path, in the script&rsquo;s main body of code. Why have a redundant check?<br>
So, first, thanks for the e-mails you all sent. Second&hellip; please understand that I can&rsquo;t respond to you all. I&rsquo;ve got this full-time job thing, and I&rsquo;ve<em>got</em> to do it or the grocery store will stop taking our checks. You&rsquo;re<em>welcome</em> to drop comments here, and I<em>really appreciate</em> when you say stuff like, &ldquo;can you explain ___ in a future post?&rdquo; because it gives me ideas to write about. I just can&rsquo;t get into private e-mail based education for a dozen folks. Teaching is kinda what I do for my job, so most of my time has to go to that.<br>
But - there&rsquo;s a great teaching point here. Let&rsquo;s take this example:<br><a href="https://powershell.org/wp-content/uploads/2013/05/valid-default-path.png"><img src="https://powershell.org/wp-content/uploads/2013/05/valid-default-path.png" alt="valid-default-path"/><br>
This works as you would hopefully expect. When given a valid path, it&rsquo;s fine. When allowed to use a valid default, it&rsquo;s fine. When given an invalid path, it barfs in the ValidateScript. Now look at the next example - which more closely approximates what people have been seeing in their Scripting Games scripts:<br><a href="https://powershell.org/wp-content/uploads/2013/05/invalid-default-path.png"><img src="https://powershell.org/wp-content/uploads/2013/05/invalid-default-path.png" alt="invalid-default-path"/><br>
In the Games, you were given a default path that<em>wasn&rsquo;t valid on your computer.</em> So folks allowed their script to run with that default, and got errors, and were annoyed that ValidateScript() didn&rsquo;t catch the problem.<br>
It never will.<br>
When you run a command, PowerShell goes through a process called parameter binding, wherein it attaches values to parameters and runs any declarative validation - like ValidateScript(). That validation will<em>always</em> catch invalid incoming data that&rsquo;s been manually specified or sent in via the pipeline (for parameters that accept pipeline input). Because my -Path parameter wasn&rsquo;t declared as mandatory, the validation routine will let me run the script and not specify -path.<br><em>Then</em> the shell actually<em>runs</em> my code - and<em>that&rsquo;s</em> when it assigns the default value to $path if one wasn&rsquo;t specified on -path. Validation is over by this point, so an invalid default value will sneak by. The assumption by the shell is that<em>you&rsquo;re</em> providing the default value, so<em>you&rsquo;re</em> smart enough to provide a valid one. If you don&rsquo;t, it&rsquo;s your problem.<br>
So do you just add a second, in-code check for the parameter? I&rsquo;d still say no. I really dislike redundancy. If you know, because of your situation, that you can&rsquo;t rely on ValidateScript(), then don&rsquo;t use it at all - one check should suffice, and if it needs to be in-code instead of declarative, that&rsquo;s fine. What&rsquo;d be nice is if there was a declarative way of specifying a default, like<strong>[Default(&lsquo;whatever&rsquo;)]</strong> that ran before the validation checks, but such a thing doesn&rsquo;t exist. Frankly, you could probably argue that if you can&rsquo;t guarantee the validity of a default, then you shouldn&rsquo;t provide one - and I&rsquo;d probably buy into that argument, and subscribe to your newsletter.<br>
In this case, the problem is entirely artificial. The default path value given to you in the Games scenario<em>is</em> valid<em>in the context of the Games;</em> it&rsquo;s just when you test it on<em>your</em> system,<em>outside</em> that context, that a problem crops up.<br>
Hopefully this helps explain how the ValidateXXX() attributes work, and how they interact with other features, like a default value.<br><em>Now</em> explain why this will never assign C:\ as a default value:<br><strong>[Parameter(Mandatory=$True)][string]$path = &lsquo;c:'</strong></p>
]]></content:encoded></item><item><title>Tobias' Judge Notes</title><link>https://powershell.org/articles/2013-05-01-tobias-judge-notes/</link><guid>https://powershell.org/articles/2013-05-01-tobias-judge-notes/</guid><pubDate>Wed, 01 May 2013 13:33:45 +0000</pubDate><description>&lt;p&gt;Tobias Weltner offers some &amp;ldquo;don&amp;rsquo;ts&amp;rdquo; from his review of Event 1 entries: &lt;a href="http://www.powertheshell.com/scripting-games-advanced-1/"&gt;http://www.powertheshell.com/scripting-games-advanced-1/&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Tobias Weltner offers some &ldquo;don&rsquo;ts&rdquo; from his review of Event 1 entries:<a href="http://www.powertheshell.com/scripting-games-advanced-1/">http://www.powertheshell.com/scripting-games-advanced-1/</a></p>
]]></content:encoded></item><item><title>Thoughts on Event 1 – and, frankly, a rant.</title><link>https://powershell.org/articles/2013-04-30-thoughts-on-event-1-and-frankly-a-rant/</link><guid>https://powershell.org/articles/2013-04-30-thoughts-on-event-1-and-frankly-a-rant/</guid><pubDate>Wed, 01 May 2013 00:06:53 +0000</pubDate><description>&lt;p&gt;There&amp;rsquo;s been a lot of dismay floating around the community about the state of &amp;ldquo;community voting&amp;rdquo; in the Scripting Games. Some folks are voting without leaving comments (we&amp;rsquo;ve expanded the comment field to 2000 characters, hopefully that&amp;rsquo;ll help), and some disagreement about scores.&lt;br&gt;
Disagreement is natural. For example, stick a &lt;strong&gt;Write-Host&lt;/strong&gt; in your script and I&amp;rsquo;m likely to score you lower. You may disagree, but it&amp;rsquo;s how I feel in many situations&amp;hellip; and I&amp;rsquo;m seeing a distressing amount of it.&lt;br&gt;
Did you know that using &lt;strong&gt;[CmdletBinding(SupportsShouldProcess=$True)]&lt;/strong&gt; doesn&amp;rsquo;t automatically and universally &lt;em&gt;make the -confirm switch work?&lt;/em&gt; You have to do a bit more.&lt;br&gt;
Did you know that if you put &lt;strong&gt;$DebugPreference=&amp;lsquo;SilentlyContinue&amp;rsquo;&lt;/strong&gt; in your &lt;strong&gt;BEGIN{}&lt;/strong&gt; block, that you disable the built in -Debug switch&amp;rsquo;s functionality? Yep, seen this one a few times also.&lt;br&gt;
The community is showing a distinct lack of love for scripts that look like VBScript scripts. Does that mean your script is wrong? No - but it means you&amp;rsquo;re not approaching the problem in a way that the world in general feels is best. It doesn&amp;rsquo;t mean your script won&amp;rsquo;t work - but it means it wouldn&amp;rsquo;t be widely accepted.&lt;br&gt;
If you&amp;rsquo;re not happy with your score, look at some higher-scoring scripts. See what they&amp;rsquo;re doing differently. If you can&amp;rsquo;t figure it out, post in the forums on PowerShell.org (there&amp;rsquo;s a Scripting Games forum). Provide the permalink to your script, and solicit some feedback from the community. Tweet people and ask them to take a look. You can &lt;em&gt;ask&lt;/em&gt; for more feedback, if you want it and aren&amp;rsquo;t getting enough.&lt;br&gt;
As our judges begin to post their notes, look at what they&amp;rsquo;re writing. Maybe they didn&amp;rsquo;t pick your script to write about - but are they writing about things that you also did in your script?&lt;br&gt;
I&amp;rsquo;m seeing a lot of good scripts. But I&amp;rsquo;m also seeing some misunderstandings of some core, advanced features, like error handling, use of Verbose output, and so on. Each of those is a star to a half-star off, for me&amp;hellip; some of these things, &lt;em&gt;in my opinion,&lt;/em&gt; are severe, and I score accordingly. I haven&amp;rsquo;t seen a perfect, un-improve-able script, yet (I&amp;rsquo;m not even halfway through, yet). So no 5-stars yet. But I &lt;em&gt;am&lt;/em&gt; trying to leave comments, and I know others are, too, so hopefully folks can improve. But be patient - it takes &lt;em&gt;time.&lt;/em&gt;&lt;br&gt;
And &lt;em&gt;opinions differ.&lt;/em&gt; Let me offer an example:&lt;br&gt;
&lt;strong&gt;Write-Verbose (&amp;ldquo;Script: {0} ended at {1}&amp;rdquo; -f $MyInvocation.ScriptName, (get-date) )&lt;/strong&gt;&lt;br&gt;
****Dislike. Not saying it&amp;rsquo;s wrong at all - and some people will disagree, vehemently, with me. But I find -f strings hard to read.&lt;br&gt;
&lt;strong&gt;Write-Verbose &amp;ldquo;Script $($MyInvocation.ScriptName) ended at $(Get-Date)&amp;rdquo;&lt;/strong&gt;&lt;br&gt;
****For me, that&amp;rsquo;s easier to read. Not any more &amp;ldquo;right,&amp;rdquo; but in my company that&amp;rsquo;s the standard we adopted and that we use. Now, hopefully my opinion is being balanced by others&amp;rsquo; opinions. But, if a substantial number of people share my opinion, this code would get a low score, and a &lt;em&gt;community standard practice&lt;/em&gt; would emerge - something we can learn from &lt;em&gt;after the Games are complete.&lt;/em&gt; Because yes, I&amp;rsquo;m going to harvest the Games entries and comments long after the Games are over to help keep the conversation and education going.&lt;br&gt;
My point of this is that &lt;em&gt;none of us&lt;/em&gt; are as awesome as we think. Others will always have points of disagreement. What&amp;rsquo;s really exciting here is the opportunity to create a community consensus of what&amp;rsquo;s best. That won&amp;rsquo;t come for several weeks, yet&amp;hellip; but it &lt;em&gt;will&lt;/em&gt; come. There is &lt;strong&gt;zero immediate benefit in getting a high score in the Games, and zero immediate detriment to a low score.&lt;/strong&gt; This is going to seem harsh, but the Games are not about &lt;em&gt;you.&lt;/em&gt; They&amp;rsquo;re about &lt;em&gt;all of us.&lt;/em&gt; They&amp;rsquo;re about us developing a sense of community involvement and standards in an industry that doesn&amp;rsquo;t supply many of its own. This will happen over time, and with a lot of effort. But it&amp;rsquo;s worth it.&lt;br&gt;
Let&amp;rsquo;s continue.&lt;br&gt;
&lt;strong&gt;[ValidateScript({(Test-Path $_ -PathType Container)})]&lt;/strong&gt;&lt;br&gt;
I love that. I never thought to do that, and I love it. I&amp;rsquo;ve seen a few people do it. Bless them. I learned something!&lt;br&gt;
An aside: There&amp;rsquo;s this general undercurrent of, &amp;ldquo;I wish &amp;rsquo;expert&amp;rsquo; judges were scoring me instead of the great unwashed masses.&amp;rdquo; Let me point out some practical realities. One, every entry in the Games at this point has at least 4 votes; many have double that. The last event, most had 1, 2 at most. And yes, while &amp;rsquo;expert&amp;rsquo; judges are allegedly well-qualified to render judgment, I&amp;rsquo;m not seeing a ton of scores I completely disagree with, yet. A few. Not a ton. And you want to know a dirty secret? How many entries do you think an &amp;rsquo;expert&amp;rsquo; can look at, in the evening, after working all day (we&amp;rsquo;re all volunteers), before he just starts getting a little arbitrary and inconsistent? The number is not &amp;ldquo;infinite.&amp;rdquo; I know I got a little arbitrary last year before I caught myself and stopped for the night. So&amp;hellip; don&amp;rsquo;t discount the value of your peers&amp;rsquo; opinions. If you&amp;rsquo;re getting a low score and don&amp;rsquo;t know why, seek out answers. Yes, people should leave comments with their votes. If they don&amp;rsquo;t, take charge and seek out answers yourself.&lt;br&gt;
I &lt;strong&gt;love&lt;/strong&gt; that I&amp;rsquo;m seeing so many divergent approaches to a single (admittedly open-ended) problem. Frankly, the value here is in browsing others&amp;rsquo; approaches and picking up some tips from them. Or just seeing something different. You shouldn&amp;rsquo;t care about your &lt;em&gt;score.&lt;/em&gt; You should care about what other people are doing, and about why you think their way might be better, worse, or just different. &lt;em&gt;Make&lt;/em&gt; a learning opportunity. Don&amp;rsquo;t wait for someone to come to you with a free, written analysis of your code. Analyze &lt;em&gt;other people&amp;rsquo;s entries&lt;/em&gt; and judge yourself against their work.&lt;br&gt;
I&amp;rsquo;ve seen this a few times:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>There&rsquo;s been a lot of dismay floating around the community about the state of &ldquo;community voting&rdquo; in the Scripting Games. Some folks are voting without leaving comments (we&rsquo;ve expanded the comment field to 2000 characters, hopefully that&rsquo;ll help), and some disagreement about scores.<br>
Disagreement is natural. For example, stick a<strong>Write-Host</strong> in your script and I&rsquo;m likely to score you lower. You may disagree, but it&rsquo;s how I feel in many situations&hellip; and I&rsquo;m seeing a distressing amount of it.<br>
Did you know that using<strong>[CmdletBinding(SupportsShouldProcess=$True)]</strong> doesn&rsquo;t automatically and universally<em>make the -confirm switch work?</em> You have to do a bit more.<br>
Did you know that if you put<strong>$DebugPreference=&lsquo;SilentlyContinue&rsquo;</strong> in your<strong>BEGIN{}</strong> block, that you disable the built in -Debug switch&rsquo;s functionality? Yep, seen this one a few times also.<br>
The community is showing a distinct lack of love for scripts that look like VBScript scripts. Does that mean your script is wrong? No - but it means you&rsquo;re not approaching the problem in a way that the world in general feels is best. It doesn&rsquo;t mean your script won&rsquo;t work - but it means it wouldn&rsquo;t be widely accepted.<br>
If you&rsquo;re not happy with your score, look at some higher-scoring scripts. See what they&rsquo;re doing differently. If you can&rsquo;t figure it out, post in the forums on PowerShell.org (there&rsquo;s a Scripting Games forum). Provide the permalink to your script, and solicit some feedback from the community. Tweet people and ask them to take a look. You can<em>ask</em> for more feedback, if you want it and aren&rsquo;t getting enough.<br>
As our judges begin to post their notes, look at what they&rsquo;re writing. Maybe they didn&rsquo;t pick your script to write about - but are they writing about things that you also did in your script?<br>
I&rsquo;m seeing a lot of good scripts. But I&rsquo;m also seeing some misunderstandings of some core, advanced features, like error handling, use of Verbose output, and so on. Each of those is a star to a half-star off, for me&hellip; some of these things,<em>in my opinion,</em> are severe, and I score accordingly. I haven&rsquo;t seen a perfect, un-improve-able script, yet (I&rsquo;m not even halfway through, yet). So no 5-stars yet. But I<em>am</em> trying to leave comments, and I know others are, too, so hopefully folks can improve. But be patient - it takes<em>time.</em><br>
And<em>opinions differ.</em> Let me offer an example:<br><strong>Write-Verbose (&ldquo;Script: {0} ended at {1}&rdquo; -f $MyInvocation.ScriptName, (get-date) )</strong><br>
****Dislike. Not saying it&rsquo;s wrong at all - and some people will disagree, vehemently, with me. But I find -f strings hard to read.<br><strong>Write-Verbose &ldquo;Script $($MyInvocation.ScriptName) ended at $(Get-Date)&rdquo;</strong><br>
****For me, that&rsquo;s easier to read. Not any more &ldquo;right,&rdquo; but in my company that&rsquo;s the standard we adopted and that we use. Now, hopefully my opinion is being balanced by others&rsquo; opinions. But, if a substantial number of people share my opinion, this code would get a low score, and a<em>community standard practice</em> would emerge - something we can learn from<em>after the Games are complete.</em> Because yes, I&rsquo;m going to harvest the Games entries and comments long after the Games are over to help keep the conversation and education going.<br>
My point of this is that<em>none of us</em> are as awesome as we think. Others will always have points of disagreement. What&rsquo;s really exciting here is the opportunity to create a community consensus of what&rsquo;s best. That won&rsquo;t come for several weeks, yet&hellip; but it<em>will</em> come. There is<strong>zero immediate benefit in getting a high score in the Games, and zero immediate detriment to a low score.</strong> This is going to seem harsh, but the Games are not about <em>you.</em> They&rsquo;re about<em>all of us.</em> They&rsquo;re about us developing a sense of community involvement and standards in an industry that doesn&rsquo;t supply many of its own. This will happen over time, and with a lot of effort. But it&rsquo;s worth it.<br>
Let&rsquo;s continue.<br><strong>[ValidateScript({(Test-Path $_ -PathType Container)})]</strong><br>
I love that. I never thought to do that, and I love it. I&rsquo;ve seen a few people do it. Bless them. I learned something!<br>
An aside: There&rsquo;s this general undercurrent of, &ldquo;I wish &rsquo;expert&rsquo; judges were scoring me instead of the great unwashed masses.&rdquo; Let me point out some practical realities. One, every entry in the Games at this point has at least 4 votes; many have double that. The last event, most had 1, 2 at most. And yes, while &rsquo;expert&rsquo; judges are allegedly well-qualified to render judgment, I&rsquo;m not seeing a ton of scores I completely disagree with, yet. A few. Not a ton. And you want to know a dirty secret? How many entries do you think an &rsquo;expert&rsquo; can look at, in the evening, after working all day (we&rsquo;re all volunteers), before he just starts getting a little arbitrary and inconsistent? The number is not &ldquo;infinite.&rdquo; I know I got a little arbitrary last year before I caught myself and stopped for the night. So&hellip; don&rsquo;t discount the value of your peers&rsquo; opinions. If you&rsquo;re getting a low score and don&rsquo;t know why, seek out answers. Yes, people should leave comments with their votes. If they don&rsquo;t, take charge and seek out answers yourself.<br>
I<strong>love</strong> that I&rsquo;m seeing so many divergent approaches to a single (admittedly open-ended) problem. Frankly, the value here is in browsing others&rsquo; approaches and picking up some tips from them. Or just seeing something different. You shouldn&rsquo;t care about your<em>score.</em> You should care about what other people are doing, and about why you think their way might be better, worse, or just different.<em>Make</em> a learning opportunity. Don&rsquo;t wait for someone to come to you with a free, written analysis of your code. Analyze<em>other people&rsquo;s entries</em> and judge yourself against their work.<br>
I&rsquo;ve seen this a few times:</p><p><code># Validate that the source/log path provided is valid if (-not (Test-Path $LogDirectory)) { Read-Host -Prompt 'Please provide a valid log directory'; }</code>I had honestly never thought of that. I&rsquo;m not sure how I feel about it. Generally, PowerShell commands throw errors - they don&rsquo;t prompt you to retry, and I&rsquo;m a big fan of consistency with the native commands. Right now I think this is a 1/8th point off for me&hellip; but I appreciate the approach and I&rsquo;m still thinking about it.<br>
I&rsquo;ve seen this a<strong>lot:</strong></p><p>`Get-ChildItem -Path $LogDirectory -Filter $Filter |
Where-Object {
$<em>.PSIsContainer -eq $false
-and
$</em>.LastWriteTime -le (Get-Date).AddDays(-($RetentionPeriod)) } |
ForEach-Object {
$RelativePath = $_.FullName.Substring($LogDirectory.Length);</p><h1 id="truncated" class="ps-heading">(truncated)<a class="ps-heading-anchor" href="#truncated" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>`Personally, dislike. That&rsquo;s command-line, console-host approach - not a script. I think these massive pipeline blocks, in a script, are harder to read. Are they wrong? No. Will someone disagree with me? Yes. Again, vehemently. But I&rsquo;m entitled to my opinion, and my opinion is that I&rsquo;d rather see a scripting construct (ForEach) than a massive pipeline construct. Not in every scenario ever, perhaps, but&hellip; I&rsquo;m biased against this approach. Understand that<strong>Where-Object</strong> is really just a ForEach loop in sheep&rsquo;s clothing&hellip; I suspect a single ForEach scripting construct could accomplish this block of logic in less time. As-is, you&rsquo;re looping through each object at least once&hellip; and many of them twice. That could be tighter.<br><strong>Write-Warning $_.Exception.Message</strong><br>
****This bums me out a little and I&rsquo;ve seen it a lot. $_ can get hijacked a little easily, depending on your code&hellip; and frankly, it&rsquo;s hard to read. Why not take one extra step and use -ErrorVariable to capture the error into an easy-to-read variable name, and work with that? There<em>are</em> some arguments why not&hellip; but, in a broad sense, I prefer declarative, explicit stuff vs. weird built-in variables. I hate $_ even though it&rsquo;s used bloody everywhere.</p><blockquote><p>Another aside: I&rsquo;ve gotten several support e-mails from folks who missed the cutoff time. The site<strong>clearly indicates that all times are GMT.</strong> This is a global competition, and your local time zone isn&rsquo;t the only one out there. We can&rsquo;t provide exceptions to the cutoff - I&rsquo;m truly sorry about that, but you can continue to participate in the next event.<strong>All times are GMT.</strong> The Competitor Guide also clearly states that all ties will be given as GMT, and if you&rsquo;ve any confusion, the menu bar of the Games Web site lists the current time in GMT, which is what the server uses to make all scheduling decisions.</p></blockquote><p><strong>[ValidateScript({Test-Path $_})]</strong><br>
****I freaking love that. Points off if you&rsquo;ve included that<strong>and</strong> you&rsquo;ve coded a manual check for the path. Redundancy doesn&rsquo;t pay, unless it&rsquo;s a server cluster.</p><p><code>if (!(Get-PSDrive -Name "dest" -ErrorAction:SilentlyContinue)){ try { New-PSDrive -Name "dest" -PSProvider FileSystem -Root $Destination -ErrorAction:Stop | Out-Null } catch { throw "Cannot establish PS Drive for destination: $Destination. Check the path and try again." } }</code>I am at a bit of a loss as to why this solution needed a PSDrive. I mean&hellip; not wrong, but befuddling. I do tend to down-vote code I regard as unnecessary (and a lengthy comment explaining why you feel it&rsquo;s necessary won&rsquo;t help, if I disagree). In this case&hellip; I was just confused as to the need. Oh, and<strong>-ErrorAction:SilentlyContinue</strong> looks plain weird. Why would you include the colon? You didn&rsquo;t for any other parameter. Minus 1/8th point for style - just because I&rsquo;m a stickler for consistency, and using the colon breaks consistency. Some poor slob in the future is going to look at this and wonder, &ldquo;when do I use a colon and when don&rsquo;t I? Aggh!&rdquo; and I&rsquo;m going to have to write a book about it. Argh. .<br>
Look at<a href="http://scriptinggames.org/entrylist.php?entryid=16">http://scriptinggames.org/entrylist.php?entryid=16</a> and tell me why I love it. Man, I hope that link works. If it doesn&rsquo;t don&rsquo;t yell - I&rsquo;ll fix it.<br>
Oh:</p><p><code>param( [Parameter(Position=0)] [string]$Source = "C:\Application\Log", [Parameter(Position=1)] [string]$Destination = "\\NASServer\Archives", [int]$MaxAge = 90 )</code>I don&rsquo;t downvote for this, but I&rsquo;m curious: Why declare a position for every parameter, when what you&rsquo;ve declared is the default? Without those<strong>Position=x</strong> statements, you&rsquo;d get exactly the same thing, right? Seems unnecessary?<br>
Want more feedback?<a href="http://scriptinggames.org/entrylist.php?entryid=165">http://scriptinggames.org/entrylist.php?entryid=165</a>. That&rsquo;s the Scripting Wife&rsquo;s entry. She&rsquo;s an<em>accountant.</em> But she&rsquo;s taken the time to be loved, so everyone votes on her entry. And I&rsquo;ll point out she&rsquo;s not getting a 5.0 score - so folks are clearly willing to be critical, even in spite of love.<br>
Go, and be loved .</p>
]]></content:encoded></item><item><title>How to Name Your Help Files</title><link>https://powershell.org/articles/2013-04-30-how-to-name-your-help-files/</link><guid>https://powershell.org/articles/2013-04-30-how-to-name-your-help-files/</guid><pubDate>Tue, 30 Apr 2013 22:42:53 +0000</pubDate><description>&lt;p&gt;The first challenge of Scripting Games 2013 is complete! Honestly, you win by getting the experience of playing. I hope everyone is in there voting and writing really constructive comments. I&amp;rsquo;ll get over there in a minute, but I wanted to make sure that I got this information out to everyone before I get involved in voting.&lt;br&gt;
Everyone who writes shared Windows PowerShell cmdlets, functions, scripts, CIM commands, and workflows also writes help topics &amp;ldquo;“ or gets a friend or colleague to do it.&lt;br&gt;
For scripts and functions, you can write &lt;a href="http://go.microsoft.com/fwlink/?LinkID=144309"&gt;comment-based help&lt;/a&gt; (aka &amp;ldquo;inline help&amp;rdquo;).  All parameters of the Get-Help cmdlet support comment-based help, including the new ShowWindow parameter, and by adding a URL to the first related link, you can support the Online parameter in comment-based help.&lt;br&gt;
But XML help files are required to document cmdlets (C#), CIM commands, and workflows, and to support Updatable Help. If you&amp;rsquo;re delivering your content in a module, you typically want to use XML-based help topics.&lt;br&gt;
When you create XML-based help topics, you need to put them where Get-Help looks and give them the name that Get-Help expects. Otherwise, Get-Help will not find the help topic.&lt;br&gt;
Get-Help looks for the XML-based help topics for the commands in a module in language-specific subdirectories of the module&amp;rsquo;s installation directory.  This is generally well-known and an easy instruction to follow.&lt;br&gt;
The naming guidelines are a bit trickier. In general (specifics follow), Get-Help expects the help topic for a command to be in a help file that is named for the file in which the command is defined, including the file name extension. When the commands in a module are defined in multiple assemblies or multiple CDXML files, the module must include a separate help file for each assembly or CDXML file.&lt;br&gt;
The help file name format is: &lt;strong&gt;-help.xml&lt;/strong&gt;&lt;br&gt;
For example:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>The first challenge of Scripting Games 2013 is complete! Honestly, you win by getting the experience of playing. I hope everyone is in there voting and writing really constructive comments. I&rsquo;ll get over there in a minute, but I wanted to make sure that I got this information out to everyone before I get involved in voting.<br>
Everyone who writes shared Windows PowerShell cmdlets, functions, scripts, CIM commands, and workflows also writes help topics &ldquo;“ or gets a friend or colleague to do it.<br>
For scripts and functions, you can write<a href="http://go.microsoft.com/fwlink/?LinkID=144309">comment-based help</a> (aka &ldquo;inline help&rdquo;).  All parameters of the Get-Help cmdlet support comment-based help, including the new ShowWindow parameter, and by adding a URL to the first related link, you can support the Online parameter in comment-based help.<br>
But XML help files are required to document cmdlets (C#), CIM commands, and workflows, and to support Updatable Help. If you&rsquo;re delivering your content in a module, you typically want to use XML-based help topics.<br>
When you create XML-based help topics, you need to put them where Get-Help looks and give them the name that Get-Help expects. Otherwise, Get-Help will not find the help topic.<br>
Get-Help looks for the XML-based help topics for the commands in a module in language-specific subdirectories of the module&rsquo;s installation directory.  This is generally well-known and an easy instruction to follow.<br>
The naming guidelines are a bit trickier. In general (specifics follow), Get-Help expects the help topic for a command to be in a help file that is named for the file in which the command is defined, including the file name extension. When the commands in a module are defined in multiple assemblies or multiple CDXML files, the module must include a separate help file for each assembly or CDXML file.<br>
The help file name format is:<strong>-help.xml</strong><br>
For example:</p><ul><li>System.Management.Automation.dll-help.xml    #Cmdlets, providers</li><li>MSFT_NetIPAddress.cdxml-help.xml             # CIM commands</li><li>RemoteDesktop.psm1-help.xml                  # Functions, Script workflows</li></ul><p>Here are the specifics:</p><ul><li><strong>Cmdlets</strong>:  Help topics for cmdlets must be in a file that is named for the<em>assembly</em> in which the cmdlet is defined.</li><li><strong>Providers</strong>:  Just like cmdlets, the help topics for providers must be in a file that is named for the assembly in which the provider is defined. The order in which cmdlet and provider help topics appear in the XML file doesn&rsquo;t matter a bit.</li><li><strong>CIM Commands</strong>: Help topics for CIM commands must be in a file that is named for the CDXML file in which the cmdlet is defined. Yup, if you have a module with 22 nested CIM modules, each with its own CDXML file, you need to create 22 CDXML-help.xml files. J</li></ul><p>Easy, right? Now it gets a bit weird.</p><ul><li><strong>Script workflows</strong>: You can write XML help files for script workflows in modules. The names don&rsquo;t matter. Get-Help looks in all XML files in the language-specific subdirectories of the module directory. However, to be consistent, it&rsquo;s best to name script workflow help files for the script module in which they are defined. For example, .psm1-help.xml.</li><li><strong>Functions</strong>:  Get-Help looks in the function code for an<strong>.ExternalHelp</strong> comment. The value of the comment is the help file name. If there&rsquo;s no ExternalHelp comment, Get-Help cannot find the XML based help file, no matter where it is or what it&rsquo;s named.Get-Help does not require a particular name for function help files, but they&rsquo;re typically named for the script module in which they are defined, such as MyModule.psm1-help.xml.For example:</li></ul><p><code>Function MyFunction { #.ExternalHelp MyModule.psm1-help.xml [CmdletBinding()] [OutputType([int])] Param . . . }</code>-or</p><p><code>#.ExternalHelp MyModule.psm1-help.xml Function MyFunction { [CmdletBinding()] [OutputType([int])] Param . . . }</code>If your module contains cmdlets and functions, you can put all of your help topics in the same XML file, but each function must include an ExternalHelp comment with the name of the XML help file.</p><p>That&rsquo;s the story. So, if you are writing XML help files, be sure that the name and placement of the help files is correct. If you&rsquo;re stuck, ping me on Facebook or Twitter (@juneb_get_help) and I&rsquo;ll give you a hand.</p>
]]></content:encoded></item><item><title>New Technical Product Manager at Provance Technologies</title><link>https://powershell.org/articles/2013-04-30-new-technical-product-manager-at-provance-technologies/</link><guid>https://powershell.org/articles/2013-04-30-new-technical-product-manager-at-provance-technologies/</guid><pubDate>Tue, 30 Apr 2013 19:25:34 +0000</pubDate><description>&lt;p&gt;Today is my first day working in my new role as Technical Product Manager at &lt;a href="http://www.provance.com/" title="Provance Technologies"&gt;Provance Technologies&lt;/a&gt;.  A little while back Provance approached me to talk about this position, and it seemed like a very natural fit.  Rarely have I felt such a positive vibe from a company through the interview process, so I was really happy to accept the position of Technical Product Manager with them and I have been looking forward to starting work with them.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Today is my first day working in my new role as Technical Product Manager at<a href="http://www.provance.com/" title="Provance Technologies">Provance Technologies</a>.  A little while back Provance approached me to talk about this position, and it seemed like a very natural fit.  Rarely have I felt such a positive vibe from a company through the interview process, so I was really happy to accept the position of Technical Product Manager with them and I have been looking forward to starting work with them.</p><p>Now that I am working full-time with<a href="http://provance.com/" title="Provance Technologies">Provance</a>, I"™ll be getting up to speed as quickly as I can on the IT Asset Management Pack and the Data Management Pack products that we offer to help companies properly manage the assets they have inside their organization.  I know there is already some PowerShell support in one of the products, although I haven"™t personally taken a look at it yet (but you can bet I will be soon).</p><p>For those of you who regularly follow my blog, if you happen to use either of these products in your organization, I"™d love to hear about it.</p><p>Kirk out.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/kirkmunro.wordpress.com/862/"><img src="http://feeds.wordpress.com/1.0/comments/kirkmunro.wordpress.com/862/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=poshoholic.com&amp;blog=1436967&amp;%23038;post=862&amp;%23038;subd=kirkmunro&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Scripting Games Voting Continues!</title><link>https://powershell.org/articles/2013-04-30-scripting-games-voting-continues/</link><guid>https://powershell.org/articles/2013-04-30-scripting-games-voting-continues/</guid><pubDate>Tue, 30 Apr 2013 17:52:21 +0000</pubDate><description>&lt;p&gt;As of right now, we&amp;rsquo;ve got almost 1900 votes on entries in the &lt;a href="http://scriptinggames.org/"&gt;Scripting Games&lt;/a&gt;. Remember that each vote is a &amp;ldquo;pointlet&amp;rdquo; (see the PowerShell tie-in we did there?), which is basically a raffle ticket in our prize lottery.&lt;br&gt;
But&amp;hellip; there&amp;rsquo;s a secret about the lottery. It&amp;rsquo;s weighted based on how many entries you&amp;rsquo;ve voted on.&lt;br&gt;
The algorithm is a bit complex, but for example, if you&amp;rsquo;ve voted on 90% of the available entries, you&amp;rsquo;re something like 30% more likely to win a prize. Vote on 50%, and you&amp;rsquo;re about 12% more likely to win&amp;hellip; and so on. It&amp;rsquo;s a bit logarithmic&amp;hellip; as you get closer to 100% your chances of winning increase more and more, with about a 39% advantage if you&amp;rsquo;ve voted on 100% of the events.&lt;br&gt;
Of course, you can&amp;rsquo;t just abuse the system. We&amp;rsquo;ve got automated and manual checks in place for people who are just randomly voting - clicking all the same vote, voting in patterns, or voting with very little time separation between votes. All of those things will trigger a manual review, and you can be banned &lt;em&gt;for life&lt;/em&gt; for attempting to game the system. We&amp;rsquo;re also tracking IP addresses and whatnot, so if you&amp;rsquo;re voting from multiple accounts, or trying to upvote your own entries&amp;hellip; we&amp;rsquo;re going to just shut you out. You won&amp;rsquo;t even necessarily be notified, because we&amp;rsquo;re not confrontational folks.&lt;br&gt;
But I know nobody&amp;rsquo;d do all that - we&amp;rsquo;re all in this to make the Games fun and educational! So get in there and vote. And leave comments. If you vote 1-star, tell the author why, so they can improve. Hey, it&amp;rsquo;s what YOU would want if someone 1-starred YOUR code, right? Right!&lt;br&gt;
So vote! &lt;a href="http://scriptinggames.org/"&gt;http://ScriptingGames.org&lt;/a&gt;!&lt;br&gt;
(PS - please don&amp;rsquo;t report any tech problems in the comments here. The Games Web site has a feedback link)&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>As of right now, we&rsquo;ve got almost 1900 votes on entries in the<a href="http://scriptinggames.org/">Scripting Games</a>. Remember that each vote is a &ldquo;pointlet&rdquo; (see the PowerShell tie-in we did there?), which is basically a raffle ticket in our prize lottery.<br>
But&hellip; there&rsquo;s a secret about the lottery. It&rsquo;s weighted based on how many entries you&rsquo;ve voted on.<br>
The algorithm is a bit complex, but for example, if you&rsquo;ve voted on 90% of the available entries, you&rsquo;re something like 30% more likely to win a prize. Vote on 50%, and you&rsquo;re about 12% more likely to win&hellip; and so on. It&rsquo;s a bit logarithmic&hellip; as you get closer to 100% your chances of winning increase more and more, with about a 39% advantage if you&rsquo;ve voted on 100% of the events.<br>
Of course, you can&rsquo;t just abuse the system. We&rsquo;ve got automated and manual checks in place for people who are just randomly voting - clicking all the same vote, voting in patterns, or voting with very little time separation between votes. All of those things will trigger a manual review, and you can be banned<em>for life</em> for attempting to game the system. We&rsquo;re also tracking IP addresses and whatnot, so if you&rsquo;re voting from multiple accounts, or trying to upvote your own entries&hellip; we&rsquo;re going to just shut you out. You won&rsquo;t even necessarily be notified, because we&rsquo;re not confrontational folks.<br>
But I know nobody&rsquo;d do all that - we&rsquo;re all in this to make the Games fun and educational! So get in there and vote. And leave comments. If you vote 1-star, tell the author why, so they can improve. Hey, it&rsquo;s what YOU would want if someone 1-starred YOUR code, right? Right!<br>
So vote!<a href="http://scriptinggames.org/">http://ScriptingGames.org</a>!<br>
(PS - please don&rsquo;t report any tech problems in the comments here. The Games Web site has a feedback link)</p>
]]></content:encoded></item><item><title>Meet the Scripting Games Judges: June Blender</title><link>https://powershell.org/articles/2013-04-30-meet-the-scripting-games-judges-june-blender/</link><guid>https://powershell.org/articles/2013-04-30-meet-the-scripting-games-judges-june-blender/</guid><pubDate>Tue, 30 Apr 2013 17:15:20 +0000</pubDate><description>&lt;p&gt;June Blender is was a senior programming writer on the Windows PowerShell team at Microsoft from Windows PowerShell 1.0 &amp;ldquo;“ 3.0. You see her work every time you type Get-Help for the core modules. She&amp;rsquo;s now working on the Windows Azure Active Directory SDK team, and she remains an avid Windows PowerShell user and a passionate user advocate. She&amp;rsquo;s a guest blogger for the Scripting Guys and she tweets Windows PowerShell tips on Twitter at @juneb_get_help.&lt;br&gt;
An engineering type by disposition, June was attracted to Windows PowerShell by the efficiency, productivity, and uniformity of automation. As a full-time working mom of three sons (now adults!), the idea of doing anything twice, unless it&amp;rsquo;s fun, is appalling. When evaluating scripts, she looks for elegance, but prefers scripts that inspire to those that intimidate. If saving a line of code makes your script difficult to understand and maintain, it&amp;rsquo;s not worth it. The scripts that get a thumbs-up from June are those that reveal a new way of performing a task and can be used as a template for scripts to come. Oh, and they must have Help!&lt;br&gt;
June&amp;rsquo;s philosophy about Help is pretty simple. It&amp;rsquo;s supposed to make the task easier &amp;ldquo;“ clear, complete, and accurate. A parameter description that says that ServerName is the name of the server isn&amp;rsquo;t worth the characters you use to type it, but neither is the one that says that a parameter retrieves the modification of the nth cell in the hierarchically rarified data structure. She hates passive voice, too, because you don&amp;rsquo;t know who is supposed to act. About topics are critical. A whole mess of disjointed cmdlet help without an explanation of how they are intended to be used is not really helpful. And the best part of help is the examples. You really can&amp;rsquo;t have too many (see &amp;ldquo;Get-Help Invoke-Command&amp;rdquo;).&lt;br&gt;
Community is the secret sauce in Windows PowerShell, so the best scripts contribute to our shared knowledge, productivity, and fun. June much prefer scripts and functions that you can open, read, and model to compiled anything.&lt;br&gt;
A 16-year veteran of Microsoft, June lives in magnificent Escalante, Utah, where she works remotely when she&amp;rsquo;s not out hiking, canyoneering, taking Coursera classes, or convincing lost tourists to try Windows PowerShell. She believes that outstanding documentation is a collaborative effort, and she welcomes your comments and contributions to Windows PowerShell and Windows Azure Help.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>June Blender is was a senior programming writer on the Windows PowerShell team at Microsoft from Windows PowerShell 1.0 &ldquo;“ 3.0. You see her work every time you type Get-Help for the core modules. She&rsquo;s now working on the Windows Azure Active Directory SDK team, and she remains an avid Windows PowerShell user and a passionate user advocate. She&rsquo;s a guest blogger for the Scripting Guys and she tweets Windows PowerShell tips on Twitter at @juneb_get_help.<br>
An engineering type by disposition, June was attracted to Windows PowerShell by the efficiency, productivity, and uniformity of automation. As a full-time working mom of three sons (now adults!), the idea of doing anything twice, unless it&rsquo;s fun, is appalling. When evaluating scripts, she looks for elegance, but prefers scripts that inspire to those that intimidate. If saving a line of code makes your script difficult to understand and maintain, it&rsquo;s not worth it. The scripts that get a thumbs-up from June are those that reveal a new way of performing a task and can be used as a template for scripts to come. Oh, and they must have Help!<br>
June&rsquo;s philosophy about Help is pretty simple. It&rsquo;s supposed to make the task easier &ldquo;“ clear, complete, and accurate. A parameter description that says that ServerName is the name of the server isn&rsquo;t worth the characters you use to type it, but neither is the one that says that a parameter retrieves the modification of the nth cell in the hierarchically rarified data structure. She hates passive voice, too, because you don&rsquo;t know who is supposed to act. About topics are critical. A whole mess of disjointed cmdlet help without an explanation of how they are intended to be used is not really helpful. And the best part of help is the examples. You really can&rsquo;t have too many (see &ldquo;Get-Help Invoke-Command&rdquo;).<br>
Community is the secret sauce in Windows PowerShell, so the best scripts contribute to our shared knowledge, productivity, and fun. June much prefer scripts and functions that you can open, read, and model to compiled anything.<br>
A 16-year veteran of Microsoft, June lives in magnificent Escalante, Utah, where she works remotely when she&rsquo;s not out hiking, canyoneering, taking Coursera classes, or convincing lost tourists to try Windows PowerShell. She believes that outstanding documentation is a collaborative effort, and she welcomes your comments and contributions to Windows PowerShell and Windows Azure Help.</p>
]]></content:encoded></item><item><title>Event 1: My way…</title><link>https://powershell.org/articles/2013-04-29-event-1-my-way/</link><guid>https://powershell.org/articles/2013-04-29-event-1-my-way/</guid><pubDate>Tue, 30 Apr 2013 06:11:36 +0000</pubDate><description>&lt;p&gt;Looking for not-so-expert solution for Event 1 in both categories? Wonder how one of the judges would do it, if he had a chance? Want to return favor and tell me what I could do better and what I&amp;rsquo;m doing wrong? Don&amp;rsquo;t hesitate. 🙂 I decided it may be helpful to post my solutions before I ever see yours. Please find full article with lots of code on my &lt;a href="http://becomelotr.wordpress.com/2013/04/30/event-1-my-way/"&gt;blog&lt;/a&gt;. If you want to tell me you like/ hate this idea - please don&amp;rsquo;t hesitate either. And now I move on to your work. Can&amp;rsquo;t wait!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Looking for not-so-expert solution for Event 1 in both categories? Wonder how one of the judges would do it, if he had a chance? Want to return favor and tell me what I could do better and what I&rsquo;m doing wrong? Don&rsquo;t hesitate. 🙂 I decided it may be helpful to post my solutions before I ever see yours. Please find full article with lots of code on my<a href="http://becomelotr.wordpress.com/2013/04/30/event-1-my-way/">blog</a>. If you want to tell me you like/ hate this idea - please don&rsquo;t hesitate either. And now I move on to your work. Can&rsquo;t wait!</p>
]]></content:encoded></item><item><title>CIM vs WMI cmdlets-remote execution speed</title><link>https://powershell.org/articles/2013-04-29-cim-vs-wmi-cmdlets-remote-execution-speed/</link><guid>https://powershell.org/articles/2013-04-29-cim-vs-wmi-cmdlets-remote-execution-speed/</guid><pubDate>Mon, 29 Apr 2013 19:08:48 +0000</pubDate><description>&lt;p&gt;Following on from my previous post we&amp;quot;™ll look at how the two types of cmdlets compare for accessing remote machines.&lt;/p&gt;
&lt;p&gt;I used a similar format to the previous tests but was accessing a remote machine.&lt;/p&gt;
&lt;p&gt;First off was the WMI cmdlet &amp;ldquo;“ using DCOM to access the remote Windows 2012 server&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;PS&amp;gt; 1..100 |&lt;br&gt;
foreach {&lt;br&gt;
Measure-Command -Expression{1..100 | foreach {Get-WmiObject -Class Win32_ComputerSystem -ComputerName W12SUS }}&lt;br&gt;
} |&lt;br&gt;
Measure-Object -Average TotalMilliseconds&lt;/strong&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Following on from my previous post we"™ll look at how the two types of cmdlets compare for accessing remote machines.</p><p>I used a similar format to the previous tests but was accessing a remote machine.</p><p>First off was the WMI cmdlet &ldquo;“ using DCOM to access the remote Windows 2012 server</p><p><strong>PS&gt; 1..100 |<br>
foreach {<br>
Measure-Command -Expression{1..100 | foreach {Get-WmiObject -Class Win32_ComputerSystem -ComputerName W12SUS }}<br>
} |<br>
Measure-Object -Average TotalMilliseconds</strong></p><p>Count : 100<br>
Average : 2084.122547<br>
Sum :<br>
Maximum :<br>
Minimum :<br>
Property : TotalMilliseconds</p><p>The CIM cmdlets are similar but apparently a bit slower &ldquo;“ probably due to having to build the WSMAN connection and teat it down each time.</p><p><strong>PS&gt; 1..100 |<br>
foreach {<br>
Measure-Command -Expression{1..100 | foreach {Get-CimInstance -ClassName Win32_ComputerSystem -ComputerName W12SUS }}<br>
} |<br>
Measure-Object -Average TotalMilliseconds</strong></p><p>Count : 100<br>
Average : 2627.287458<br>
Sum :<br>
Maximum :<br>
Minimum :<br>
Property : TotalMilliseconds</p><p>So what happens is you run the CIM command over a CIM session?</p><p><strong>PS&gt; $sess = New-CimSession -ComputerName W12SUS<br>
PS&gt; 1..100 |<br>
foreach {<br>
Measure-Command -Expression{1..100 | foreach {Get-CimInstance -ClassName Win32_ComputerSystem -CimSession $sess }}<br>
} |<br>
Measure-Object -Average TotalMilliseconds</strong></p><p>Count : 100<br>
Average : 877.746649999999<br>
Sum :<br>
Maximum :<br>
Minimum :<br>
Property : TotalMilliseconds</p><p>This removes the setup and tear-down of the WSMAN connection. It suggests that the actual retrieval time for the CIM cmdlets should be reduced to 1749.540808 milliseconds for 100 accesses which is faster than the WMI cmdlets</p><p>It looks like the fastest way to access WMI information is across a CIM session. Next time we&rdquo;™ll look at running multiple commands</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2846/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2846/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2846&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Name that Property</title><link>https://powershell.org/articles/2013-04-29-name-that-property/</link><guid>https://powershell.org/articles/2013-04-29-name-that-property/</guid><pubDate>Mon, 29 Apr 2013 18:47:25 +0000</pubDate><description>&lt;p&gt;Challenge #1 of Scripting Games 2013 is coming to a close. I can&amp;rsquo;t wait to see the results! I solved both the Beginner and Advanced versions just for practice and I learned a lot along the way. They&amp;rsquo;re not easy, but if you haven&amp;rsquo;t yet tried them, go for it. And be sure to review the candidate solutions for new techniques.&lt;br&gt;
In my last post, I showed a very easy way to create a custom object in Windows PowerShell 3.0 and I argued that returning a custom object is far better than returning formatted objects. But, when you are formatting or selecting properties from an existing object, you can customize the names of the properties and their values. This techique isn&amp;rsquo;t new to Windows PowerShell 3.0 &amp;ldquo;“ it works in all versions &amp;ndash; but it&amp;rsquo;s really handy, and I&amp;rsquo;ve noticed that not a lot of people use it.&lt;br&gt;
Let&amp;rsquo;s start by changing the name of a table column. In this case, the big boss wants a list of files and their attributes. Get-ChildItem (&amp;ldquo;dir&amp;rdquo;) just about does it, but the property name is &amp;ldquo;Mode,&amp;rdquo; not &amp;ldquo;Atrributes,&amp;rdquo; and the big boss is a picky dude.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Challenge #1 of Scripting Games 2013 is coming to a close. I can&rsquo;t wait to see the results! I solved both the Beginner and Advanced versions just for practice and I learned a lot along the way. They&rsquo;re not easy, but if you haven&rsquo;t yet tried them, go for it. And be sure to review the candidate solutions for new techniques.<br>
In my last post, I showed a very easy way to create a custom object in Windows PowerShell 3.0 and I argued that returning a custom object is far better than returning formatted objects. But, when you are formatting or selecting properties from an existing object, you can customize the names of the properties and their values. This techique isn&rsquo;t new to Windows PowerShell 3.0 &ldquo;“ it works in all versions &ndash; but it&rsquo;s really handy, and I&rsquo;ve noticed that not a lot of people use it.<br>
Let&rsquo;s start by changing the name of a table column. In this case, the big boss wants a list of files and their attributes. Get-ChildItem (&ldquo;dir&rdquo;) just about does it, but the property name is &ldquo;Mode,&rdquo; not &ldquo;Atrributes,&rdquo; and the big boss is a picky dude.</p><p>`PS C:\ Get-ChildItem
Directory: C:<br>
Mode LastWriteTime Length Name</p><hr><p>d&mdash;- 10/9/2012 1:05 PM 2008
d&mdash;- 10/9/2012 1:05 PM 2009
d&mdash;- 10/9/2012 1:05 PM AssemblyTest
d&mdash;- 10/9/2012 1:05 PM CabTest
d&mdash;- 10/24/2012 1:27 PM Snippets
-ar&ndash; 3/7/2011 6:50 AM 0 ApplicationError.txt
-ar&ndash; 11/19/2010 2:42 PM 274 archive-Projects.ps1
-a&ndash; 12/13/2010 11:18 AM 3052 Backup-Files.ps1
-a&ndash; 3/2/2011 7:42 PM 312 Check-Examples.ps1
-a&ndash; 9/29/2010 6:57 AM 728 Compare-ParameterSets.ps1
-ar&ndash; 10/24/2012 12:44 PM 1146 Compare-UpdatableHelpVersion.ps1
`Quick fix! Change the name of the Mode property to Attributes.</p><p><code>Get-ChildItem | Select-Object @{Name="Attributes";Expression={$_.Mode}},</code>
LastWriteTime, Name
Directory: C:<br>
Attributes LastWriteTime Name</p><hr><p>d&mdash;- 10/9/2012 1:05 PM 2008
d&mdash;- 10/9/2012 1:05 PM 2009
d&mdash;- 10/9/2012 1:05 PM AssemblyTest
d&mdash;- 10/9/2012 1:05 PM CabTest
d&mdash;- 10/24/2012 1:27 PM Snippets
-ar&ndash; 3/7/2011 6:50 AM ApplicationError.txt
-ar&ndash; 11/19/2010 2:42 PM archive-Projects.ps1
-a&ndash; 12/13/2010 11:18 AM Backup-Files.ps1
-a&ndash; 3/2/2011 7:42 PM Check-Examples.ps1
-a&ndash; 9/29/2010 6:57 AM Compare-ParameterSets.ps1
-ar&ndash; 10/24/2012 12:44 PM Compare-UpdatableHelpVersion.ps1
`Note: I omitted the Length property here so the table is easier to display, but you can add it back if you&rsquo;d like.<br>
This value is called a<em>calculated property</em>. You can use calculated properties in Select-Object, Format-Table, and Format-List commands, and in commands that use other cmdlets where it&rsquo;s noted in the help topic.<br>
A<em>calculated property</em> is a hash table (@{Name=Value; Name=Value&rdquo;¦} ). The first key is either<strong>Name</strong> or<strong>Label</strong> and the second key is<strong>Expression</strong>. The value of the<strong>Name</strong> (or<strong>Label</strong>) key is the name that you want to assign to the property. The value of the<strong>Expression</strong> key is a script block (inside braces) that gets the property value.<br>
In this case, I just want to rename the &ldquo;Mode&rdquo; property to &ldquo;Attributes,&rdquo; so the value of the <strong>Name</strong> key is &ldquo;Attributes&rdquo; and the value of the<strong>Expression</strong> key is a tiny script block that gets the value of the Mode property of each object that is passed to it.</p><p><code>@{Name = "Attributes"; Expression = {$_.Mode}}</code>Just for practice, let&rsquo;s rename &ldquo;LastWriteTime&rdquo; to &ldquo;Updated.&rdquo;</p><p><code>@{Name = "Updated"; Expression = {$_.LastWriteTime}}</code>Now, you can use the calculated property in a Select-Object, Format-Table, or Format-List command. Put it where you usually put the property name.</p><p><code>Get-ChildItem | Select-Object @{Name = "Attributes"; Expression = {$_.Mode}},</code>
@{Name = &ldquo;Updated&rdquo;; Expression = {$_.LastWriteTime}}, Name
Directory: C:<br>
Attributes Updated Name</p><hr><p>d&mdash;- 10/9/2012 1:05 PM 2008
d&mdash;- 10/9/2012 1:05 PM 2009
d&mdash;- 10/9/2012 1:05 PM AssemblyTest
d&mdash;- 10/9/2012 1:05 PM CabTest
d&mdash;- 10/24/2012 1:27 PM Snippets
-ar&ndash; 3/7/2011 6:50 AM ApplicationError.txt
-ar&ndash; 11/19/2010 2:42 PM archive-Projects.ps1
-a&ndash; 12/13/2010 11:18 AM Backup-Files.ps1
-a&ndash; 3/2/2011 7:42 PM Check-Examples.ps1
-a&ndash; 9/29/2010 6:57 AM Compare-ParameterSets.ps1
-ar&ndash; 10/24/2012 12:44 PM Compare-UpdatableHelpVersion.ps1
`After you&rsquo;ve played with this for a while, try changing the value of the <strong>Expression</strong> key so that it gets exactly the value that you need instead of the default property value.<br>
What if the big boss wants that Updated (LastWriteTime) value in Coordinated Universal Time (UTC)? No problem! Just change the expression to call the ToUniversalTime method of DateTime objects. And while we&rsquo;re perfecting, let&rsquo;s change the property name to better describe its new value.<br>
Here&rsquo;s the calculated property:</p><p><code>@{Name = "Updated_UTC";Expression={$_.LastWriteTime.ToUniversalTime()}}</code>And here it is in a command:</p><p>`PS C:\ Get-ChildItem | Select-Object @{Name = &ldquo;Attributes&rdquo;; Expression = {$<em>.Mode}},
@{Name = &ldquo;Updated_UTC&rdquo;; Expression = {$</em>.LastWriteTime.ToUniversalTime()}}, Name
Attributes Updated_UTC Name</p><hr><p>d&mdash;- 10/9/2012 8:05:46 PM 2008
d&mdash;- 10/9/2012 8:05:46 PM 2009
d&mdash;- 10/9/2012 8:05:46 PM AssemblyTest
d&mdash;- 10/9/2012 8:05:46 PM CabTest
d&mdash;- 10/24/2012 8:27:30 PM Snippets
-ar&ndash; 3/7/2011 2:50:08 PM ApplicationError.txt
-ar&ndash; 11/19/2010 10:42:33 PM archive-Projects.ps1
-a&mdash; 12/13/2010 7:18:18 PM Backup-Files.ps1
-a&mdash; 3/3/2011 3:42:02 AM Check-Examples.ps1
-a&mdash; 9/29/2010 1:57:27 PM Compare-ParameterSets.ps1
-ar&ndash; 10/24/2012 7:44:49 PM Compare-UpdatableHelpVersion.ps1
`I find this technique to be really handy and I hope you do, too. Just don&rsquo;t get caught up in syntax errors. Remember that a calculated property ends in<em><strong>two braces</strong></em>; one to end the expression script block and the other to end the hash table.</p>
]]></content:encoded></item><item><title>AD Management in a Month of Lunches"“ chapter 9 in MEAP</title><link>https://powershell.org/articles/2013-04-29-ad-management-in-a-month-of-lunches-chapter-9-in-meap/</link><guid>https://powershell.org/articles/2013-04-29-ad-management-in-a-month-of-lunches-chapter-9-in-meap/</guid><pubDate>Mon, 29 Apr 2013 18:23:15 +0000</pubDate><description>&lt;p&gt;The MEAP for AD Management in a Month of Lunches has been updated with the release of chapter 9 on managing group policies&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2844/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2844/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2844&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>The MEAP for AD Management in a Month of Lunches has been updated with the release of chapter 9 on managing group policies</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2844/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2844/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2844&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>State of the Games</title><link>https://powershell.org/articles/2013-04-29-state-of-the-games/</link><guid>https://powershell.org/articles/2013-04-29-state-of-the-games/</guid><pubDate>Mon, 29 Apr 2013 15:10:48 +0000</pubDate><description>&lt;p&gt;As of Monday at 5pm Pacific time (which is Tuesday morning, 00:00 hours GMT), the 2013 Scripting Games&amp;rsquo; first event will conclude. That means the first event is open for community voting - &lt;a href="http://scriptinggames.org/"&gt;so get on it!&lt;/a&gt;&lt;br&gt;
Remember, some of the best prizes - including a free pass to the 2014 PowerShell Summit - are reserved for folks who offer their votes and comments.&lt;br&gt;
Incoming new registrations for the Games will not be able to compete in Event 1 at this point, but they can jump in with Event 2 (and subsequent events) if desired.&lt;br&gt;
We presently have 1100 registered participants - which may include people who just signed up to spectate and vote, as well as our judges. 475 are registered in the Beginner track, 307 in Advanced, and 318 are presently view-only (meaning they&amp;rsquo;re just voting, not submitting entries). As I write this, we&amp;rsquo;ve only got 218 entries - but there are still a few more hours to get them in.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>As of Monday at 5pm Pacific time (which is Tuesday morning, 00:00 hours GMT), the 2013 Scripting Games&rsquo; first event will conclude. That means the first event is open for community voting -<a href="http://scriptinggames.org/">so get on it!</a><br>
Remember, some of the best prizes - including a free pass to the 2014 PowerShell Summit - are reserved for folks who offer their votes and comments.<br>
Incoming new registrations for the Games will not be able to compete in Event 1 at this point, but they can jump in with Event 2 (and subsequent events) if desired.<br>
We presently have 1100 registered participants - which may include people who just signed up to spectate and vote, as well as our judges. 475 are registered in the Beginner track, 307 in Advanced, and 318 are presently view-only (meaning they&rsquo;re just voting, not submitting entries). As I write this, we&rsquo;ve only got 218 entries - but there are still a few more hours to get them in.</p>
]]></content:encoded></item><item><title>Comparing SQL Server table schemas with PowerShell</title><link>https://powershell.org/articles/2013-04-28-comparing-sql-server-table-schemas-with-powershell/</link><guid>https://powershell.org/articles/2013-04-28-comparing-sql-server-table-schemas-with-powershell/</guid><pubDate>Sun, 28 Apr 2013 22:44:17 +0000</pubDate><description>&lt;p&gt;As a SQL Server DBA or SQL Server developer sometimes is necessary to know whether two tables have equal schemas or not. For example, a few months ago I had to consolidate two SQL Server instances in just one. One of the main problems were the collisions between Databases and Tables. I found out that both instances had Databases with equal name and the same thing happened with tables inside those databases. When consolidating databases is very important to make sure that users and apps will find the same schema they were used to find before consolidation, so in order to consolidate databases it will be necessary to find tables with different schemas, merge them and solve conflicts.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>As a SQL Server DBA or SQL Server developer sometimes is necessary to know whether two tables have equal schemas or not. For example, a few months ago I had to consolidate two SQL Server instances in just one. One of the main problems were the collisions between Databases and Tables. I found out that both instances had Databases with equal name and the same thing happened with tables inside those databases. When consolidating databases is very important to make sure that users and apps will find the same schema they were used to find before consolidation, so in order to consolidate databases it will be necessary to find tables with different schemas, merge them and solve conflicts.</p><p>SQL Server provides a tool to compare schemas between databases, the tool comes with visual Studio or SQL Server Data tools with Database Projects. That could be very useful to identify schema differences among objects from both databases and see what tables have to be merged. So that"™s it, if we have a tool that provides us that functionality, why do we need PowerShell? The answer to this question is quite surprising, it happens that the tool compares schemas based on the T-SQL Code, which means that the comparison is made by using Strings. Let"™s see an example to introduce the issue.</p><p>If we create in SQL Server two databases with one table per database as it is showed in the following script:</p><h2 id="-databases-demo-creation" class="ps-heading">`&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&ndash;
&ndash; Enrique Puig
&ndash;<a href="mailto:epuig1984@gmail.com">epuig1984@gmail.com</a>
&ndash; Databases Demo creation<a class="ps-heading-anchor" href="#-databases-demo-creation" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>&ndash;Database1</p><p>create database
TableCompare
;</p><p>alter database
TableCompare
set recovery simple</p><p>;</p><p>use
TableCompare
;</p><p>create table
dbo
.
TestTable</p><p>(</p><p>id
int identity</p><p>(
1
,
1
)</p><p>primary key</p><p>,</p><p>col1
int</p><p>not null,</p><p>col2
int</p><p>not null,</p><p>col3
int</p><p>not null
);</p><p>&ndash;Database2</p><p>create database
TableCompare2
;</p><p>alter database
TableCompare2
set recovery simple</p><p>;</p><p>use
TableCompare2
;</p><p>create table
dbo
.
TestTable</p><p>(</p><p>id
int identity</p><p>(
1
,
1
),</p><p>col1
int</p><p>not null,</p><p>col2
int</p><p>not null,</p><p>col3
int</p><p>not null
);</p><p>&ndash;create primary key</p><p>alter table
dbo
.
TestTable</p><p>add constraint
PK_TestTable
primary key</p><p>(
id
);</p><p>`The databases and tables look like follows:</p><p><a href="https://powershell.org/wp-content/uploads/2013/04/clip_image002.jpg"><img src="https://powershell.org/wp-content/uploads/2013/04/clip_image002_thumb.jpg" alt="clip_image002"/></p><p>Figure 1-Database comparison-</p><p>As it is showed in Figure 1, both Tables look exactly the same, they have:</p><ul><li/></ul><pre><code> - Equal Name</code></pre><ul><li/></ul><pre><code> - Equal number of columns</code></pre><ul><li/></ul><pre><code> - Equal name of columns</code></pre><ul><li/></ul><pre><code> - Equal number of keys</code></pre><ul><li/></ul><pre><code> - Equal columns in every key</code></pre><p>The only different thing is the name of the key, because for the first table was created automatically and in the second one it was created manually specifying a name. Does it really matter? In this case the name of the key is not relevant as long as the columns are the same. Well, if we compare it with Visual Studio 2012 we get the following results:</p><p><a href="https://powershell.org/wp-content/uploads/2013/04/clip_image004.jpg"><img src="https://powershell.org/wp-content/uploads/2013/04/clip_image004_thumb.jpg" alt="clip_image004"/></p><p>Figure 2- Database Comparison-</p><p>The figure 2 shows the result. According to the result the tables are not equals because of a name. This is not the logic intended for us, because when we want to consolidate tables the only thing that matters is that the table will have a primary key clustered by Id column, the name does not make a difference. So this method is going to show us<strong>a lot of false positives</strong> when looking for tables with different schemas. The same thing happens with some third party tools, I"™ve tried to compare objects with them and got the same result. For this example we are working with one database and only one table per database for a better understanding of the issue, but imagine when you are working with 100 database and an average of 70 or 80 tables per database, you need to make sure that you are no getting false positives identifying tables with different schemas. So here is when PowerShell comes up to save the day.</p><p>Using SMO we are able to create a function to compare schemas. The function looks like follows:</p><p>`#################################################################</p><h2 id="enrique-puig-nouselles" class="ps-heading">Enrique Puig Nouselles<a class="ps-heading-anchor" href="#enrique-puig-nouselles" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><h2 id="" class="ps-heading"><a href="mailto:Epuig1984@gmail.com">Epuig1984@gmail.com</a><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><h2 id="compare-sql-server-table-schemas" class="ps-heading">Compare SQL Server Table schemas<a class="ps-heading-anchor" href="#compare-sql-server-table-schemas" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>#################################################################</p><p>function</p><p>Compare-SQLServerTables</p><p>(</p><p>[</p><p>string</p><p>]</p><p>$srv1</p><p>,[</p><p>string</p><p>]</p><p>$bd1</p><p>,[</p><p>string</p><p>]</p><p>$sch1</p><p>,[</p><p>string</p><p>]</p><p>$TableName1</p><p>,
[</p><p>string</p><p>]</p><p>$srv2</p><p>,[</p><p>string</p><p>]</p><p>$bd2</p><p>,[</p><p>string</p><p>]</p><p>$sch2</p><p>,[</p><p>string</p><p>]</p><p>$TableName2</p><p>)
{</p><p>[</p><p>reflection.assembly</p><p>]::
LoadWithPartialName(
&ldquo;Microsoft.SqlServer.Smo&rdquo;
)
|</p><p>Out-Null</p><p>$S1</p><p>=</p><p>New-Object</p><p>&ldquo;Microsoft.SqlServer.Management.Smo.Server&rdquo;</p><p>$srv1</p><p>if
(
$S1</p><p>-ne</p><p>$null
)
{</p><p>if
(
$S1</p><p>.
databases
[</p><p>$bd1</p><p>] -ne</p><p>$null
)
{</p><p>$tab1</p><p>=</p><p>$S1</p><p>.
databases
[</p><p>$bd1</p><p>].
Tables
[</p><p>$TableName1</p><p>]</p><p>$res</p><p>=</p><p>$tab1</p><p>|</p><p>Where-Object
{
$_</p><p>.
Schema
-eq</p><p>$sch1
}</p><p>if
(
$res</p><p>.
Count
-eq</p><p>)
{</p><p>throw</p><p>&ldquo;Error: The schema</p><p>$sch1</p><p>doesn&rsquo;t contain any table called</p><p>$TableName1</p><p>.&rdquo;</p><p>}
}</p><p>else</p><p>{</p><p>throw</p><p>&ldquo;Error: The database '</p><p>$bd1</p><p>&rsquo; doesn&rsquo;t exist.&rdquo;</p><p>}
}</p><p>else</p><p>{</p><p>throw</p><p>&ldquo;Error: We couldn&rsquo;t connect to the server '</p><p>$srv1</p><p>&lsquo;. Please check your credentials and the servername&rdquo;</p><p>}</p><p>$S2</p><p>=</p><p>New-Object</p><p>&ldquo;Microsoft.SqlServer.Management.Smo.Server&rdquo;</p><p>$srv2</p><p>if
(
$S2</p><p>-ne</p><p>$null
)
{</p><p>if
(
$S2</p><p>.
databases
[</p><p>$bd2</p><p>] -ne</p><p>$null
)
{</p><p>$tab2</p><p>=</p><p>$S2</p><p>.
databases
[</p><p>$bd2</p><p>].
Tables
[</p><p>$TableName2</p><p>]</p><p>$res</p><p>=</p><p>$tab2</p><p>|</p><p>Where-Object
{
$_</p><p>.
Schema
-eq</p><p>$sch2
}</p><p>if
(
$res</p><p>.
Count
-eq</p><p>)
{</p><p>throw</p><p>&ldquo;Error: The schema</p><p>$sch2</p><p>doesn&rsquo;t contain any table called</p><p>$TableName2</p><p>.&rdquo;</p><p>}
}</p><p>else</p><p>{</p><p>throw</p><p>&ldquo;Error: The database '</p><p>$bd2</p><p>&rsquo; doesn&rsquo;t exist.&rdquo;</p><p>}
}</p><p>else</p><p>{</p><p>throw</p><p>&ldquo;Error: We couldn&rsquo;t connect to the server '</p><p>$srv1</p><p>&lsquo;. Please check your credentials and the servername&rdquo;</p><p>}</p><p>##check columns</p><p>$ncols1</p><p>=</p><p>$tab1</p><p>.
Columns
.
Count</p><p>$ncols2</p><p>=</p><p>$tab2</p><p>.
Columns
.
Count</p><p>$eqCols</p><p>=</p><p>$true
$eqChecks</p><p>=</p><p>$true
$eqIndexes</p><p>=</p><p>$true
$resultCompare</p><p>=</p><p>$true</p><p>if
(
$ncols1</p><p>-ne</p><p>$ncols2
)
{</p><p>return</p><p>$false
;
}</p><p>[</p><p>Array</p><p>]</p><p>$colList</p><p>=
@()</p><p>##check data types, nullable columns,computed columns, identity columns, persisted columns, cols with default
## rimary keys and foreign keys</p><p>$tab1</p><p>.
Columns
|</p><p>ForEach-Object
{</p><p>$c1</p><p>=</p><p>$_
$aux</p><p>=</p><p>$tab2</p><p>.
Columns
|</p><p>Where-Object
{</p><p>$_</p><p>.
Name
-eq</p><p>$c1</p><p>.
Name
-and</p><p>$c1</p><p>.
DataType
-eq</p><p>$_</p><p>.
DataType
-and</p><p>$c1</p><p>.
Nullable
-eq</p><p>$_</p><p>.
Nullable
-and</p><p>$c1</p><p>.
Identity
-eq</p><p>$_</p><p>.
Identity
-and</p><p>$c1</p><p>.
IdentitySeed
-eq</p><p>$_</p><p>.
IdentitySeed
-and</p><p>$c1</p><p>.
Computed
-eq</p><p>$_</p><p>.
Computed
-and</p><p>$c1</p><p>.
ComputedText
-eq</p><p>$_</p><p>.
ComputedText
-and</p><p>$c1</p><p>.
DefaultConstraint
.
Text
-eq</p><p>$_</p><p>.
DefaultConstraint
.
Text
-and</p><p>$c1</p><p>.
InPrimaryKey
-eq</p><p>$_</p><p>.
InPrimaryKey
-and</p><p>$c1</p><p>.
IsPersisted
-eq</p><p>$_</p><p>.
IsPersisted
-and</p><p>$c1</p><p>.
IsForeignKey
-eq</p><p>$_</p><p>.
IsForeignKey
}</p><p>if
(
$aux</p><p>-eq</p><p>$null
)
{</p><p>$eqCols</p><p>=</p><p>$false</p><p>return
;
}
}</p><p>#check the other way to make sure that are completely equal tables</p><p>if
(
$eqCols
)
{</p><p>$tab2</p><p>.
Columns
|</p><p>ForEach-Object
{</p><p>$c1</p><p>=</p><p>$_
$aux</p><p>=</p><p>$tab1</p><p>.
Columns
|</p><p>Where-Object
{</p><p>$_</p><p>.
Name
-eq</p><p>$c1</p><p>.
Name
-and</p><p>$c1</p><p>.
DataType
-eq</p><p>$_</p><p>.
DataType
-and</p><p>$c1</p><p>.
Nullable
-eq</p><p>$_</p><p>.
Nullable
-and</p><p>$c1</p><p>.
Identity
-eq</p><p>$_</p><p>.
Identity
-and</p><p>$c1</p><p>.
IdentitySeed
-eq</p><p>$_</p><p>.
IdentitySeed
-and</p><p>$c1</p><p>.
Computed
-eq</p><p>$_</p><p>.
Computed
-and</p><p>$c1</p><p>.
ComputedText
-eq</p><p>$_</p><p>.
ComputedText
-and</p><p>$c1</p><p>.
DefaultConstraint
.
Text
-eq</p><p>$_</p><p>.
DefaultConstraint
.
Text
-and</p><p>$c1</p><p>.
InPrimaryKey
-eq</p><p>$_</p><p>.
InPrimaryKey
-and</p><p>$c1</p><p>.
IsPersisted
-eq</p><p>$_</p><p>.
IsPersisted
}</p><p>if
(
$aux</p><p>-eq</p><p>$null
)
{</p><p>$eqCols</p><p>=</p><p>$false</p><p>return
;
}
}
}</p><p>##check constraints
##we cannot create 2 constraints with the same name at the same database</p><p>$tab1</p><p>.
Checks
|</p><p>ForEach-Object
{</p><p>$tab2</p><p>.
Columns
|</p><p>ForEach-Object
{</p><p>$chk1</p><p>=</p><p>$_
$checks</p><p>=</p><p>$tab2</p><p>.
Checks
|</p><p>Where-Object
{
$chk1</p><p>.
Text
-eq</p><p>$_</p><p>.
Text
-and</p><p>$chk1</p><p>.
IsEnabled
-eq</p><p>$_</p><p>.
IsEnabled}</p><p>if
(
$checks</p><p>-eq</p><p>$null</p><p>-or</p><p>$checks</p><p>.
Count
-eq</p><p>)
{</p><p>$eqChecks</p><p>=</p><p>$false</p><p>return
;
}
}
}</p><p>##check it out in the other way</p><p>if
(
$eqChecks
)
{</p><p>$tab2</p><p>.
Checks
|</p><p>ForEach-Object
{</p><p>Write-Host</p><p>&ldquo;hola que ase&rdquo;</p><p>$chk1</p><p>=</p><p>$_
$checks</p><p>=</p><p>$tab1</p><p>.
Checks
|</p><p>Where-Object
{
$chk1</p><p>.
Text
-eq</p><p>$_</p><p>.
Text
-and</p><p>$chk1</p><p>.
IsEnabled
-eq</p><p>$_</p><p>.
IsEnabled}</p><p>if
(
$checks</p><p>-eq</p><p>$null</p><p>-or</p><p>$checks</p><p>.
Count
-eq</p><p>)
{</p><p>$eqChecks</p><p>=</p><p>$false</p><p>return
;
}
}
}</p><p>##Indexes section</p><p>[</p><p>Array</p><p>]</p><p>$indexes1</p><p>=
@()</p><p>[</p><p>Array</p><p>]</p><p>$cols</p><p>=
@()</p><p>##check indexes</p><p>$tab1</p><p>.
Indexes
|</p><p>ForEach-Object
{</p><p>$ix1</p><p>=</p><p>$_</p><pre><code> #check index type and properties</code></pre><p>$ix</p><p>=</p><p>$tab2</p><p>.
Indexes
|</p><p>Where-Object
{</p><p>$ix1</p><p>.
IsClustered
-eq</p><p>$_</p><p>.
IsClustered
-and</p><p>$ix1</p><p>.
HasFilter
-eq</p><p>$_</p><p>.
HasFilter
-and</p><p>$ix1</p><p>.
IgnoreDuplicateKeys
-eq</p><p>$_</p><p>.
IgnoreDuplicateKeys
-and</p><p>$ix1</p><p>.
IndexedColumns
.
Count
-eq</p><p>$_</p><p>.
IndexedColumns
.
Count
-and</p><p>$ix1</p><p>.
IsIndexOnComputed
-eq</p><p>$_</p><p>.
IsIndexOnComputed
-and</p><p>$ix1</p><p>.
IsPartitioned
-eq</p><p>$_</p><p>.
IsPartitioned
-and</p><p>$ix1</p><p>.
IsSpatialIndex
-eq</p><p>$_</p><p>.
IsSpatialIndex
-and</p><p>$ix1</p><p>.
IsUnique
-eq</p><p>$_</p><p>.
IsUnique
-and</p><p>$ix1</p><p>.
IsXmlIndex
-eq</p><p>$_</p><p>.
IsXmlIndex
}</p><p>if
(
$ix</p><p>-eq</p><p>$null</p><p>-or</p><p>$ix</p><p>.
Count
-eq</p><p>)
{</p><p>$eqIndexes</p><p>=</p><p>$false</p><p>return
;
}</p><p>else</p><p>{</p><p>##check index column names</p><p>$ix1</p><p>.
IndexedColumns
|</p><p>ForEach-Object
{</p><p>$col1</p><p>=</p><p>$_</p><p>#Get all indexed columns</p><p>$cols</p><p>=</p><p>$ix</p><p>.
IndexedColumns
|</p><p>Where-Object
{</p><p>$col1</p><p>.
Name
-eq</p><p>$_</p><p>.
Name
}</p><p>if
(
$cols</p><p>-eq</p><p>$null</p><p>-or</p><p>$cols</p><p>.
Count
-eq</p><p>)
{</p><p>$eqIndexes</p><p>=</p><p>$false</p><p>return
;
}
}
}
}</p><p>if
(
$eqIndexes
)
{</p><p>$tab2</p><p>.
Indexes
|</p><p>ForEach-Object
{</p><p>$ix1</p><p>=</p><p>$_</p><p>#check index type and properties</p><p>$ix</p><p>=</p><p>$tab1</p><p>.
Indexes
|</p><p>Where-Object
{</p><p>$ix1</p><p>.
IsClustered
-eq</p><p>$_</p><p>.
IsClustered
-and</p><p>$ix1</p><p>.
HasFilter
-eq</p><p>$_</p><p>.
HasFilter
-and</p><p>$ix1</p><p>.
IgnoreDuplicateKeys
-eq</p><p>$_</p><p>.
IgnoreDuplicateKeys
-and</p><p>$ix1</p><p>.
IndexedColumns
.
Count
-eq</p><p>$_</p><p>.
IndexedColumns
.
Count
-and</p><p>$ix1</p><p>.
IsIndexOnComputed
-eq</p><p>$_</p><p>.
IsIndexOnComputed
-and</p><p>$ix1</p><p>.
IsPartitioned
-eq</p><p>$_</p><p>.
IsPartitioned
-and</p><p>$ix1</p><p>.
IsSpatialIndex
-eq</p><p>$_</p><p>.
IsSpatialIndex
-and</p><p>$ix1</p><p>.
IsUnique
-eq</p><p>$_</p><p>.
IsUnique
-and</p><p>$ix1</p><p>.
IsXmlIndex
-eq</p><p>$_</p><p>.
IsXmlIndex
}</p><p>if
(
$ix</p><p>-eq</p><p>$null</p><p>-or</p><p>$ix</p><p>.
Count
-eq</p><p>)
{</p><p>$eqIndexes</p><p>=</p><p>$false</p><p>return
;
}</p><p>else</p><p>{</p><p>##check index column names</p><p>$ix1</p><p>.
IndexedColumns
|</p><p>ForEach-Object
{</p><p>$col1</p><p>=</p><p>$_
$cols</p><p>=</p><p>$ix</p><p>.
IndexedColumns
|</p><p>Where-Object
{</p><p>$col1</p><p>.
Name
-eq</p><p>$_</p><p>.
Name
}</p><p>if
(
$cols</p><p>-eq</p><p>$null</p><p>-or</p><p>$cols</p><p>.
Count
-eq</p><p>)
{</p><p>$eqIndexes</p><p>=</p><p>$false</p><p>return
;
}
}
}
}
}</p><p>if
(
$eqCols</p><p>-eq</p><p>$false</p><p>-or</p><p>$eqChecks</p><p>-eq</p><p>$false</p><p>-or</p><p>$eqIndexes</p><p>-eq</p><p>$false
)
{</p><p>$resultCompare</p><p>=</p><p>$false</p><p>}</p><p>return</p><p>$resultCompare</p><p>}
`<a href="http://11011.net/software/vspaste"/></p><p>This is a personalized function and three main blocks are checked in order to determine whether two tables have the same schema or not:</p><ol><li><p><strong>Columns</strong>: In this section we check the number of columns, the name of the columns, the data types for every column, if is part of a primary key, if is part of a foreign key, if is a computed column and so on.</p></li><li><p><strong>Checks</strong>: In this section all checks defined in a table are compared. As we explained before, the name doesn"™t matter, the only thing that matters is the check definition text and the columns involved.</p></li><li><p><strong>Indexes:</strong> In this sections all the indexes are compared. The index name doesn"™t make a difference, we only check for index type, columns and so on.</p></li></ol><p>In order to test this PowerShell function we will run a main program to test it:</p><p>`#main program
##Define Variables</p><p>$srv1</p><p>=</p><p>&ldquo;(local)\SQLDWH&rdquo;</p><p>$srv2</p><p>=</p><p>&ldquo;(local)\SQLDWH&rdquo;</p><p>$bd1</p><p>=</p><p>&ldquo;TableCompare&rdquo;</p><p>$bd2</p><p>=</p><p>&ldquo;TableCompare2&rdquo;</p><p>$sch1</p><p>=</p><p>&ldquo;dbo&rdquo;</p><p>$sch2</p><p>=</p><p>&ldquo;dbo&rdquo;</p><p>$TableName1</p><p>=</p><p>&ldquo;TestTable&rdquo;</p><p>$TableName2</p><p>=</p><p>&ldquo;TestTable&rdquo;</p><p>#function call</p><p>Compare-SQLServerTables</p><p>$srv1 $bd1 $sch1 $TableName1 $srv2 $bd2 $sch2 $TableName2</p><p>`<a href="http://11011.net/software/vspaste"/></p><p>The result that we get by running the main program is:</p><p><a href="https://powershell.org/wp-content/uploads/2013/04/clip_image005.png"><img src="https://powershell.org/wp-content/uploads/2013/04/clip_image005_thumb.png" alt="clip_image005"/></p><p>Figure 3-Execution result-</p><p>Now we are getting<strong>True</strong> as a result, which means that both tables are equals in terms of schema. If we change the schema of one of the test tables we will get a different result. Let"™s say we change the primary for one of the tables:</p><p>`&ndash;alter table</p><p>use
TableCompare2
;</p><p>alter table
TestTable</p><p>drop constraint
PK_TestTable
;</p><p>alter table
TestTable</p><p>add constraint
PK_TestTable
primary key</p><p>(
id
,
col1
);</p><p>`Now the table schemas look like follows:</p><p><a href="https://powershell.org/wp-content/uploads/2013/04/clip_image007.jpg"><img src="https://powershell.org/wp-content/uploads/2013/04/clip_image007_thumb.jpg" alt="clip_image007"/></p><p>Figure 4- New Table schemas-</p><p>The schemas have changed as it is showed in Figure 4. The primary key of the table TestTabe in TableCompare2 Database has two keys instead of one. If we execute again our function the result is:</p><p><a href="https://powershell.org/wp-content/uploads/2013/04/clip_image009.jpg"><img src="https://powershell.org/wp-content/uploads/2013/04/clip_image009_thumb.jpg" alt="clip_image009"/></p><p>Figure 5- Result with different schemas-</p><p>Now we get<strong>False</strong> because the schemas are different, so our function is working as intended. As you can see, once again PowerShell shows us its power and allows us to solve a problem easily.</p><p><strong>Note</strong>: Is very important to remark that this function<strong>only compares Columns, Checks and indexes</strong>. The main reason is because the function was created to solve a given problem but it could be extended to compare more object types like triggers, users and so on.</p>
]]></content:encoded></item><item><title>CIM cmdlets vs WMI cmdlets"“speed of execution</title><link>https://powershell.org/articles/2013-04-28-cim-cmdlets-vs-wmi-cmdlets-speed-of-execution/</link><guid>https://powershell.org/articles/2013-04-28-cim-cmdlets-vs-wmi-cmdlets-speed-of-execution/</guid><pubDate>Sun, 28 Apr 2013 21:04:47 +0000</pubDate><description>&lt;p&gt;One question that came up at the summit was the comparative speed of execution of the new CIM cmdlets vs the old WMI cmdlets. No of us knew the answer because we&amp;quot;™d never tried measuring the speed.&lt;/p&gt;
&lt;p&gt;I decided to perform some tests.&lt;/p&gt;
&lt;p&gt;This first test is accessing the local machine. In both cases the cmdlets are using COM. WMI uses COM and CIM will use COM if a &amp;ldquo;“ComputerName parameter isn&amp;rdquo;™t used.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>One question that came up at the summit was the comparative speed of execution of the new CIM cmdlets vs the old WMI cmdlets. No of us knew the answer because we"™d never tried measuring the speed.</p><p>I decided to perform some tests.</p><p>This first test is accessing the local machine. In both cases the cmdlets are using COM. WMI uses COM and CIM will use COM if a &ldquo;“ComputerName parameter isn&rdquo;™t used.</p><p>The results are as follows:</p><p><strong>PS&gt; 1..100 |<br>
foreach {Measure-Command -Expression {<br>
1..100 | foreach {Get-WmiObject -Class Win32_ComputerSystem} }<br>
} | Measure-Object -Average TotalMilliseconds</strong></p><p>Count : 100<br>
Average : 2008.953978<br>
Sum :<br>
Maximum :<br>
Minimum :<br>
Property : TotalMilliseconds</p><p><strong>PS&gt; 1..100 |<br>
foreach {Measure-Command -Expression {<br>
1..100 | foreach {Get-CimInstance -ClassName Win32_ComputerSystem} }<br>
} | Measure-Object -Average TotalMilliseconds</strong></p><p>Count : 100<br>
Average : 2078.763174<br>
Sum :<br>
Maximum :<br>
Minimum :<br>
Property : TotalMilliseconds</p><p>So for pure COM access the WMI cmdlets are marginally (3.4%) faster.</p><p>What if we use the ComputerName parameter?</p><p><strong>PS&gt; 1..100 |<br>
foreach {<br>
Measure-Command -Expression {<br>
1..100 | foreach {Get-WmiObject -Class Win32_ComputerSystem -ComputerName $env:COMPUTERNAME } }<br>
} | Measure-Object -Average TotalMilliseconds</strong></p><p>Count : 100<br>
Average : 1499.14379<br>
Sum :<br>
Maximum :<br>
Minimum :<br>
Property : TotalMilliseconds</p><p><strong>PS&gt; 1..100 |<br>
foreach {<br>
Measure-Command -Expression {<br>
1..100 | foreach {Get-CimInstance -ClassName Win32_ComputerSystem -ComputerName $env:COMPUTERNAME } }<br>
} | Measure-Object -Average TotalMilliseconds</strong></p><p>Count : 100<br>
Average : 3892.921851<br>
Sum :<br>
Maximum :<br>
Minimum :<br>
Property : TotalMilliseconds</p><p>This one surprised me &ldquo;“ the WMI cmdlets are 2.5 times faster. I suspect that is because the CIM cmdlet has to build and then breakdown the WSMAN connection each time.</p><p>Next time we&rdquo;™ll look at accessing a remote machine.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2842/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2842/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2842&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Time for D-CRUD?</title><link>https://powershell.org/articles/2013-04-28-time-for-d-crud/</link><guid>https://powershell.org/articles/2013-04-28-time-for-d-crud/</guid><pubDate>Sun, 28 Apr 2013 17:52:28 +0000</pubDate><description>&lt;p&gt;I was thinking on the plane back from the PowerShell summit about the CRUD activities. They are a concept we have inherited from the database world:&lt;/p&gt;
&lt;p&gt;C = Create&lt;/p&gt;
&lt;p&gt;R = Read&lt;/p&gt;
&lt;p&gt;U = Update&lt;/p&gt;
&lt;p&gt;D= Delete&lt;/p&gt;
&lt;p&gt;Create, Update and Delete correspond directly to the PowerShell verbs &amp;ldquo;“ New,Set and Remove respectively.&lt;/p&gt;
&lt;p&gt;The Read action corresponds to the Get verb.&lt;/p&gt;
&lt;p&gt;Well sort of.&lt;/p&gt;
&lt;p&gt;Get-* is used in two distinct scenarios. Firstly we know of an object and we we want to read its properties &amp;ldquo;“ for example:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I was thinking on the plane back from the PowerShell summit about the CRUD activities. They are a concept we have inherited from the database world:</p><p>C = Create</p><p>R = Read</p><p>U = Update</p><p>D= Delete</p><p>Create, Update and Delete correspond directly to the PowerShell verbs &ldquo;“ New,Set and Remove respectively.</p><p>The Read action corresponds to the Get verb.</p><p>Well sort of.</p><p>Get-* is used in two distinct scenarios. Firstly we know of an object and we we want to read its properties &ldquo;“ for example:</p><p>Get-Process -Name powershell</p><p>We are reading the information about the PowerShell process. That corresponds directly to the Read action in the CRUD paradigm.</p><p>However, we also use Get* when we want to Discover the processes that are running:</p><p>Get-Process</p><p>In which case we are Discovering the processes that are running.</p><p>I think its time to update the CRUD concept and make it DCRUD where D stands for discovery.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2840/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2840/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2840&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Scripting Games 2013 have started</title><link>https://powershell.org/articles/2013-04-28-scripting-games-2013-have-started/</link><guid>https://powershell.org/articles/2013-04-28-scripting-games-2013-have-started/</guid><pubDate>Sun, 28 Apr 2013 11:49:53 +0000</pubDate><description>&lt;p&gt;The 2013 Scripting Games kicked off during the PowerShell summit. Event 1 is open and you can submit entries up until 23:59:59 GMT on 29 April 2013. Voting on the entries starts at at midnight on 30 April.&lt;/p&gt;
&lt;p&gt;You can enter and &lt;strong&gt;you&lt;/strong&gt; can vote on the entries. This is a community games run by powershell.org &amp;ldquo;“ all are welcome.&lt;/p&gt;
&lt;p&gt;If you haven&amp;rdquo;™t entered yet there is still plenty of time to get you entry in for event 1. Start by reviewing the information at &lt;a href="https://powershell.org/the-scripting-games/" title="https://powershell.org/the-scripting-games/"&gt;https://powershell.org/the-scripting-games/&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>The 2013 Scripting Games kicked off during the PowerShell summit. Event 1 is open and you can submit entries up until 23:59:59 GMT on 29 April 2013. Voting on the entries starts at at midnight on 30 April.</p><p>You can enter and<strong>you</strong> can vote on the entries. This is a community games run by powershell.org &ldquo;“ all are welcome.</p><p>If you haven&rdquo;™t entered yet there is still plenty of time to get you entry in for event 1. Start by reviewing the information at<a href="https://powershell.org/the-scripting-games/" title="https://powershell.org/the-scripting-games/">https://powershell.org/the-scripting-games/</a></p><p>Enjoy and good luck</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2838/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2838/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2838&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>PowerShell Summit"“thank you</title><link>https://powershell.org/articles/2013-04-27-powershell-summit-thank-you/</link><guid>https://powershell.org/articles/2013-04-27-powershell-summit-thank-you/</guid><pubDate>Sat, 27 Apr 2013 11:46:19 +0000</pubDate><description>&lt;p&gt;I&amp;quot;™d like to extend a huge thank you to everyone who attended the PowerShell Summit this last week. The Summit was a success &amp;ldquo;“ in no small part due to you. Your questions, and discussions, are what this is all about.&lt;/p&gt;
&lt;p&gt;It was a pleasure meeting you all and I hope to return next year &amp;ldquo;“ I hope to see many of you there as well.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2836/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2836/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2836&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I"™d like to extend a huge thank you to everyone who attended the PowerShell Summit this last week. The Summit was a success &ldquo;“ in no small part due to you. Your questions, and discussions, are what this is all about.</p><p>It was a pleasure meeting you all and I hope to return next year &ldquo;“ I hope to see many of you there as well.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2836/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2836/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2836&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Forums Migration Schedule</title><link>https://powershell.org/articles/2013-04-26-forums-migration-schedule/</link><guid>https://powershell.org/articles/2013-04-26-forums-migration-schedule/</guid><pubDate>Fri, 26 Apr 2013 18:08:39 +0000</pubDate><description>&lt;p&gt;Here&amp;rsquo;s the schedule for our Forums migration:&lt;br&gt;
From &lt;strong&gt;Now until May 4th,&lt;/strong&gt; the &lt;a href="https://forums.powershell.org"&gt;old forums&lt;/a&gt; will remain online and in-use. However, you should consider creating an account here on the &amp;ldquo;new&amp;rdquo; site (distinguishable by the different visual theme). Your new account will have no connection to the old one, and may be a Twitter, Facebook, Live, or other login. To create an account, just click &amp;ldquo;Login&amp;rdquo; at the top-left of any site page (in the dark gray toolbar).&lt;br&gt;
&lt;strong&gt;On May 4th&lt;/strong&gt; we will activate the new forums. From then on, the Forums menu link will go there. The old forums will remain available at &lt;a href="https://powershell.org/discuss"&gt;https://powershell.org/discuss&lt;/a&gt;. You can continue to use the old forums to wrap-up old topics, or if the new ones stop working for some reason.&lt;br&gt;
On &lt;strong&gt;May 13th&lt;/strong&gt; we will shut down the old forums and direct everyone to the new ones.&lt;br&gt;
By &lt;strong&gt;May 20&lt;/strong&gt; we will have migrated the content from the old forums into the new ones. These will be imported as static threads that are closed for new messages, but they&amp;rsquo;ll still be searchable.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Here&rsquo;s the schedule for our Forums migration:<br>
From<strong>Now until May 4th,</strong> the<a href="https://forums.powershell.org">old forums</a> will remain online and in-use. However, you should consider creating an account here on the &ldquo;new&rdquo; site (distinguishable by the different visual theme). Your new account will have no connection to the old one, and may be a Twitter, Facebook, Live, or other login. To create an account, just click &ldquo;Login&rdquo; at the top-left of any site page (in the dark gray toolbar).<br><strong>On May 4th</strong> we will activate the new forums. From then on, the Forums menu link will go there. The old forums will remain available at<a href="https://powershell.org/discuss">https://powershell.org/discuss</a>. You can continue to use the old forums to wrap-up old topics, or if the new ones stop working for some reason.<br>
On<strong>May 13th</strong> we will shut down the old forums and direct everyone to the new ones.<br>
By<strong>May 20</strong> we will have migrated the content from the old forums into the new ones. These will be imported as static threads that are closed for new messages, but they&rsquo;ll still be searchable.</p>
]]></content:encoded></item><item><title>Recording the PowerShell Summit</title><link>https://powershell.org/articles/2013-04-25-recording-the-powershell-summit/</link><guid>https://powershell.org/articles/2013-04-25-recording-the-powershell-summit/</guid><pubDate>Fri, 26 Apr 2013 01:51:45 +0000</pubDate><description>&lt;p&gt;So, we &lt;strong&gt;did&lt;/strong&gt; have one enterprising fella use his Webcam to record the Summit sessions he attended. Once he gets with me, we&amp;rsquo;ll get those online so you can see.&lt;br&gt;
We &lt;strong&gt;are&lt;/strong&gt; trying to think really hard about formal recordings for next time. It depends a lot on what folks want. For example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Pointing a camera at the front of the room is easy and cheap. We worry that the audio might suck and that you might not be able to read on-screen code - although many presenters make their code/slides available for download.&lt;/li&gt;
&lt;li&gt;Putting software on presenters&amp;rsquo; machines to capture what they do is out of the question. There are MORE than enough moving parts already going on in the room - this just won&amp;rsquo;t work out consistently.&lt;/li&gt;
&lt;li&gt;We can get one-button-recording devices that capture everything the speaker does on-screen, and an audio feed. You don&amp;rsquo;t get to SEE the speaker, and these are about $1000 each, plus sundry cables and adapters. For several hundred more, we can add a picture-in-picture from a camera feed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So we can do cheap-o&amp;hellip; well, cheaply. And if folks are happy with that, we&amp;rsquo;ll do it. We can do pretty awesome-looking for pretty-expensive&amp;hellip; and that&amp;rsquo;s going to require a fundraising campaign. We aren&amp;rsquo;t Microsoft, and recording three rooms, along with possible general sessions, is going to take about $8-$12k in equipment. Our goal, however, would be to give the videos away for free once a year&amp;rsquo;s event sells to its &amp;ldquo;break even&amp;rdquo; attendance point.&lt;br&gt;
Live streaming won&amp;rsquo;t happen. Meeting venues get like $5,000 per day for a 5-10Mbps pipe. Yeah, you thought they made money off the $80/gallon coffee. We just can&amp;rsquo;t afford the bandwidth to livestream. We&amp;rsquo;re not even always sure we can turn on WiFi for people to check e-mail. It&amp;rsquo;s that expensive.&lt;br&gt;
Please drop some comments. Knowing what kind of video people are willing to accept will really help us plan this out for next time, and we need a lot of lead time to do that.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>So, we<strong>did</strong> have one enterprising fella use his Webcam to record the Summit sessions he attended. Once he gets with me, we&rsquo;ll get those online so you can see.<br>
We<strong>are</strong> trying to think really hard about formal recordings for next time. It depends a lot on what folks want. For example:</p><ul><li>Pointing a camera at the front of the room is easy and cheap. We worry that the audio might suck and that you might not be able to read on-screen code - although many presenters make their code/slides available for download.</li><li>Putting software on presenters&rsquo; machines to capture what they do is out of the question. There are MORE than enough moving parts already going on in the room - this just won&rsquo;t work out consistently.</li><li>We can get one-button-recording devices that capture everything the speaker does on-screen, and an audio feed. You don&rsquo;t get to SEE the speaker, and these are about $1000 each, plus sundry cables and adapters. For several hundred more, we can add a picture-in-picture from a camera feed.</li></ul><p>So we can do cheap-o&hellip; well, cheaply. And if folks are happy with that, we&rsquo;ll do it. We can do pretty awesome-looking for pretty-expensive&hellip; and that&rsquo;s going to require a fundraising campaign. We aren&rsquo;t Microsoft, and recording three rooms, along with possible general sessions, is going to take about $8-$12k in equipment. Our goal, however, would be to give the videos away for free once a year&rsquo;s event sells to its &ldquo;break even&rdquo; attendance point.<br>
Live streaming won&rsquo;t happen. Meeting venues get like $5,000 per day for a 5-10Mbps pipe. Yeah, you thought they made money off the $80/gallon coffee. We just can&rsquo;t afford the bandwidth to livestream. We&rsquo;re not even always sure we can turn on WiFi for people to check e-mail. It&rsquo;s that expensive.<br>
Please drop some comments. Knowing what kind of video people are willing to accept will really help us plan this out for next time, and we need a lot of lead time to do that.</p>
]]></content:encoded></item><item><title>Meet the Scripting Games Judges: "Scripting Guy" Ed Wilson</title><link>https://powershell.org/articles/2013-04-25-meet-the-scripting-games-judges-scripting-guy-ed-wilson/</link><guid>https://powershell.org/articles/2013-04-25-meet-the-scripting-games-judges-scripting-guy-ed-wilson/</guid><pubDate>Thu, 25 Apr 2013 18:24:40 +0000</pubDate><description>&lt;p&gt;Ed Wilson is the Microsoft Scripting Guy and a well-known scripting expert. He writes the twice daily Hey Scripting Guy! blog (the number 1 blog on TechNet). He has also spoken at TechEd and at the Microsoft internal TechReady conferences. He is a Microsoft-certified trainer who has delivered a popular Windows PowerShell workshop to Microsoft Premier Customers worldwide. He has written 11 books including 8 on Windows scripting that were published by Microsoft Press. He has also contributed to nearly a dozen other books. He has two Microsoft Press Windows PowerShell 3.0 books: Windows PowerShell 3.0 Step by Step and Windows PowerShell 3.0 First Steps. Ed holds more than 20 industry certifications, including Microsoft Certified Systems Engineer (MCSE) and Certified Information Systems Security Professional (CISSP). Prior to coming to work for Microsoft, he was a senior consultant for a Microsoft Gold Certified Partner where he specialized in Active Directory design and Exchange implementation. In his spare time, he enjoys woodworking, underwater photography, and scuba diving.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Ed Wilson is the Microsoft Scripting Guy and a well-known scripting expert. He writes the twice daily Hey Scripting Guy! blog (the number 1 blog on TechNet). He has also spoken at TechEd and at the Microsoft internal TechReady conferences. He is a Microsoft-certified trainer who has delivered a popular Windows PowerShell workshop to Microsoft Premier Customers worldwide. He has written 11 books including 8 on Windows scripting that were published by Microsoft Press. He has also contributed to nearly a dozen other books. He has two Microsoft Press Windows PowerShell 3.0 books: Windows PowerShell 3.0 Step by Step and Windows PowerShell 3.0 First Steps. Ed holds more than 20 industry certifications, including Microsoft Certified Systems Engineer (MCSE) and Certified Information Systems Security Professional (CISSP). Prior to coming to work for Microsoft, he was a senior consultant for a Microsoft Gold Certified Partner where he specialized in Active Directory design and Exchange implementation. In his spare time, he enjoys woodworking, underwater photography, and scuba diving.</p>
]]></content:encoded></item><item><title>PSCustomObject: Save Puppies and Avoid Dead Ends</title><link>https://powershell.org/articles/2013-04-24-pscustomobject-save-puppies-and-avoid-dead-ends/</link><guid>https://powershell.org/articles/2013-04-24-pscustomobject-save-puppies-and-avoid-dead-ends/</guid><pubDate>Wed, 24 Apr 2013 21:06:59 +0000</pubDate><description>&lt;p&gt;Welcome to Scripting Games 2013. Here&amp;rsquo;s my favorite hint for improving your functions and scripts. Avoid writing to the console or formatting your output. Instead use &lt;strong&gt;PSCustomObject&lt;/strong&gt; in Windows PowerShell 3.0 and leave the formatting to the end user.&lt;br&gt;
Windows PowerShell provides lots of great ways to return the output of a command or function. You can write to the host program (Write-Host), write to a file (Out-File), and format your output to look really pretty (Format-*). But all of these techniques kill puppies and bring the pipeline to an abrupt halt.&lt;br&gt;
&amp;ldquo;Puppies?,&amp;rdquo; you ask. Yes! Windows PowerShell MVP and Scripting Games 2013 Viceroy Don Jones (@concentrateddon) famously says that every time you use Write-Host, a puppy dies. So sad!&lt;br&gt;
The Format cmdlets are almost as bad, although no deaths have yet been attributed to them. Instead, when you use a Format cmdlet, a huge STOP sign should appear warning you that you&amp;rsquo;ve brought the pipeline to a halt. Not technically, of course, but for all practical purposes.&lt;br&gt;
To see what I mean, take a peek at these two commands. The output of these commands looks very similar, but it&amp;rsquo;s really quite different.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Welcome to Scripting Games 2013. Here&rsquo;s my favorite hint for improving your functions and scripts. Avoid writing to the console or formatting your output. Instead use<strong>PSCustomObject</strong> in Windows PowerShell 3.0 and leave the formatting to the end user.<br>
Windows PowerShell provides lots of great ways to return the output of a command or function. You can write to the host program (Write-Host), write to a file (Out-File), and format your output to look really pretty (Format-*). But all of these techniques kill puppies and bring the pipeline to an abrupt halt.<br>
&ldquo;Puppies?,&rdquo; you ask. Yes! Windows PowerShell MVP and Scripting Games 2013 Viceroy Don Jones (@concentrateddon) famously says that every time you use Write-Host, a puppy dies. So sad!<br>
The Format cmdlets are almost as bad, although no deaths have yet been attributed to them. Instead, when you use a Format cmdlet, a huge STOP sign should appear warning you that you&rsquo;ve brought the pipeline to a halt. Not technically, of course, but for all practical purposes.<br>
To see what I mean, take a peek at these two commands. The output of these commands looks very similar, but it&rsquo;s really quite different.</p><p>`PS C:\ Get-Process csrss
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName</p><hr><p>885 14 2568 5092 49 516 csrss
714 19 3996 28036 92 632 csrss
PS C:\ Get-Process csrss | Format-Table
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName</p><hr><p>885 14 2568 5092 49 516 csrss
714 19 3996 28036 92 632 csrss
`These two commands return different objects and the difference really matters. To see the different output types, you can pipe them to Get-Member. I&rsquo;ve used a slightly different approach that gets only the names of types in the output, but it&rsquo;s the same idea.</p><p><code>PS C:\ Get-Process csrss | foreach {$_.gettype().fullname} System.Diagnostics.Process System.Diagnostics.Process PS C:\ Get-Process csrss | Format-Table | foreach {$_.gettype().fullname} Microsoft.PowerShell.Commands.Internal.Format.FormatStartData Microsoft.PowerShell.Commands.Internal.Format.GroupStartData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.GroupEndData Microsoft.PowerShell.Commands.Internal.Format.FormatEndData</code>Instead of a process object, the formatted command returns a bunch of format objects. You usually discover this when you try to use them in another command. For example, these format objects don&rsquo;t have the properties of a process object, like PagedMemorySize or Handles.</p><p>`PS C:\ $p = Get-Process csrss
PS C:\ $p | foreach PagedMemorySize
2629632
4075520
PS C:\ $pf = Get-Process csrss | Format-Table
PS C:\ $pf | foreach PagedMemorySize
PS C:<br>
PS C:\ get-process csrss | sort Handles
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName</p><hr><pre><code>723 19 3980 28416 87 632 csrss
881 14 2568 5096 49 516 csrss</code></pre><p>PS C:\ get-process csrss | ft | sort Handles
out-lineoutput : The object of type &ldquo;Microsoft.PowerShell.Commands.
Internal.Format.FormatEntryData&rdquo; is not valid or not in the correct
sequence. This is likely caused by a user-specified &ldquo;format-*&rdquo;
command which is conflicting with the default formatting.
+ CategoryInfo : InvalidData: (:) [out-lineoutput],
InvalidOperationException
+ FullyQualifiedErrorId : ConsoleLineOutputOutOfSequencePacket,
Microsoft.PowerShell.Commands.OutLineOutputCommand
`So you&rsquo;ve lost the opportunity to use these objects in subsequent commands. Unless you really want formatting object, the pipeline is effectively dead. Almost as sad as those puppies.<br>
I realized this problem when some colleagues at Microsoft asked me to generate a report that listed the CDXML files in a CIM module and the CIM commands that were defined in each CDXML file. I wrote a tiny script that produced a nice report that looked like this:</p><h2 id="msft_netipaddresscdxml-helpxml" class="ps-heading">`MSFT_NetIPAddress.cdxml-help.xml<a class="ps-heading-anchor" href="#msft_netipaddresscdxml-helpxml" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><h2 id="msft_netipinterfacecdxml-helpxml" class="ps-heading">Get-NetIPAddress
Set-NetIPAddress
Remove-NetIPAddress
New-NetIPAddress
MSFT_NetIPInterface.cdxml-help.xml<a class="ps-heading-anchor" href="#msft_netipinterfacecdxml-helpxml" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><h2 id="msft_netipv4protocolcdxml-helpxml" class="ps-heading">Get-NetIPInterface
Set-NetIPInterface
MSFT_NetIPv4Protocol.cdxml-help.xml<a class="ps-heading-anchor" href="#msft_netipv4protocolcdxml-helpxml" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><h2 id="msft_netipv6protocolcdxml-helpxml" class="ps-heading">Get-NetIPv4Protocol
Set-NetIPv4Protocol
MSFT_NetIPv6Protocol.cdxml-help.xml<a class="ps-heading-anchor" href="#msft_netipv6protocolcdxml-helpxml" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Get-NetIPv6Protocol
Set-NetIPv6Protocol
. . .
`But, instead of being delighted, they reported that they now had data that they couldn&rsquo;t use. I had created a dead end. Pretty, but useless. They were happier with a command that produced useable results, even if they weren&rsquo;t pretty.</p><p>`PS C:\ (Get-Module $ModuleName).NestedModules | Select-Object Name, Path, ExportedCommands
Name Path ExportedCommands</p><hr><p>MSFT_NetIPAddress C:\windows\system32\WindowsPowerShel&hellip; {[Get-NetIPAddres
MSFT_NetIPInterface C:\windows\system32\WindowsPowerShel&hellip; {[Get-NetIPInterf
MSFT_NetIPv4Protocol C:\windows\system32\WindowsPowerShel&hellip; {[Get-NetIPv4Prot
MSFT_NetIPv6Protocol C:\windows\system32\WindowsPowerShel&hellip; {[Get-NetIPv6Prot
. . .
`To avoid this dead end in the silly Get-Process case, you just remove the Format-Table command. Or, you can use the Select-Object cmdlet to create an object that is a filtered subset of the current object, if that&rsquo;s what you need.<br>
But how do you manage when you&rsquo;re returning values from different objects? It&rsquo;s easy to put them in a table, but there&rsquo;s a much better way that doesn&rsquo;t stop the pipeline.<br>
Windows PowerShell 3.0 introduces PSCustomObject. You can read all about it, and about Windows PowerShell 2.0 alternatives, in about_Object_Creation. PSCustomObject makes it easy for you to create objects.<br>
As the name implies, PSCustomObject creates a custom object with the properties that you specify. The resulting custom object works just like any .NET class object, so you can pass it through the pipeline and use it in subsequent commands.<br>
The value of PSCustomObject is a hash table (@{Key = Value; Key=Value&hellip;}) where the keys are property names and the values are property values. When you define a PSCustomObject hash table in a script or function, Windows PowerShell magically creates an object for every instance that you pass to it.<br>
Here&rsquo;s how I used it in a little script that tells you the versions of Updatable Help you have on your local machine.</p><p><code>foreach ($helpInfoFile in $helpInfoFiles) { $ModuleName = $HelpInfoFile.Name.Split('_')[0] $CultureInfo = ([xml](Get-Content</code>
$HelpInfoFile)).HelpInfo.SupportedUICultures.UICulture
$UICulture = $CultureInfo.UICultureName
$Version = $CultureInfo.UICultureVersion
[PSCustomObject]@{&ldquo;ModuleName&rdquo;=$ModuleName;
&ldquo;Culture&rdquo;=$UICulture;
&ldquo;Version&rdquo;=$Version}
}
`In this case , I was processing a bunch of HelpInfo XML files. I want to return an object that contains the module name, the name of the UI culture, and the version number for that UI culture. The details don&rsquo;t matter, except that the property values weren&rsquo;t all in the same object, so I couldn&rsquo;t just select from an object.<br>
PSCustomObject to the rescue! See how easy this is!<br>
In the ForEach loop, I get the values that I need. Then I just define a PSCustomObject and &ldquo;¦ voila! &ldquo;¦ I have my objects. The default formatting makes them look nice enough.</p><p>`ModuleName Culture Version</p><hr><p>AppLocker en-US 3.1.0.0
Appx en-US 3.1.0.0
BitLocker en-US 3.1.0.0
BranchCache en-US 3.1.0.0
`But more importantly, the pipeline continues. When I pipe to Get-Member, it shows that I have a usable custom object:</p><p>`PS C:\ $u | get-member
TypeName: System.Management.Automation.PSCustomObject
Name MemberType Definition</p><hr><p>Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
Culture NoteProperty System.String Culture=en-US
ModuleName NoteProperty System.String ModuleName=AppLocker
Version NoteProperty System.String Version=3.1.0.0
`And, I can use the output in subsequent commands.</p><p>`PS C:\ $u | sort Version | group Version
Count Name Group</p><hr><p>24 3.0.0.0 {@{ModuleName=NetSwitchTeam;
1 3.0.1.0 {@{ModuleName=MsDtc; Culture=
1 3.0.2.0 {@{ModuleName=Wdac; Culture=e
15 3.1.0.0 {@{ModuleName=ScheduledTasks;
4 3.2.0.0 {@{ModuleName=Microsoft.WSMan
1 {3.2.15.3, 3.2.15.0, 3&hellip; {@{ModuleName=Show-Calendar;
1 3.4.0.0 {@{ModuleName=NetTCPIP; Cultu
`Now, go out and try it! Some of the Scripting Games challenges might require a table, list, or some other formatting, but if it doesn&rsquo;t, be sure return a really useful object.<br>
Good luck to everyone!</p>
]]></content:encoded></item><item><title>Now Accepting Nominations for PowerShell.org, Inc. Board of Directors</title><link>https://powershell.org/articles/2013-04-24-now-accepting-nominations-for-powershell-org-inc-board-of-directors/</link><guid>https://powershell.org/articles/2013-04-24-now-accepting-nominations-for-powershell-org-inc-board-of-directors/</guid><pubDate>Wed, 24 Apr 2013 16:10:56 +0000</pubDate><description>&lt;p&gt;At our first annual Shareholders Meeting (shareholders will receive an e-mail from me later this week about that meeting), we will be voting on our Board of Directors. Our corporate articles permit our existing Board members to serve indefinitely, and so all are automatically re-nominated. The current Board includes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Myself (Don Jones)&lt;/li&gt;
&lt;li&gt;Kirk Munro&lt;/li&gt;
&lt;li&gt;Richard Siddaway&lt;/li&gt;
&lt;li&gt;Jason Helmick&lt;/li&gt;
&lt;li&gt;Jeffery Hicks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The Board is responsible for appointing a CEO (which is currently myself) to run the company; the CEO then appoints other officers as needed to conduct the corporation&amp;rsquo;s business. I&amp;rsquo;ll reiterate that PowerShell.org is a not-for-profit business, meaning our goal is to more or less break even. We obviously have expenses - Web site hosting, running the Summit, and so on - and the corporation provides a place where the needed funds can be managed, without running through anyone&amp;rsquo;s personal checking account.&lt;br&gt;
If you would like to nominate someone for the Board, please e-mail president/at/powershell.org no later than May 15th, 2013. Provide the person&amp;rsquo;s name and e-mail address. You are welcome to nominate yourself.&lt;br&gt;
Each shareholder will receive 5 votes per share owned, and can distribute those votes however they like amongst the nominees. The top 5 vote-earning nominees will comprise our new Board. They will then elect their Chairman, who presides over Board meetings, and either reconfirm the existing CEO or appoint a new one.&lt;br&gt;
If you are interested in becoming a shareholder, &lt;a href="https://powershell.org/discuss/viewtopic.php?f=26&amp;amp;t=239"&gt;please see this post&lt;/a&gt;. Note that shares must be purchased before May 1st, 2013, in order to be eligible for voting in the upcoming cycle. We are also &lt;a href="http://wp.me/p3priC-EW"&gt;nearing the end of our capital campaign&lt;/a&gt;, so time is running out to own a piece of PowerShell.org.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>At our first annual Shareholders Meeting (shareholders will receive an e-mail from me later this week about that meeting), we will be voting on our Board of Directors. Our corporate articles permit our existing Board members to serve indefinitely, and so all are automatically re-nominated. The current Board includes:</p><ul><li>Myself (Don Jones)</li><li>Kirk Munro</li><li>Richard Siddaway</li><li>Jason Helmick</li><li>Jeffery Hicks</li></ul><p>The Board is responsible for appointing a CEO (which is currently myself) to run the company; the CEO then appoints other officers as needed to conduct the corporation&rsquo;s business. I&rsquo;ll reiterate that PowerShell.org is a not-for-profit business, meaning our goal is to more or less break even. We obviously have expenses - Web site hosting, running the Summit, and so on - and the corporation provides a place where the needed funds can be managed, without running through anyone&rsquo;s personal checking account.<br>
If you would like to nominate someone for the Board, please e-mail president/at/powershell.org no later than May 15th, 2013. Provide the person&rsquo;s name and e-mail address. You are welcome to nominate yourself.<br>
Each shareholder will receive 5 votes per share owned, and can distribute those votes however they like amongst the nominees. The top 5 vote-earning nominees will comprise our new Board. They will then elect their Chairman, who presides over Board meetings, and either reconfirm the existing CEO or appoint a new one.<br>
If you are interested in becoming a shareholder,<a href="https://powershell.org/discuss/viewtopic.php?f=26&amp;t=239">please see this post</a>. Note that shares must be purchased before May 1st, 2013, in order to be eligible for voting in the upcoming cycle. We are also<a href="http://wp.me/p3priC-EW">nearing the end of our capital campaign</a>, so time is running out to own a piece of PowerShell.org.</p>
]]></content:encoded></item><item><title>Summit Downloads</title><link>https://powershell.org/articles/2013-04-22-summit-downloads/</link><guid>https://powershell.org/articles/2013-04-22-summit-downloads/</guid><pubDate>Mon, 22 Apr 2013 18:23:28 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;ll be updating this post as presenters turn over materials to us. Most of these files will be ZIPs. If there are any session materials missing - please be patient (we&amp;rsquo;re uploading as quickly as we can), or
contact the presenter directly
(as they may not have provided materials to us yet).&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/ASTManipulation.zip"&gt;Driscoll AST Manipulation&lt;/a&gt;&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/pssummit2013WrappingBinaryModule.zip"&gt;Prosser WrappingBinaryModule&lt;/a&gt;&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/Creating-HTML-Reports-with-Style-PSHSummit.zip"&gt;Creating HTML Reports with Style PSHSummit&lt;/a&gt;&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/Unit-Testing-Powershell.pptx.zip"&gt;Wrock Unit Testing Powershell.pptx&lt;/a&gt;&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/The-Powers-of-PowerShell-Pipeworks.pptx.zip"&gt;Brundage The Powers of PowerShell Pipeworks.pptx&lt;/a&gt;&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/DonJonesAll.zip"&gt;Don Jones All&lt;/a&gt;&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/Slides.zip"&gt;Slides from Several Speakers in one ZIP&lt;/a&gt;&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/BothSessionsAndExampleScripts.zip"&gt;Renouf BothSessionsAndExampleScripts&lt;/a&gt;&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/How-Secure-Can-You-Be.pdf.zip"&gt;Hicks How Secure Can You Be.pdf&lt;/a&gt;&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/Look-No-WinForms.zip"&gt;Hicks Look No WinForms&lt;/a&gt;&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/PowerShellSummitNA2013-WinRM-Drilldown.potx.zip"&gt;Team - PowerShellSummitNA2013 - WinRM Drilldown.potx&lt;/a&gt;&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/FasterPowerShellTalk.zip"&gt;Shirk FasterPowerShellTalk&lt;/a&gt;&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/DevMgmt.zip"&gt;Ricardo&amp;rsquo;s Device Mgmt talk&lt;/a&gt;&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/BunchMore.zip"&gt;Bunch more - should be the rest of them&lt;/a&gt;&lt;br&gt;
Ian Davis has his at &lt;a href="https://github.com/idavis/PowerShellSummit"&gt;https://github.com/idavis/PowerShellSummit&lt;/a&gt;&lt;br&gt;
Here is the link to Ricardo Mendes&amp;quot;™ Device Management PowerShell module he mentioned during his session. &lt;a href="http://gallery.technet.microsoft.com/Device-Management-7fad2388"&gt;http://gallery.technet.microsoft.com/Device-Management-7fad2388&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;ll be updating this post as presenters turn over materials to us. Most of these files will be ZIPs. If there are any session materials missing - please be patient (we&rsquo;re uploading as quickly as we can), or
contact the presenter directly
(as they may not have provided materials to us yet).<br><a href="https://powershell.org/wp-content/uploads/2013/04/ASTManipulation.zip">Driscoll AST Manipulation</a><br><a href="https://powershell.org/wp-content/uploads/2013/04/pssummit2013WrappingBinaryModule.zip">Prosser WrappingBinaryModule</a><br><a href="https://powershell.org/wp-content/uploads/2013/04/Creating-HTML-Reports-with-Style-PSHSummit.zip">Creating HTML Reports with Style PSHSummit</a><br><a href="https://powershell.org/wp-content/uploads/2013/04/Unit-Testing-Powershell.pptx.zip">Wrock Unit Testing Powershell.pptx</a><br><a href="https://powershell.org/wp-content/uploads/2013/04/The-Powers-of-PowerShell-Pipeworks.pptx.zip">Brundage The Powers of PowerShell Pipeworks.pptx</a><br><a href="https://powershell.org/wp-content/uploads/2013/04/DonJonesAll.zip">Don Jones All</a><br><a href="https://powershell.org/wp-content/uploads/2013/04/Slides.zip">Slides from Several Speakers in one ZIP</a><br><a href="https://powershell.org/wp-content/uploads/2013/04/BothSessionsAndExampleScripts.zip">Renouf BothSessionsAndExampleScripts</a><br><a href="https://powershell.org/wp-content/uploads/2013/04/How-Secure-Can-You-Be.pdf.zip">Hicks How Secure Can You Be.pdf</a><br><a href="https://powershell.org/wp-content/uploads/2013/04/Look-No-WinForms.zip">Hicks Look No WinForms</a><br><a href="https://powershell.org/wp-content/uploads/2013/04/PowerShellSummitNA2013-WinRM-Drilldown.potx.zip">Team - PowerShellSummitNA2013 - WinRM Drilldown.potx</a><br><a href="https://powershell.org/wp-content/uploads/2013/04/FasterPowerShellTalk.zip">Shirk FasterPowerShellTalk</a><br><a href="https://powershell.org/wp-content/uploads/2013/04/DevMgmt.zip">Ricardo&rsquo;s Device Mgmt talk</a><br><a href="https://powershell.org/wp-content/uploads/2013/04/BunchMore.zip">Bunch more - should be the rest of them</a><br>
Ian Davis has his at<a href="https://github.com/idavis/PowerShellSummit">https://github.com/idavis/PowerShellSummit</a><br>
Here is the link to Ricardo Mendes"™ Device Management PowerShell module he mentioned during his session.<a href="http://gallery.technet.microsoft.com/Device-Management-7fad2388">http://gallery.technet.microsoft.com/Device-Management-7fad2388</a></p>
]]></content:encoded></item><item><title>[UPDATED] PowerShell Summit 2013 Conference Schedule</title><link>https://powershell.org/articles/2013-04-22-powershell-summit-2013-conference-schedule/</link><guid>https://powershell.org/articles/2013-04-22-powershell-summit-2013-conference-schedule/</guid><pubDate>Mon, 22 Apr 2013 15:49:02 +0000</pubDate><description>&lt;p&gt;If you are attending the PowerShell Summit next week in Redmond, you might want to make sure you have copies of the schedule on hand.  There are two tracks, and I have created two pdf documents, one for each track, that provide the full schedule including session abstracts and speaker bios.&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/PowerShell-Summit-2013-Conference-Agenda-Track-1.pdf"&gt;PowerShell Summit 2013 Conference Schedule - Track 1&lt;/a&gt;&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/PowerShell-Summit-2013-Conference-Agenda-Track-2.pdf" title="PowerShell Summit 2013 Conference Schedule - Track 2.pdf"&gt;PowerShell Summit 2013 Conference Schedule - Track 2&lt;/a&gt;&lt;br&gt;
While those details are very useful, some of the conference attendees have expressed an interest in having a consolidated view of the agenda so that they could see which sessions were taking place on each of the tracks and choose which they were more interested in.  Ask, and ye shall receive.  Here is a consolidated view of the conference sessions on all tracks, with each day on a separate page.&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/PowerShell-Summit-2013-Conference-Agenda-At-a-glance.pdf"&gt;PowerShell Summit 2013 Conference Schedule - At at glance&lt;/a&gt;&lt;br&gt;
Note that if you don&amp;quot;™t have a ticket for the conference, it is sold out for this year.  We&amp;quot;™re planning the 2014 conference now, so keep watching this blog for news about that conference as it becomes available.  There are already a few posts about it that are worth reviewing if you missed them.&lt;br&gt;
Thanks, and enjoy the conference next week!&lt;br&gt;
Kirk out.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>If you are attending the PowerShell Summit next week in Redmond, you might want to make sure you have copies of the schedule on hand.  There are two tracks, and I have created two pdf documents, one for each track, that provide the full schedule including session abstracts and speaker bios.<br><a href="https://powershell.org/wp-content/uploads/2013/04/PowerShell-Summit-2013-Conference-Agenda-Track-1.pdf">PowerShell Summit 2013 Conference Schedule - Track 1</a><br><a href="https://powershell.org/wp-content/uploads/2013/04/PowerShell-Summit-2013-Conference-Agenda-Track-2.pdf" title="PowerShell Summit 2013 Conference Schedule - Track 2.pdf">PowerShell Summit 2013 Conference Schedule - Track 2</a><br>
While those details are very useful, some of the conference attendees have expressed an interest in having a consolidated view of the agenda so that they could see which sessions were taking place on each of the tracks and choose which they were more interested in.  Ask, and ye shall receive.  Here is a consolidated view of the conference sessions on all tracks, with each day on a separate page.<br><a href="https://powershell.org/wp-content/uploads/2013/04/PowerShell-Summit-2013-Conference-Agenda-At-a-glance.pdf">PowerShell Summit 2013 Conference Schedule - At at glance</a><br>
Note that if you don"™t have a ticket for the conference, it is sold out for this year.  We"™re planning the 2014 conference now, so keep watching this blog for news about that conference as it becomes available.  There are already a few posts about it that are worth reviewing if you missed them.<br>
Thanks, and enjoy the conference next week!<br>
Kirk out.</p>
]]></content:encoded></item><item><title>Meet the Scripting Games Judges: Jeffery Hicks</title><link>https://powershell.org/articles/2013-04-22-meet-the-scripting-games-judges-jeffery-hicks/</link><guid>https://powershell.org/articles/2013-04-22-meet-the-scripting-games-judges-jeffery-hicks/</guid><pubDate>Mon, 22 Apr 2013 14:46:22 +0000</pubDate><description>&lt;p&gt;Jeffery Hicks is a Microsoft MVP in Windows PowerShell, Microsoft
Certified Trainer and an IT veteran with over 20 years of experience,
much of it spent as an IT consultant specializing in Microsoft server
technologies with an emphasis in automation and efficiency.He works
today as an independent author, trainer and consultant.Jeffwritesthe
popular Prof. PowerShell column for MPCMag.com, is a regular contributor
to the Petri IT Knowledgebase, 4SysOps and the Altaro Hyper-V blog, as
well as frequent speaker at technology conferences and user groups.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Jeffery Hicks is a Microsoft MVP in Windows PowerShell, Microsoft
Certified Trainer and an IT veteran with over 20 years of experience,
much of it spent as an IT consultant specializing in Microsoft server
technologies with an emphasis in automation and efficiency.He works
today as an independent author, trainer and consultant.Jeffwritesthe
popular Prof. PowerShell column for MPCMag.com, is a regular contributor
to the Petri IT Knowledgebase, 4SysOps and the Altaro Hyper-V blog, as
well as frequent speaker at technology conferences and user groups.</p><p>Jeff is looking forward to seeing entries that are more than<br>
re-formatted VBScript. Beginner scripts should demonstrate an<br>
understanding of the PowerShell paradigm.Advanced scripts should go<br>
beyond and demonstrate mastery of complex techniques and concepts. The<br>
best of the best will have a pure, elegant, zen-like simplicity even for<br>
the most challenging tasks.<br>
You can keep up with Jeff at his blog<a href="http://jdhitsolutions.com/blog">http://jdhitsolutions.com/blog</a> , on<br>
Twitter at<a href="https://twitter.com/jeffhicks">https://twitter.com/jeffhicks</a> and on<br>
Google Plus (<a href="http://gplus.to/JeffHicks">http://gplus.to/JeffHicks</a>)</p>
]]></content:encoded></item><item><title>Advanced Practice Event</title><link>https://powershell.org/articles/2013-04-20-advanced-practice-event/</link><guid>https://powershell.org/articles/2013-04-20-advanced-practice-event/</guid><pubDate>Sat, 20 Apr 2013 16:00:56 +0000</pubDate><description>&lt;p&gt;I want to direct your attention to &lt;a href="https://powershell.org/discuss/viewtopic.php?f=39&amp;amp;t=1810&amp;amp;p=8059#p8059"&gt;this forums post&lt;/a&gt;, which I think is worth anyone&amp;rsquo;s time to look through. I&amp;rsquo;ve left a pretty long reply with some comments on the entry that would also be worth a read.&lt;br&gt;
I find that a LOT of folks - like the gentleman who posted his script - have a really good approach to PowerShell scripts. They want to use parameters. They want verbose output. They want to proactively check for errors. Where I think folks get lost is in the fine points of how PowerShell enables these features. I see folks working harder than they need to, coding functionality that the shell will actually give them for free. I also see some not-entirely-perfect approaches to things like parameters and error handling, and some occasional mis-use of advanced features (I often see SupportsShouldProcess &lt;em&gt;declared&lt;/em&gt; but not actually &lt;em&gt;implemented&lt;/em&gt;).&lt;br&gt;
Sometimes, this simply happens because a lot of these advanced features aren&amp;rsquo;t well-documented in one convenient spot - they&amp;rsquo;re all spread out - and because folks are learning from blog posts, which may themselves have been written by someone with an incomplete understanding. Or, they&amp;rsquo;re pasting bits together without &lt;em&gt;really&lt;/em&gt; knowing what they&amp;rsquo;re doing. That&amp;rsquo;s cool - what you have to sometimes do is take a whack at something like this poster did, and get some feedback. I&amp;rsquo;m &lt;em&gt;really&lt;/em&gt; glad he did, because it offers an opportunity to clear up some misunderstandings, which will just make his scripts even better in the future.&lt;br&gt;
I hope everyone&amp;rsquo;s looking at the Games as a learning opportunity. I hope &lt;em&gt;everyone&lt;/em&gt; will vote on folks&amp;rsquo; entries and leave comments when they do; I hope as many people as possible spend some time blogging about what  they see, what they&amp;rsquo;ve learned, and &lt;em&gt;what they don&amp;rsquo;t understand.&lt;/em&gt; That&amp;rsquo;s how we&amp;rsquo;ll all improve.&lt;br&gt;
Let me give you a perfect example (we&amp;rsquo;re no longer discussing the forums post, here - I&amp;rsquo;m moving on to a new topic):&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I want to direct your attention to<a href="https://powershell.org/discuss/viewtopic.php?f=39&amp;t=1810&amp;p=8059#p8059">this forums post</a>, which I think is worth anyone&rsquo;s time to look through. I&rsquo;ve left a pretty long reply with some comments on the entry that would also be worth a read.<br>
I find that a LOT of folks - like the gentleman who posted his script - have a really good approach to PowerShell scripts. They want to use parameters. They want verbose output. They want to proactively check for errors. Where I think folks get lost is in the fine points of how PowerShell enables these features. I see folks working harder than they need to, coding functionality that the shell will actually give them for free. I also see some not-entirely-perfect approaches to things like parameters and error handling, and some occasional mis-use of advanced features (I often see SupportsShouldProcess<em>declared</em> but not actually<em>implemented</em>).<br>
Sometimes, this simply happens because a lot of these advanced features aren&rsquo;t well-documented in one convenient spot - they&rsquo;re all spread out - and because folks are learning from blog posts, which may themselves have been written by someone with an incomplete understanding. Or, they&rsquo;re pasting bits together without<em>really</em> knowing what they&rsquo;re doing. That&rsquo;s cool - what you have to sometimes do is take a whack at something like this poster did, and get some feedback. I&rsquo;m<em>really</em> glad he did, because it offers an opportunity to clear up some misunderstandings, which will just make his scripts even better in the future.<br>
I hope everyone&rsquo;s looking at the Games as a learning opportunity. I hope<em>everyone</em> will vote on folks&rsquo; entries and leave comments when they do; I hope as many people as possible spend some time blogging about what  they see, what they&rsquo;ve learned, and<em>what they don&rsquo;t understand.</em> That&rsquo;s how we&rsquo;ll all improve.<br>
Let me give you a perfect example (we&rsquo;re no longer discussing the forums post, here - I&rsquo;m moving on to a new topic):</p><p>`Try {
$continue = $true
$bios = Get-WmiObject -class Win32_BIOS -computername $computer -EA Stop
} Catch {
$continue = $false
$computer | Out-File errors.txt -append
}
if ($continue) {
$os = Get-WmiObject -class Win32_OperatingSystem -computername $computer</p><h1 id="and-so-on" class="ps-heading">and so on&hellip;<a class="ps-heading-anchor" href="#and-so-on" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>}
`This is how I used to code for error handling when querying multiple WMI classes. I&rsquo;d set a &ldquo;flag&rdquo; variable, $continue, to $false if the first WMI call failed, so that I didn&rsquo;t waste time on subsequent calls. Note that this is just a snippet; it isn&rsquo;t an entire script. Then I had a student who coded it this way:</p><p>`Try {
$bios = Get-WmiObject -class Win32_BIOS -computername $computer -EA Stop
$os = Get-WmiObject -class Win32_OperatingSystem -computername $computer</p><h1 id="and-so-on-1" class="ps-heading">and so on&hellip;<a class="ps-heading-anchor" href="#and-so-on-1" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>} Catch {
$computer | Out-File errors.txt -append
}
`Much more concise, and same effect. If the first WMI call fails, I jump into the Catch block, and skip the remaining code anyway. So there are constantly learning opportunities in seeing someone else&rsquo;s approach. For me, I learn new approaches that are sometimes better than what I&rsquo;ve been doing. I also learn how to better teach PowerShell to people, by seeing common mistakes and misunderstandings. It&rsquo;s great to share your failures - that&rsquo;s how we grow!<br><strong>Update:</strong> Someone dropped me a line and made a couple of points, which I want to address:</p><blockquote><p>In the reply to the blog post you say: &ldquo;Please consider properly setting -ErrorAction on the command (Get-WmiObject, in your case) and using a Try/Catch construct to actually handle errors, not just hide them.&rdquo; The example shown does the exact opposite. Any terminating error is caught, logged to a file, but not re-thrown effectively hiding the exception.</p></blockquote><p>I disagree. First,<em>handling</em> an error<em>may still involve suppressing the error message.</em> But I&rsquo;m suppressing it for just one command, not the entire script; I&rsquo;m also<em>handling</em> the error by, in my case, logging it to a file. How you choose to handle may differ. What I don&rsquo;t want to do is toss a terminating exception - I&rsquo;m in a loop, and want my command to continue processing the next object.</p><blockquote><p>Also the $os  = &hellip; part is missing the -errorAction STOP.</p></blockquote><p>That&rsquo;s deliberate. If there&rsquo;s going to be an<em>anticipated</em> error - lack of connectivity, bad credentials, etc., I&rsquo;m going to get an error on the first WMI call ($bios). I&rsquo;ll trap it, log it, and move on to the next computer (one presumes those snippets of mine are running in a loop of some kind, processing one computer at a time). If there&rsquo;s an<em>unexpected</em> error, like a corrupt WMI repository or something, the second WMI call ($os) will explode, generating an error that I very much want to see, because I didn&rsquo;t anticipate it.<br>
Notice a word that I used a lot there: &ldquo;I.&rdquo; I&rsquo;m coding the script for the way<em>I</em> want to it to run.<em>I</em> want anticipated errors logged, and <em>I</em> want unanticipated errors to continue exploding.<em>You</em> may want your scripts to do different things. I&rsquo;m not putting these snippets out there as the One True Way To Code, because there&rsquo;s no such thing. What I<em>am</em> saying is that you need to<em>think about</em> why you&rsquo;re coding the way you are, and have some justification for it.<br>
Globally suppressing error messages, but not doing anything to handle errors that you do suppress, is a poor practice. Beyond that, do what you need to do. I&rsquo;m fine with someone suppressing an error<em>they&rsquo;ve dealt with.</em> But if your code isn&rsquo;t dealing with it, then the person running the script needs to see something&rsquo;s gone wrong.</p>
]]></content:encoded></item><item><title>Show Your Scripting Games Pride!</title><link>https://powershell.org/articles/2013-04-20-show-your-scripting-games-pride/</link><guid>https://powershell.org/articles/2013-04-20-show-your-scripting-games-pride/</guid><pubDate>Sat, 20 Apr 2013 15:06:24 +0000</pubDate><description>&lt;p&gt;If you&amp;rsquo;re participating in the Scripting Games, log on to the Scripting Games Web site and check out your Profile page. You&amp;rsquo;ll find a redemption code that can be used to unlock a Participant achievement on the main PowerShell.org Web site!&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/FirefoxScreenSnapz0012.png"&gt;&lt;img src="https://powershell.org/wp-content/uploads/2013/04/FirefoxScreenSnapz0012.png" alt="FirefoxScreenSnapz001"&gt;&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>If you&rsquo;re participating in the Scripting Games, log on to the Scripting Games Web site and check out your Profile page. You&rsquo;ll find a redemption code that can be used to unlock a Participant achievement on the main PowerShell.org Web site!<br><a href="https://powershell.org/wp-content/uploads/2013/04/FirefoxScreenSnapz0012.png"><img src="https://powershell.org/wp-content/uploads/2013/04/FirefoxScreenSnapz0012.png" alt="FirefoxScreenSnapz001"/></p>
]]></content:encoded></item><item><title>Comments from the PowerShell.org survey</title><link>https://powershell.org/articles/2013-04-19-comments-from-the-powershell-org-survey/</link><guid>https://powershell.org/articles/2013-04-19-comments-from-the-powershell-org-survey/</guid><pubDate>Fri, 19 Apr 2013 17:09:26 +0000</pubDate><description>&lt;p&gt;As you probably know, we&amp;rsquo;ve been &lt;a href="http://674004.polldaddy.com/s/2013-powershell-org-member-survey"&gt;running a survey for PowerShell.org&lt;/a&gt;, which helps us both improve the site and create demographic information that makes us appealing to sponsors (who, you know, &lt;em&gt;pay&lt;/em&gt; for everything here). We&amp;rsquo;ve gotten a ton of great feedback. Yeah, we really are reading every single comment you left.&lt;br&gt;
Let&amp;rsquo;s start with the biggies:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Maybe some more guest writers for articles? I imagine it&amp;rsquo;s difficult with all the articles that get posted all over the net every day, but maybe some of those folks (like the scripting guys or scripting wife) can do some to help the Powershell.org community.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>As you probably know, we&rsquo;ve been<a href="http://674004.polldaddy.com/s/2013-powershell-org-member-survey">running a survey for PowerShell.org</a>, which helps us both improve the site and create demographic information that makes us appealing to sponsors (who, you know,<em>pay</em> for everything here). We&rsquo;ve gotten a ton of great feedback. Yeah, we really are reading every single comment you left.<br>
Let&rsquo;s start with the biggies:</p><blockquote><p>Maybe some more guest writers for articles? I imagine it&rsquo;s difficult with all the articles that get posted all over the net every day, but maybe some of those folks (like the scripting guys or scripting wife) can do some to help the Powershell.org community.</p></blockquote><p>You find us guest authors, we&rsquo;ll give &rsquo;em a place to write. Problem is, not many folks want to write. We try to aggregate the better PowerShell-related blogs out there (we link to the original site so that we&rsquo;re not stealing their traffic) just as a discovery mechanism, but I&rsquo;m not sure what else we could do.</p><blockquote><p>On the forum almost every thread remains &lsquo;unsolved&rsquo;. Maybe moderators can close threads, and even remove posts that are not relevant. I also see a lot of questions returning, for example on &lsquo;how to change a property in AD&rsquo;. I don&rsquo;t know if this can be avoided, but if you know a way to diminish double threads, that would be great.</p></blockquote><p>Testify, brother. You tell me how to fix it and we&rsquo;ll give it a shot. The rest of the interwebz would probably like to know how to fix that, too. We can&rsquo;t make people click &ldquo;solved,&rdquo; and believe it or not they get TESTY if we click it for them. Seriously. Been yelled at. And don&rsquo;t know how to make people search before they post. Just don&rsquo;t.<br>
And now for some shorter responses:</p><ul><li><strong>PHPBB forums for questions&hellip; just link to StackExchange.</strong> Honestly, whatevs. We literally have at least one comment telling us to use every piece of forums software out there, and/or link to every other forum already out there. ServerFault, ExpertsExchange, we&rsquo;ve got &rsquo;em all in here. We&rsquo;ll continue having our own forums mainly because it&rsquo;s easier to ensure newcomers (especially) get a polite answer, not a brush-off, which happens too often in some of the other forums I&rsquo;ve seen. As for software, we&rsquo;re moving off of phpBB in June.</li><li><strong>I don&rsquo;t know if that something not to like - but I do think that people should be awarded for contributing to the community.</strong> Agreed. Looking into it.</li><li><strong>forum email notifications work sporadically (does not always send an email for notices/updates)</strong>. I&rsquo;m not sure they&rsquo;re that sporadic - I&rsquo;ve looked into this a LOT. A lot a lot. Problem is that people have their spam settings set to DEFCON 1, with three layers of filtering. ForeFront Online Protection, for example, had a global block against our hosting company&rsquo;s IP addresses that we had to get resolved - when things are blocked at that level, you&rsquo;ll never see it in your Spam folders.</li><li><strong>I love the simplicity of the site, please DON&rsquo;T make it too busy with meaningless ads and trivialites.</strong> Dang. There goes our plans for putting ads every three inches on the page. Oh, well.</li><li><strong>It needs rss feeds.</strong> It has &rsquo;em.</li><li><strong>Regarding Summit info, and especially the session registration process has been a bit confusing. I&rsquo;m not sure of a single place to optionally check status updates.</strong> I know. That&rsquo;s my fault. We&rsquo;re going to do better next time, putting everything in the &ldquo;Announcements&rdquo; category here.</li><li><strong>There is too much fokus on American area. We need more European stuff / events.</strong> Dude, you help us put it together, then. You live there. Asking Americans to put on a European event does not smell like a recipe for success, ya know?</li><li><strong>It&rsquo;s not possible but it&rsquo;d be nice if the moderators when stumped would reach out to the masters to get threads answered.</strong> We really try to. Sometimes the other folks aren&rsquo;t all that responsive. They got jobs too, and whatnot.</li><li><strong>The home page isn&rsquo;t very appealing - not a big complaint but it could do with a makeover.</strong> Done. Hope you like it. The Forums will be moving, too.</li><li><strong>There&rsquo;s a lot of good email newsletter design templates available out there to make it more reader friendly and not just a wall of text.</strong> Well, PowerShell&rsquo;s pretty text-heavy. Guess we&rsquo;re not big GUI folks .</li><li><strong>I do not like the fact that you make business around powershell.</strong> Yeah, I&rsquo;m not sure you and I agree on what a &ldquo;business&rdquo; is. We set up PowerShell.org, Inc., so that an entity could own the Web site and pay for its hosting. We make about enough money from sponsorships to pay those bills. Officially, PowerShell.org, Inc. is &ldquo;not for profit.&rdquo; Nobody draws a salary or gets paid. We can&rsquo;t give you all of these resources for free without someone paying, and the &ldquo;business&rdquo; gives that money a place to go so that it is<em>only</em> used to run the community. Nobody else can pinch off pieces of the money for their own purposes.</li><li><strong>More integration / collaboration with PowerShell User Groups.</strong> Yeah, working on it. Literally, Mark Schill (who runs that site) and I have been exchanging e-mails this morning. We both understand the value in having one place to discover user groups and keep up with their schedules; we&rsquo;re trying to figure out the best way to deliver the functionality user group leaders require to post that information, and where the best place is for it to all live. We&rsquo;ll link to it from here, wherever that turns out to be. Stay tuned.</li><li><strong>Put newsletters in an online archive.</strong> Working on it. The March switch in mail providers was in large part to facilitate this. I just need some time to finish up the programmery bits needed.</li><li><strong>Live hangouts/webinars in the vein of what vBrownbag does for virtualization.</strong> Awesome idea. You volunteering to lead &rsquo;em? Please, contact me if you are.</li></ul><p>Y&rsquo;all had a bunch of nice things to say, too, which we all appreciate. We&rsquo;ll be sharing the complete survey results once it finishes running at the end of May.<br>
But let&rsquo;s wrap with a big philosophical comment, because I&rsquo;d really like your feedback on this one - just drop a comment below if you care to weigh in.</p><blockquote><p>I would like to see a site that becomes the authoritative place to go for resources since Microsoft doesn&rsquo;t really seem all that interested any more. There are way to many sites hosting scripts and pieces of &ldquo;stuff&rdquo;. I would really like to have &ldquo;One site to rule them all.&rdquo; 😉</p></blockquote><p>I get that. But&hellip; in some cases, the folks running a great resource (take PoshCode.org) want to rule their own destiny, and not become part of the collective. Nothing wrong with that - it lets them do their own thing. We&rsquo;re trying to just link to the best of those community resources, so that people can find them when they run across this site. If someone<em>wants</em> to jump in and be part of PowerShell.org, we&rsquo;ll try and make it happen - our charter is to offer support and resources to anyone who&rsquo;s contributing - but we don&rsquo;t really lobby for them to do that. If<strong>you</strong> see something out there you like, and you think they should hook up with us in some fashion, tell them.</p>
]]></content:encoded></item><item><title>Beginner Practice Event</title><link>https://powershell.org/articles/2013-04-18-beginner-practice-event/</link><guid>https://powershell.org/articles/2013-04-18-beginner-practice-event/</guid><pubDate>Thu, 18 Apr 2013 19:07:38 +0000</pubDate><description>&lt;p&gt;As you may be aware, we posted &lt;a href="https://powershell.org/2013/04/03/2013-scripting-games-schedule/"&gt;Practice Events for the 2013 Scripting Games&lt;/a&gt;, in an effort to give people an idea of what the events would look like and involve. There&amp;rsquo;s been a &lt;a href="https://powershell.org/discuss/viewtopic.php?f=39&amp;amp;t=1674"&gt;lively discussion&lt;/a&gt; in the PowerShell.org forums about the Beginner Practice, so I thought I&amp;rsquo;d weigh in. Here&amp;rsquo;s my solution:&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/VMware-FusionScreenSnapz001.png"&gt;&lt;img src="https://powershell.org/wp-content/uploads/2013/04/VMware-FusionScreenSnapz001.png" alt="Beginner practice event"&gt;&lt;/a&gt;&lt;br&gt;
Of course, that&amp;rsquo;s hardly the only way to go about it. I used this approach because it minimizes the use of extra variables, and doesn&amp;rsquo;t create a script-style approach - it&amp;rsquo;s a &amp;ldquo;one-liner,&amp;rdquo; although I&amp;rsquo;ve broken it across several physical lines for readability. I think it makes good use of PowerShell&amp;rsquo;s native ability to deal with multiple objects in a stream - there&amp;rsquo;s no need for a ForEach loop, here.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>As you may be aware, we posted<a href="https://powershell.org/2013/04/03/2013-scripting-games-schedule/">Practice Events for the 2013 Scripting Games</a>, in an effort to give people an idea of what the events would look like and involve. There&rsquo;s been a<a href="https://powershell.org/discuss/viewtopic.php?f=39&amp;t=1674">lively discussion</a> in the PowerShell.org forums about the Beginner Practice, so I thought I&rsquo;d weigh in. Here&rsquo;s my solution:<br><a href="https://powershell.org/wp-content/uploads/2013/04/VMware-FusionScreenSnapz001.png"><img src="https://powershell.org/wp-content/uploads/2013/04/VMware-FusionScreenSnapz001.png" alt="Beginner practice event"/><br>
Of course, that&rsquo;s hardly the only way to go about it. I used this approach because it minimizes the use of extra variables, and doesn&rsquo;t create a script-style approach - it&rsquo;s a &ldquo;one-liner,&rdquo; although I&rsquo;ve broken it across several physical lines for readability. I think it makes good use of PowerShell&rsquo;s native ability to deal with multiple objects in a stream - there&rsquo;s no need for a ForEach loop, here.</p>
]]></content:encoded></item><item><title>[UPDATED] Last-Minute Summit Info and Changes</title><link>https://powershell.org/articles/2013-04-18-last-minute-summit-info-and-changes/</link><guid>https://powershell.org/articles/2013-04-18-last-minute-summit-info-and-changes/</guid><pubDate>Thu, 18 Apr 2013 14:19:14 +0000</pubDate><description>&lt;p&gt;Please make sure you&amp;rsquo;re following this announcements category as you travel to, and attend, the Summit. It&amp;rsquo;s the best way for us to get out late-breaking news.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Registration begins&lt;/strong&gt; at 8am on Monday, April 22nd, in the lobby of Building 40. Now, sometimes the lobby doors open a wee bit late - so bear with us. The first sessions aren&amp;rsquo;t until 9am, so there&amp;rsquo;s plenty of time. Please bring a printout of your ticket from EventBrite, and a photo ID.&lt;br&gt;
&lt;strong&gt;Session pre-registration&lt;/strong&gt; didn&amp;rsquo;t happen - we had some volunteers have emergency health issues that just got us behind schedule, so we couldn&amp;rsquo;t get the mobile app thing going. No fear. Sessions will be on a first-come, first-seated basis. Note that we are spread between two adjacent buildings, so you may have to traipse from one to the other during the 15-minute session breaks.&lt;br&gt;
&lt;strong&gt;Meals&lt;/strong&gt; will include a &lt;em&gt;very light continental breakfast&lt;/em&gt; and a lunch. We will endeavor to supply soft drinks throughout the day, but that will require Microsoft employees to shuttle them to us. You&amp;rsquo;re welcome to bring your own soft drinks. We&amp;rsquo;ve got coffee lined up. &lt;em&gt;Please&lt;/em&gt; respect your fellow attendees - we&amp;rsquo;ve ordered enough food for everyone, but that assumes everyone&amp;rsquo;s taking a normal-sized serving. A plate piled high with croissants isn&amp;rsquo;t normal, and deprives your fellow attendees of their share. Seriously - this happened at a conference I was at a couple of weeks ago. Pretty sad.&lt;br&gt;
&lt;strong&gt;Kickoff&lt;/strong&gt; we will have a VERY SHORT kickoff in each session room at 8:45am. We&amp;rsquo;ll endeavor to present all general material in both session rooms, since neither room can accommodate all of us at once. Jason Helmick and myself will be handling those duties throughout the event. You&amp;rsquo;re welcome to come to us with any problems you run into.&lt;br&gt;
&lt;strong&gt;Problems&lt;/strong&gt; may arise - bear in mind this is our first year, and just be patient with us. If you bring it to our attention, we&amp;rsquo;ll fix what we can, as soon as we can. We really appreciate your help and patience as we try to make a great event!&lt;br&gt;
&lt;strong&gt;Wi-Fi&lt;/strong&gt; is not guaranteed, and we will not have power drops for everyone&amp;rsquo;s laptop. Please &lt;strong&gt;do not&lt;/strong&gt; stretch your laptop power cord across any walkways - you &lt;strong&gt;will&lt;/strong&gt; be asked to unplug for safety reasons. We suggest leaving the laptop in your hotel room, so help make the room more comfortable for everyone (if everyone brings a laptop and a giant bag for it, it&amp;rsquo;s going to get cramped).&lt;br&gt;
&lt;strong&gt;Parking is limited&lt;/strong&gt; on-site, and you need to make sure you park in a space that isn&amp;rsquo;t restricted. Check-in with the building receptionist to see if your car needs to be registered. You can also park at the ExtendedStay America hotel across the street, and walk to buildings 40 and 41. You&amp;rsquo;re responsible for your own transportation during the event.&lt;br&gt;
&lt;strong&gt;Evening events&lt;/strong&gt; are strictly on-your-own. We don&amp;rsquo;t have anything official planned. If someone puts something together ad-hoc and tells us, we&amp;rsquo;ll do our best to spread the word.&lt;br&gt;
&lt;strong&gt;This is an informal event&lt;/strong&gt; - don&amp;rsquo;t think of the Summit as a conference like TechEd, but rather as a gathering of friends and colleagues. It&amp;rsquo;ll be less structured, more ad-hoc, and hopefully more engaging.&lt;br&gt;
&lt;strong&gt;Please be respectful of speakers&lt;/strong&gt; while they present, and follow their guidelines on when to ask questions. We do have to push them off the stage at the end of their allotted time, so give them their time to complete their presentation for you. If you have additional Q&amp;amp;A after the session ends, please take it into the lobby so that the next session can start.&lt;br&gt;
&lt;strong&gt;MONDAY AT LUNCH&lt;/strong&gt; we will launch the 2013 Scripting Games with an EnergizedTech opening ceremonies video. It&amp;rsquo;ll be a pageant - don&amp;rsquo;t miss it. 12:30pm in each session room.&lt;br&gt;
&lt;strong&gt;WEDNESDAY AT LUNCH&lt;/strong&gt; in the lobby or session room in building 40, you&amp;rsquo;re invited to meet the Summit organizers (if you&amp;rsquo;ve managed to avoid us until then) and offer feedback for 2014.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Please make sure you&rsquo;re following this announcements category as you travel to, and attend, the Summit. It&rsquo;s the best way for us to get out late-breaking news.</p><p><strong>Registration begins</strong> at 8am on Monday, April 22nd, in the lobby of Building 40. Now, sometimes the lobby doors open a wee bit late - so bear with us. The first sessions aren&rsquo;t until 9am, so there&rsquo;s plenty of time. Please bring a printout of your ticket from EventBrite, and a photo ID.<br><strong>Session pre-registration</strong> didn&rsquo;t happen - we had some volunteers have emergency health issues that just got us behind schedule, so we couldn&rsquo;t get the mobile app thing going. No fear. Sessions will be on a first-come, first-seated basis. Note that we are spread between two adjacent buildings, so you may have to traipse from one to the other during the 15-minute session breaks.<br><strong>Meals</strong> will include a<em>very light continental breakfast</em> and a lunch. We will endeavor to supply soft drinks throughout the day, but that will require Microsoft employees to shuttle them to us. You&rsquo;re welcome to bring your own soft drinks. We&rsquo;ve got coffee lined up.<em>Please</em> respect your fellow attendees - we&rsquo;ve ordered enough food for everyone, but that assumes everyone&rsquo;s taking a normal-sized serving. A plate piled high with croissants isn&rsquo;t normal, and deprives your fellow attendees of their share. Seriously - this happened at a conference I was at a couple of weeks ago. Pretty sad.<br><strong>Kickoff</strong> we will have a VERY SHORT kickoff in each session room at 8:45am. We&rsquo;ll endeavor to present all general material in both session rooms, since neither room can accommodate all of us at once. Jason Helmick and myself will be handling those duties throughout the event. You&rsquo;re welcome to come to us with any problems you run into.<br><strong>Problems</strong> may arise - bear in mind this is our first year, and just be patient with us. If you bring it to our attention, we&rsquo;ll fix what we can, as soon as we can. We really appreciate your help and patience as we try to make a great event!<br><strong>Wi-Fi</strong> is not guaranteed, and we will not have power drops for everyone&rsquo;s laptop. Please<strong>do not</strong> stretch your laptop power cord across any walkways - you<strong>will</strong> be asked to unplug for safety reasons. We suggest leaving the laptop in your hotel room, so help make the room more comfortable for everyone (if everyone brings a laptop and a giant bag for it, it&rsquo;s going to get cramped).<br><strong>Parking is limited</strong> on-site, and you need to make sure you park in a space that isn&rsquo;t restricted. Check-in with the building receptionist to see if your car needs to be registered. You can also park at the ExtendedStay America hotel across the street, and walk to buildings 40 and 41. You&rsquo;re responsible for your own transportation during the event.<br><strong>Evening events</strong> are strictly on-your-own. We don&rsquo;t have anything official planned. If someone puts something together ad-hoc and tells us, we&rsquo;ll do our best to spread the word.<br><strong>This is an informal event</strong> - don&rsquo;t think of the Summit as a conference like TechEd, but rather as a gathering of friends and colleagues. It&rsquo;ll be less structured, more ad-hoc, and hopefully more engaging.<br><strong>Please be respectful of speakers</strong> while they present, and follow their guidelines on when to ask questions. We do have to push them off the stage at the end of their allotted time, so give them their time to complete their presentation for you. If you have additional Q&amp;A after the session ends, please take it into the lobby so that the next session can start.<br><strong>MONDAY AT LUNCH</strong> we will launch the 2013 Scripting Games with an EnergizedTech opening ceremonies video. It&rsquo;ll be a pageant - don&rsquo;t miss it. 12:30pm in each session room.<br><strong>WEDNESDAY AT LUNCH</strong> in the lobby or session room in building 40, you&rsquo;re invited to meet the Summit organizers (if you&rsquo;ve managed to avoid us until then) and offer feedback for 2014.</p><p><strong>Company Store</strong> vouchers may be are a reality, thanks to The Scripting Guy. You will need to use Microsoft transportation to get to Commons, where the Store is located; you&rsquo;ll be able to spend your own money, up to the voucher limit, to purchase products at employee prices. These products MAY NOT BE RESOLD and are for your personal use (they may be given as gifts). </p><p><strong>PowerShell.org</strong> stickers will be available at registration - please, limit 1 per person. We only brought a limited supply.<br><strong>THANK YOU TO OUR VOLUNTEERS</strong> who are helping make the Summit happen - Christopher Gannon and The Scripting Wife, Teresa Wilson, will be running registration and guarding our food from poachers. Jason Helmick will be helping me with room monitoring, pacing, and general content presentations. Kirk Munro ran content selection and speaker relations. And of course, all of our speakers are presenting on their own time, without compensation, although we&rsquo;ve been able to cover most of their travel expenses.<br><strong>2014 is coming.</strong> We&rsquo;re planning a bigger event, but that means a bigger commitment - we will nee about 130 people to break even (although we&rsquo;ll be able to handle about 250, if things go as planned). We hope you&rsquo;ll help us publicize the 2014 event when the time comes, so that we can make it happen for you.<br><em><strong>THANK YOU AND SEE YOU IN REDMOND!</strong></em></p>
]]></content:encoded></item><item><title>What are Your PowerShell Newbie Gotchas?</title><link>https://powershell.org/articles/2013-04-18-what-are-your-powershell-newbie-gotchas/</link><guid>https://powershell.org/articles/2013-04-18-what-are-your-powershell-newbie-gotchas/</guid><pubDate>Thu, 18 Apr 2013 13:55:31 +0000</pubDate><description>&lt;p&gt;I&amp;rsquo;m putting together a list of common &amp;ldquo;gotchas&amp;rdquo; for PowerShell, mainly things that affect newcomers. So far, I&amp;rsquo;ve got:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Piping the output of a Format cmdlet to nearly anything else&lt;/li&gt;
&lt;li&gt;Using -contains instead of -like&lt;/li&gt;
&lt;li&gt;Selecting a subset of object properties and then trying to sort/fiter on a now-missing property&lt;/li&gt;
&lt;li&gt;Wrong syntax for -filter parameters on various commands&lt;/li&gt;
&lt;li&gt;Commands that don&amp;rsquo;t produce pipeline output (e.g., piping Export-CSV to something)&lt;/li&gt;
&lt;li&gt;Using ConvertTo-HTML without -Fragment and appending multiple pages in one file&lt;/li&gt;
&lt;li&gt;Confusion with ( [ { and the other punctuation&lt;/li&gt;
&lt;li&gt;Concatenating strings (hard) vs. using double quotes (easier)&lt;/li&gt;
&lt;li&gt;$ not being part of the variable name (esp with -ErrorVariable)&lt;/li&gt;
&lt;li&gt;Accumulating objects in a variable and returning it, vs. outputting to the pipeline directly&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What are your &amp;ldquo;gotchas?&amp;rdquo;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I&rsquo;m putting together a list of common &ldquo;gotchas&rdquo; for PowerShell, mainly things that affect newcomers. So far, I&rsquo;ve got:</p><ul><li>Piping the output of a Format cmdlet to nearly anything else</li><li>Using -contains instead of -like</li><li>Selecting a subset of object properties and then trying to sort/fiter on a now-missing property</li><li>Wrong syntax for -filter parameters on various commands</li><li>Commands that don&rsquo;t produce pipeline output (e.g., piping Export-CSV to something)</li><li>Using ConvertTo-HTML without -Fragment and appending multiple pages in one file</li><li>Confusion with ( [ { and the other punctuation</li><li>Concatenating strings (hard) vs. using double quotes (easier)</li><li>$ not being part of the variable name (esp with -ErrorVariable)</li><li>Accumulating objects in a variable and returning it, vs. outputting to the pipeline directly</li></ul><p>What are your &ldquo;gotchas?&rdquo;</p>
]]></content:encoded></item><item><title>Scripting Games Competitor Guide / Instructions Update</title><link>https://powershell.org/articles/2013-04-18-scripting-games-competitor-guide-instructions-update/</link><guid>https://powershell.org/articles/2013-04-18-scripting-games-competitor-guide-instructions-update/</guid><pubDate>Thu, 18 Apr 2013 13:41:21 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;ve made some minor fixes and clarifications to the 2013 Scripting Games Competitors&amp;rsquo; Guide and Instructions booklet. I encourage you to &lt;a href="https://powershell.org/the-scripting-games/" title="The Scripting Games"&gt;download them and review them&lt;/a&gt; once more before we kick off next week.&lt;br&gt;
In addition, we have some additional prizes for our winners in each event - I&amp;rsquo;ve updated the &lt;a href="https://powershell.org/2013/04/17/scripting-games-2013-prize-list/" title="[UPDATED] Scripting Games 2013 Prize List"&gt;prize list post&lt;/a&gt; to include this new information. That post, going forward, will be the authoritative prize list.&lt;br&gt;
Registration is now open, and the Games will formally kick off on April 22nd. The first event opens April 25th. Please rely on the &lt;a href="https://powershell.org/the-scripting-games/" title="The Scripting Games"&gt;Scripting Games Home Page&lt;/a&gt; for a complete list of links and information, and make sure you&amp;rsquo;re watching this &lt;a href="https://powershell.org/category/announcements/scripting-games/"&gt;announcement category&lt;/a&gt; for breaking news. Because we are not collecting e-mail addresses, this is the best way for us to communicate with you.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;ve made some minor fixes and clarifications to the 2013 Scripting Games Competitors&rsquo; Guide and Instructions booklet. I encourage you to<a href="https://powershell.org/the-scripting-games/" title="The Scripting Games">download them and review them</a> once more before we kick off next week.<br>
In addition, we have some additional prizes for our winners in each event - I&rsquo;ve updated the<a href="https://powershell.org/2013/04/17/scripting-games-2013-prize-list/" title="[UPDATED] Scripting Games 2013 Prize List">prize list post</a> to include this new information. That post, going forward, will be the authoritative prize list.<br>
Registration is now open, and the Games will formally kick off on April 22nd. The first event opens April 25th. Please rely on the<a href="https://powershell.org/the-scripting-games/" title="The Scripting Games">Scripting Games Home Page</a> for a complete list of links and information, and make sure you&rsquo;re watching this<a href="https://powershell.org/category/announcements/scripting-games/">announcement category</a> for breaking news. Because we are not collecting e-mail addresses, this is the best way for us to communicate with you.</p>
]]></content:encoded></item><item><title>Pre-Summit Hang</title><link>https://powershell.org/articles/2013-04-17-pre-summit-hang/</link><guid>https://powershell.org/articles/2013-04-17-pre-summit-hang/</guid><pubDate>Thu, 18 Apr 2013 01:15:57 +0000</pubDate><description>&lt;p&gt;If you&amp;rsquo;re attending the Summit and are arriving Sunday afternoon, drop by the Azteca restaurant on 148th. I&amp;rsquo;ll be there with some of the Board from 5pm, in the bar. It&amp;rsquo;s informal, pay-your-own-way, and a chance just to say hi before we kick off on Monday. Safe journey!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>If you&rsquo;re attending the Summit and are arriving Sunday afternoon, drop by the Azteca restaurant on 148th. I&rsquo;ll be there with some of the Board from 5pm, in the bar. It&rsquo;s informal, pay-your-own-way, and a chance just to say hi before we kick off on Monday. Safe journey!</p>
]]></content:encoded></item><item><title>[UPDATED] Scripting Games 2013 Prize List</title><link>https://powershell.org/articles/2013-04-17-scripting-games-2013-prize-list/</link><guid>https://powershell.org/articles/2013-04-17-scripting-games-2013-prize-list/</guid><pubDate>Wed, 17 Apr 2013 13:51:41 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;ve finalized the prizes!&lt;/p&gt;
&lt;h2 id="overall-winners" class="ps-heading"&gt;Overall Winners&lt;a class="ps-heading-anchor" href="#overall-winners" 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;These are the folks who do the best overall. This prize will be awarded in mid-June.&lt;br&gt;
The &lt;strong&gt;overall winners&lt;/strong&gt; from both the Advanced and Beginner events will win a free pass (travel expenses not included) to TechEd North America 2014 or TechEd Europe 2013 - your choice. We realize the TechEd Europe dates are pretty close to when this prize will be awarded&amp;hellip; so we&amp;rsquo;ll try and intervene and make it a 2014 pass, if we can.&lt;br&gt;
Second place overall winners will receive a SAPIEN Software Suite 2012, valued at $699, from SAPIEN Technologies.&lt;br&gt;
Third place overall winners will receive 5 ebooks (per person) from Manning.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;ve finalized the prizes!</p><h2 id="overall-winners" class="ps-heading">Overall Winners<a class="ps-heading-anchor" href="#overall-winners" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>These are the folks who do the best overall. This prize will be awarded in mid-June.<br>
The<strong>overall winners</strong> from both the Advanced and Beginner events will win a free pass (travel expenses not included) to TechEd North America 2014 or TechEd Europe 2013 - your choice. We realize the TechEd Europe dates are pretty close to when this prize will be awarded&hellip; so we&rsquo;ll try and intervene and make it a 2014 pass, if we can.<br>
Second place overall winners will receive a SAPIEN Software Suite 2012, valued at $699, from SAPIEN Technologies.<br>
Third place overall winners will receive 5 ebooks (per person) from Manning.</p><h2 id="event-winners" class="ps-heading">Event Winners<a class="ps-heading-anchor" href="#event-winners" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>These folks place top in each event, with one prize available per track. We&rsquo;ll award a free ebook from Manning. In addition, the top placer in Event 6 (which is the toughest) will win a copy of PrimalScript 2012 from SAPIEN, and the top placer in Event 5 will win a copy of PowerShell Studio 2012 from SAPIEN.<br>
Second-place for each event will win 6 months of free video training library access from<a href="http://videotraining.interfacett.com">Interface Technical Training</a>.<br>
Third-place for each event will win a free year of<a href="http://phoneominal.com">Phoneominal</a> cloud-based phone line service from Start-Automating.com.<br>
For the competitors who earn the top CrowdScore vote in each event, we&rsquo;ll award a free ebook from Manning.</p><h2 id="prizes-for-community-voting" class="ps-heading">Prizes for Community Voting<a class="ps-heading-anchor" href="#prizes-for-community-voting" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Each time you vote on an entry, whether your competing or not, you earn a chance to win a prize. See - you can win without even trying hard! We&rsquo;ll be awarding a total of four $50.00 gift certificates to the SAPIEN Technologies online store, and a total of 20 ebooks from Manning, along with 12 one-month passes to the Interface Technical Training video training library. So that&rsquo;s 36 chances to win! We will award these prizes in batches after voting closes on each event (meaning we&rsquo;ll award about 6 prizes per event - we will<strong>not</strong> be resetting pointlet counts, so any pointlets earned will count toward prizes in each event).<br>
In addition, our top two voters will receive a complimentary pass (no travel included) to the PowerShell Summit North America 2014. That&rsquo;s pretty impressive! We will be looking at the quality, consistency, and fairness of your votes - so if you do bubble up to be a top voter, you&rsquo;ll be scrutinized to make sure you were voting fairly. We&rsquo;ll also be weighting votes that are accompanied by comments (good, useful comments, not gibberish or two-word &ldquo;nice script&rdquo; comments), meaning commenting is more likely to make you a winner!</p>
]]></content:encoded></item><item><title>Changes Coming to PowerShell.org</title><link>https://powershell.org/articles/2013-04-15-changes-coming-to-powershell-org/</link><guid>https://powershell.org/articles/2013-04-15-changes-coming-to-powershell-org/</guid><pubDate>Mon, 15 Apr 2013 20:34:04 +0000</pubDate><description>&lt;p&gt;If you&amp;rsquo;ve been on the site today, you&amp;rsquo;ve doubtless noticed some of the visual changes. In addition to providing a simpler theme that - over time - will be more mobile-friendly, we&amp;rsquo;re also lining up for a major move of our discussion forums. That&amp;rsquo;ll probably happen after TechEd, but we may be able to squeeze it in prior.&lt;/p&gt;
&lt;p&gt;The existing forums are fine, but they&amp;rsquo;re a bit heavy in the code department, and hard to maintain. We&amp;rsquo;ve also gotten a bit bloated with the categories. Sorry about that. Anyway, the plan is to move to an integrated forums, a simpler hierarchy, and better notification options. It&amp;rsquo;ll make it a lot easier for us moderators to help answer questions.&lt;br&gt;
We&amp;rsquo;ll be archiving the old content, so it&amp;rsquo;ll still be accessible and searchable. However&amp;hellip; and here&amp;rsquo;s the rub&amp;hellip; we&amp;rsquo;re gonna ditch your user accounts. We have to. The old database is cloggy with spambots, and we just need to get away from it. We&amp;rsquo;re going to offer integrated login (Twitter, Facebook, LinkedIn, a bunch others), so you won&amp;rsquo;t have to entrust your password to us any longer if you don&amp;rsquo;t want to. We are not linking the old forums to this WordPress site. You&amp;rsquo;ll be creating a NEW login here, and it can use those external authentication systems. The NEW login you create HERE will be completely separate from any login you have in the existing, old forums. You don&amp;rsquo;t need to create a new account now - you can wait until the new forums go live.&lt;br&gt;
Anyway&amp;hellip; that&amp;rsquo;s all ahead. Love to hear your thoughts as we continue planning.&lt;br&gt;
There&amp;rsquo;s another thing: The PowerShell People site. To be honest, that was created as a kind of&amp;hellip; game/toy. Something to see if I could do. We&amp;rsquo;ve gotten a few people using it but not many, and it just kind of sits there on its own. We&amp;rsquo;re probably going to be spinning that down, but we&amp;rsquo;re going to take what we learned from it and try and incorporate something into this main site. No firm ideas, yet, and we&amp;rsquo;d appreciate any you may have.&lt;br&gt;
In the meantime, we&amp;rsquo;ve already implemented a few changes. The new site theme is perhaps the most obvious; you&amp;rsquo;ll notice that we&amp;rsquo;ve also moved a lot of static pages - like the newsletter, Scripting Games, and Summit pages - into the new theme. We&amp;rsquo;ve also enabled single sign-on to the site, using Facebook, Twitter, Google, OpenID, WordPress.com, and Live ID (or whatever Microsoft is calling it this week).&lt;br&gt;
Thanks!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>If you&rsquo;ve been on the site today, you&rsquo;ve doubtless noticed some of the visual changes. In addition to providing a simpler theme that - over time - will be more mobile-friendly, we&rsquo;re also lining up for a major move of our discussion forums. That&rsquo;ll probably happen after TechEd, but we may be able to squeeze it in prior.</p><p>The existing forums are fine, but they&rsquo;re a bit heavy in the code department, and hard to maintain. We&rsquo;ve also gotten a bit bloated with the categories. Sorry about that. Anyway, the plan is to move to an integrated forums, a simpler hierarchy, and better notification options. It&rsquo;ll make it a lot easier for us moderators to help answer questions.<br>
We&rsquo;ll be archiving the old content, so it&rsquo;ll still be accessible and searchable. However&hellip; and here&rsquo;s the rub&hellip; we&rsquo;re gonna ditch your user accounts. We have to. The old database is cloggy with spambots, and we just need to get away from it. We&rsquo;re going to offer integrated login (Twitter, Facebook, LinkedIn, a bunch others), so you won&rsquo;t have to entrust your password to us any longer if you don&rsquo;t want to. We are not linking the old forums to this WordPress site. You&rsquo;ll be creating a NEW login here, and it can use those external authentication systems. The NEW login you create HERE will be completely separate from any login you have in the existing, old forums. You don&rsquo;t need to create a new account now - you can wait until the new forums go live.<br>
Anyway&hellip; that&rsquo;s all ahead. Love to hear your thoughts as we continue planning.<br>
There&rsquo;s another thing: The PowerShell People site. To be honest, that was created as a kind of&hellip; game/toy. Something to see if I could do. We&rsquo;ve gotten a few people using it but not many, and it just kind of sits there on its own. We&rsquo;re probably going to be spinning that down, but we&rsquo;re going to take what we learned from it and try and incorporate something into this main site. No firm ideas, yet, and we&rsquo;d appreciate any you may have.<br>
In the meantime, we&rsquo;ve already implemented a few changes. The new site theme is perhaps the most obvious; you&rsquo;ll notice that we&rsquo;ve also moved a lot of static pages - like the newsletter, Scripting Games, and Summit pages - into the new theme. We&rsquo;ve also enabled single sign-on to the site, using Facebook, Twitter, Google, OpenID, WordPress.com, and Live ID (or whatever Microsoft is calling it this week).<br>
Thanks!</p>
]]></content:encoded></item><item><title>Scripting Games Instructions Now Available</title><link>https://powershell.org/articles/2013-04-13-scripting-games-instructions-now-available/</link><guid>https://powershell.org/articles/2013-04-13-scripting-games-instructions-now-available/</guid><pubDate>Sat, 13 Apr 2013 19:51:09 +0000</pubDate><description>&lt;p&gt;I&amp;rsquo;ve &lt;a href="https://powershell.org/games"&gt;posted an instruction booklet&lt;/a&gt; for the 2013 Scripting Games. Although you can&amp;rsquo;t register until April 22nd, you can get a sneak peek at what the new Games Web site looks like, and start preparing yourself to compete.&lt;br&gt;
&lt;strong&gt;READ THE FRIENDLY MANUAL.&lt;/strong&gt;&lt;br&gt;
There are some one-time decisions you&amp;rsquo;ll have to make, and some &amp;ldquo;if you mess this up, you&amp;rsquo;re screwed&amp;rdquo; moments (like forgetting your password). It&amp;rsquo;s all on you - so familiarize yourself with the potential &amp;ldquo;gotchas&amp;rdquo; right away. You&amp;rsquo;re welcome to leave a comment on this post if you have any questions, or &lt;a href="https://powershell.org/discuss/viewforum.php?f=39&amp;amp;sid=bf378a7ec4e2c6748515b1d3bb87429f"&gt;ask in the forums&lt;/a&gt;.&lt;br&gt;
Note that the forums &lt;strong&gt;may not be used&lt;/strong&gt; to ask for feedback on your entry from judges - they won&amp;rsquo;t be monitoring the forum. It should also not be used for technical support questions about the Web site; the site will have a &amp;ldquo;feedback&amp;rdquo; link on the bottom of every page for that purpose.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I&rsquo;ve<a href="https://powershell.org/games">posted an instruction booklet</a> for the 2013 Scripting Games. Although you can&rsquo;t register until April 22nd, you can get a sneak peek at what the new Games Web site looks like, and start preparing yourself to compete.<br><strong>READ THE FRIENDLY MANUAL.</strong><br>
There are some one-time decisions you&rsquo;ll have to make, and some &ldquo;if you mess this up, you&rsquo;re screwed&rdquo; moments (like forgetting your password). It&rsquo;s all on you - so familiarize yourself with the potential &ldquo;gotchas&rdquo; right away. You&rsquo;re welcome to leave a comment on this post if you have any questions, or<a href="https://powershell.org/discuss/viewforum.php?f=39&amp;sid=bf378a7ec4e2c6748515b1d3bb87429f">ask in the forums</a>.<br>
Note that the forums<strong>may not be used</strong> to ask for feedback on your entry from judges - they won&rsquo;t be monitoring the forum. It should also not be used for technical support questions about the Web site; the site will have a &ldquo;feedback&rdquo; link on the bottom of every page for that purpose.</p>
]]></content:encoded></item><item><title>PowerShell Deep Dives"“another MEAP release</title><link>https://powershell.org/articles/2013-04-13-powershell-deep-dives-another-meap-release-2/</link><guid>https://powershell.org/articles/2013-04-13-powershell-deep-dives-another-meap-release-2/</guid><pubDate>Sat, 13 Apr 2013 17:24:52 +0000</pubDate><description>&lt;p&gt;Manning have released another set of chapters in their early access program for &lt;a href="http://www.manning.com/hicks/"&gt;PowerShell Deep Dives&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you have an interest in PowerShell I would strongly urge you to buy a copy. It has chapters from a number of well known PowerShell authors together with some very good material from new authors. Best of all the royalties are going to charity.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2834/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2834/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2834&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Manning have released another set of chapters in their early access program for<a href="http://www.manning.com/hicks/">PowerShell Deep Dives</a>.</p><p>If you have an interest in PowerShell I would strongly urge you to buy a copy. It has chapters from a number of well known PowerShell authors together with some very good material from new authors. Best of all the royalties are going to charity.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2834/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2834/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2834&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Busy, busy, busy</title><link>https://powershell.org/articles/2013-04-13-busy-busy-busy-2/</link><guid>https://powershell.org/articles/2013-04-13-busy-busy-busy-2/</guid><pubDate>Sat, 13 Apr 2013 17:17:13 +0000</pubDate><description>&lt;p&gt;A very busy time coming up in PowerShell land with the first PowerShell Summit kicking off in just over a week&amp;quot;™s time. The 2013 Scripting Games will also be starting very soon.&lt;/p&gt;
&lt;p&gt;I&amp;quot;™ll try and post about both of them as time allows&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2832/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2832/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2832&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>A very busy time coming up in PowerShell land with the first PowerShell Summit kicking off in just over a week"™s time. The 2013 Scripting Games will also be starting very soon.</p><p>I"™ll try and post about both of them as time allows</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2832/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2832/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2832&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Creating a new disk</title><link>https://powershell.org/articles/2013-04-12-creating-a-new-disk-3/</link><guid>https://powershell.org/articles/2013-04-12-creating-a-new-disk-3/</guid><pubDate>Fri, 12 Apr 2013 18:44:16 +0000</pubDate><description>&lt;p&gt;I really like Windows Server Core. The concept has come of age in Windows 2012.&lt;/p&gt;
&lt;p&gt;I needed to add a new disk to a virtual machine – that&amp;quot;™s easy using the Hyper-V cmdlets. But what about formating the disk.&lt;/p&gt;
&lt;p&gt;A module new to Windows 2012 &amp;amp; Windows can be used. Its the Storage module. I&amp;quot;™ve not had chance, or reason, to play with this module yet. So many cmdlets so little time.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I really like Windows Server Core. The concept has come of age in Windows 2012.</p><p>I needed to add a new disk to a virtual machine – that"™s easy using the Hyper-V cmdlets. But what about formating the disk.</p><p>A module new to Windows 2012 &amp; Windows can be used. Its the Storage module. I"™ve not had chance, or reason, to play with this module yet. So many cmdlets so little time.</p><p>Start with viewing the disks:</p><p>PS C:\Users\richard&gt; Get-Disk | ft -a</p><p>Number Friendly Name OperationalStatus Total Size Partition Style
—— ————- —————– ———- —————
0 Virtual HD ATA Device Online 120 GB MBR
1 Microsoft Virtual Disk Offline 127 GB RAW</p><p>Disk 1 is the new disk so need to initialise it.</p><p>PS C:\Users\richard&gt; Initialize-Disk -Number 1 -PartitionStyle MBR</p><p>View the disks again</p><p>PS C:\Users\richard&gt; Get-Disk | ft -a</p><p>Number Friendly Name OperationalStatus Total Size Partition Style
—— ————- —————– ———- —————
0 Virtual HD ATA Device Online 120 GB MBR
1 Microsoft Virtual Disk Online 127 GB MBR</p><p>Create a partition on the disk - -useMaximimSize means use all of the disk for this partition</p><p>PS C:\Users\richard&gt; New-Partition -DiskNumber 1 -UseMaximumSize -DriveLetter R</p><p>Now view the partitions</p><p>PS C:\Users\richard&gt; Get-Partition | ft -a</p><p>Disk Number: 0</p><p>PartitionNumber DriveLetter Offset Size Type
————— ———– —— —- —-
1 1048576 350 MB IFS
2 C 368050176 119.66 GB IFS</p><p>Disk Number: 1</p><p>PartitionNumber DriveLetter Offset Size Type
————— ———– —— —- —-
1 R 1048576 127 GB Logical</p><p>And finally format the new disk:</p><p>PS C:\Users\richard&gt; Get-Volume | where DriveLetter -eq R | Format-Volume -FileSystem NTFS -NewFileSystemLabel Backup</p><p>Confirm<br>
Are you sure you want to perform this action?<br>
Warning, all data on the volume will be lost!<br>
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is &ldquo;Y&rdquo;): Y</p><p>You get a nice friendly warning (you could bypass using &ldquo;“Confirm $false) and the format happens</p><p>You could pipe the cmdlets together to do everything in one pass. Best of all &ldquo;“ the cmdlets are WMI based.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2830/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2830/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2830&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Windows Server Backup</title><link>https://powershell.org/articles/2013-04-11-windows-server-backup-4/</link><guid>https://powershell.org/articles/2013-04-11-windows-server-backup-4/</guid><pubDate>Thu, 11 Apr 2013 19:50:36 +0000</pubDate><description>&lt;p&gt;Windows Server 2012 has a PowerShell enabled backup utility. When you enable the feature you get a module called WindowsServerBackup. It has the cmldets you would expect for creating and managing backups. No surprise you may say as this was avialable in Windows 2008 R2.&lt;/p&gt;
&lt;p&gt;The difference with Windows Server 2012 is that you can do restores from PowerShell cmdlets whcih wasn&amp;quot;™t available in the earlier version.&lt;/p&gt;
&lt;p&gt;The restore cmdlets are&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Windows Server 2012 has a PowerShell enabled backup utility. When you enable the feature you get a module called WindowsServerBackup. It has the cmldets you would expect for creating and managing backups. No surprise you may say as this was avialable in Windows 2008 R2.</p><p>The difference with Windows Server 2012 is that you can do restores from PowerShell cmdlets whcih wasn"™t available in the earlier version.</p><p>The restore cmdlets are</p><p>Start-WBFileRecovery</p><p>Start-WBHyperVRecovery</p><p>Start-WBSystemStateRecovery</p><p>Start-WBVolumeRecovery</p><p>This might not replace your currebt backup system but is very useful for backing up test environments and experimenting with things like authorative AD restores.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2828/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2828/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2828&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>[UPDATED] Time is running out to own a piece of PowerShell.org</title><link>https://powershell.org/articles/2013-04-11-time-is-running-out-to-own-a-piece-of-powershell-org/</link><guid>https://powershell.org/articles/2013-04-11-time-is-running-out-to-own-a-piece-of-powershell-org/</guid><pubDate>Thu, 11 Apr 2013 08:25:30 +0000</pubDate><description>&lt;p&gt;Believe it or not, we are coming up on our one year anniversary, and will be winding down our capital campaign. If you&amp;rsquo;d like to become a stockholder in PowerShell.org, you will have until June 1st May 15 to do so. Read the details at &lt;a href="https://powershell.org/discuss/viewtopic.php?f=26&amp;amp;t=239"&gt;https://powershell.org/discuss/viewtopic.php?f=26&amp;amp;t=239&lt;/a&gt; if you&amp;rsquo;re interested!&lt;br&gt;
&lt;strong&gt;Updated&lt;/strong&gt; to show May 15 as the cutoff date. Our shareholder meeting notices and ballots will go out on May 16, so we can&amp;rsquo;t accept new stock purchases after that date.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Believe it or not, we are coming up on our one year anniversary, and will be winding down our capital campaign. If you&rsquo;d like to become a stockholder in PowerShell.org, you will have until June 1st May 15 to do so. Read the details at<a href="https://powershell.org/discuss/viewtopic.php?f=26&amp;t=239">https://powershell.org/discuss/viewtopic.php?f=26&amp;t=239</a> if you&rsquo;re interested!<br><strong>Updated</strong> to show May 15 as the cutoff date. Our shareholder meeting notices and ballots will go out on May 16, so we can&rsquo;t accept new stock purchases after that date.</p>
]]></content:encoded></item><item><title>Running workflows</title><link>https://powershell.org/articles/2013-04-08-running-workflows/</link><guid>https://powershell.org/articles/2013-04-08-running-workflows/</guid><pubDate>Mon, 08 Apr 2013 17:12:38 +0000</pubDate><description>&lt;p&gt;I tripped over an interesting issue recently regarding the running of PowerShell workflows.&lt;/p&gt;
&lt;p&gt;Consider the world&amp;quot;™s simplest workflow&lt;/p&gt;
&lt;p&gt;workflow test-w1 {&amp;ldquo;hello world&amp;rdquo;}&lt;/p&gt;
&lt;p&gt;If I run this on a 32bit Windows 8 PowerShell machine &amp;ldquo;“ it works&lt;/p&gt;
&lt;p&gt;If I run this on Windows 2012 (64bit) on PowerShell it works&lt;/p&gt;
&lt;p&gt;if I run this on Windows 2012 PowerShell (x86) &amp;ldquo;“ it doesn&amp;rdquo;™t work!&lt;/p&gt;
&lt;p&gt;Be aware of how you are running your workflows&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I tripped over an interesting issue recently regarding the running of PowerShell workflows.</p><p>Consider the world"™s simplest workflow</p><p>workflow test-w1 {&ldquo;hello world&rdquo;}</p><p>If I run this on a 32bit Windows 8 PowerShell machine &ldquo;“ it works</p><p>If I run this on Windows 2012 (64bit) on PowerShell it works</p><p>if I run this on Windows 2012 PowerShell (x86) &ldquo;“ it doesn&rdquo;™t work!</p><p>Be aware of how you are running your workflows</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2827/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2827/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2827&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>PhillyPoSH 04/04/2013 meeting summary</title><link>https://powershell.org/articles/2013-04-07-phillyposh-04042013-meeting-summary/</link><guid>https://powershell.org/articles/2013-04-07-phillyposh-04042013-meeting-summary/</guid><pubDate>Mon, 08 Apr 2013 02:58:13 +0000</pubDate><description>&lt;ol&gt;
&lt;li&gt;&lt;a href="http://www.jasonhelmick.com/"&gt;Jason Helmick&lt;/a&gt; remotely gave a demo of &lt;a href="http://sapien.com/software/powershell_studio"&gt;Sapien&amp;quot;™s Powershell Studio&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.edwilson.com/"&gt;Ed Wilson&lt;/a&gt;, &lt;a href="http://blogs.technet.com/b/heyscriptingguy/"&gt;The Scripting Guy&lt;/a&gt;, gave a presentation on the different ways to remotely manage a Windows 8 workstation (remotely via the &lt;a href="http://powershellgroup.org/charlotte.nc"&gt;Charlotte PowerShell User Group&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Announcements
&lt;ol&gt;
&lt;li&gt;The &lt;a href="https://powershell.org/category/announcements/scripting-games/"&gt;Scripting games start&lt;/a&gt; on &lt;a href="https://powershell.org/2013/04/03/2013-scripting-games-schedule/"&gt;04/25/2013,&lt;/a&gt; make sure to sign up! We plan on doing a post mortem once the games are done just like we did with the &lt;a href="https://powershell.org/2013/03/10/phillyposh-03072013-meeting-summary-and-presentation-materials/"&gt;Winter Scripting Camp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Check out the &lt;a href="http://mspsug.com/"&gt;Mississippi PowerShell User&lt;/a&gt;, which meets virtually every 2nd Tuesday. Take a look at their &lt;a href="http://mspsug.com/2013/02/27/mississippi-powershell-user-group-speaker-lineup-for-2013/"&gt;schedule which is filled with great speakers&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;</description><content:encoded>&lt;![CDATA[<ol><li><a href="http://www.jasonhelmick.com/">Jason Helmick</a> remotely gave a demo of<a href="http://sapien.com/software/powershell_studio">Sapien"™s Powershell Studio</a></li><li><a href="http://www.edwilson.com/">Ed Wilson</a>, <a href="http://blogs.technet.com/b/heyscriptingguy/">The Scripting Guy</a>, gave a presentation on the different ways to remotely manage a Windows 8 workstation (remotely via the <a href="http://powershellgroup.org/charlotte.nc">Charlotte PowerShell User Group</a>)</li><li>Announcements<ol><li>The<a href="https://powershell.org/category/announcements/scripting-games/">Scripting games start</a> on<a href="https://powershell.org/2013/04/03/2013-scripting-games-schedule/">04/25/2013,</a> make sure to sign up! We plan on doing a post mortem once the games are done just like we did with the<a href="https://powershell.org/2013/03/10/phillyposh-03072013-meeting-summary-and-presentation-materials/">Winter Scripting Camp</a></li><li>Check out the<a href="http://mspsug.com/">Mississippi PowerShell User</a>, which meets virtually every 2nd Tuesday. Take a look at their<a href="http://mspsug.com/2013/02/27/mississippi-powershell-user-group-speaker-lineup-for-2013/">schedule which is filled with great speakers</a>.</li></ol></li></ol>
]]></content:encoded></item><item><title>AD Management in a Month of Lunches</title><link>https://powershell.org/articles/2013-04-06-ad-management-in-a-month-of-lunches/</link><guid>https://powershell.org/articles/2013-04-06-ad-management-in-a-month-of-lunches/</guid><pubDate>Sat, 06 Apr 2013 15:40:22 +0000</pubDate><description>&lt;p&gt;The MEAP marches on with chapter 8 now released:&lt;/p&gt;
&lt;p&gt;Chapter 8 &amp;ldquo;“ creating Group Policies&lt;/p&gt;
&lt;p&gt;details from &lt;a href="http://www.manning.com/siddaway3/" title="http://www.manning.com/siddaway3/"&gt;http://www.manning.com/siddaway3/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2826/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2826/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2826&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>The MEAP marches on with chapter 8 now released:</p><p>Chapter 8 &ldquo;“ creating Group Policies</p><p>details from<a href="http://www.manning.com/siddaway3/" title="http://www.manning.com/siddaway3/">http://www.manning.com/siddaway3/</a></p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2826/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2826/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2826&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>2013 Scripting Games Judges</title><link>https://powershell.org/articles/2013-04-06-2013-scripting-games-judges/</link><guid>https://powershell.org/articles/2013-04-06-2013-scripting-games-judges/</guid><pubDate>Sat, 06 Apr 2013 12:32:23 +0000</pubDate><description>&lt;p&gt;As described in the 2013 Scripting Games Competitors&amp;rsquo; Guide, our expert judges this year will not be awarded numeric scores. Frankly, folks seem more interested in having their entries peer-reviewed than just getting a number - and why not? Expert review is a great way to learn! Unfortunately, there aren&amp;rsquo;t enough judges in the world to review all the entries we&amp;rsquo;ll receive, so our judges will be picking their own &amp;ldquo;best and worst&amp;rdquo; lists, and commenting on those (taking care to not reveal authors&amp;rsquo; names, as much as possible).&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>As described in the 2013 Scripting Games Competitors&rsquo; Guide, our expert judges this year will not be awarded numeric scores. Frankly, folks seem more interested in having their entries peer-reviewed than just getting a number - and why not? Expert review is a great way to learn! Unfortunately, there aren&rsquo;t enough judges in the world to review all the entries we&rsquo;ll receive, so our judges will be picking their own &ldquo;best and worst&rdquo; lists, and commenting on those (taking care to not reveal authors&rsquo; names, as much as possible).</p><p>Our judges will be blogging either here on PowerShell.org, or on their own blogs; we&rsquo;ve asked them to all at least post links here at PowerShell.org so that you can find their write-ups. You can use the<a href="https://powershell.org/category/announcements/scripting-games/judges-notes/">Judges&rsquo; Notes blog category</a> to find their posts - and hopefully learn something!<br>
This year&rsquo;s judges (in no special order, other than this is how they&rsquo;re in my address book for some reason):</p><ul><li>Jan Egil Ring</li><li>Jonathan Medd</li><li>Bartek Bielawski</li><li>Sean Kearney</li><li>Richard Siddaway</li><li>Mark Schill</li><li>Art Beane</li><li>Jason Helmick</li><li>Ed Wilson</li><li>Oliver Lipkau</li><li>Glenn Sizemore</li><li>Tobias Weltner</li><li>Boe Pox</li><li>Bhargav Shukla</li></ul><p>Thanks so much to these folks - they&rsquo;re going to be donating a LOT of time to review entries, pick out ones they love, point out ones that could use improvement, and above all tell us<em>why</em> so that we can all learn to do better.<br>
The idea is to have a diversity of opinions. Multiple judges may latch on to the same entries and offer differing advice - and that&rsquo;s<em>awesome</em>, because it helps us all develop new approaches, and understand that in PowerShell there are very few &ldquo;one, right ways&rdquo; to do anything.<br>
The Games begin April 22nd!</p>
]]></content:encoded></item><item><title>2013 Scripting Games' Mighty Panel of Celebrity Judges</title><link>https://powershell.org/articles/2013-04-06-2013-scripting-games-mighty-panel-of-celebrity-judges/</link><guid>https://powershell.org/articles/2013-04-06-2013-scripting-games-mighty-panel-of-celebrity-judges/</guid><pubDate>Sat, 06 Apr 2013 12:21:38 +0000</pubDate><description>&lt;p&gt;As revealed in the &lt;a href="https://powershell.org/games/"&gt;2013 Scripting Games Competitors&amp;rsquo; Guide&lt;/a&gt;, the 2013 Games will invite the community in general to award numeric votes for entries. Our expert judges will instead focus on commentary, helping make the Games into an even better learning experience. They&amp;rsquo;ll be commenting without revealing competitors&amp;rsquo; names, and even if you don&amp;rsquo;t recognize your entry in their comments, you&amp;rsquo;ll hopefully find plenty to learn from.&lt;/p&gt;
&lt;p&gt;Our top prizes, however, will be awarded by a Mighty Panel of Celebrity Judges. They&amp;rsquo;ll review all the other judges&amp;rsquo; top picks, stack-rank them, and through some Ingenious Number Crunchingâ„¢ award the top prizes.&lt;br&gt;
Bet you&amp;rsquo;d like to meet the judges.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>As revealed in the<a href="/games/">2013 Scripting Games Competitors&rsquo; Guide</a>, the 2013 Games will invite the community in general to award numeric votes for entries. Our expert judges will instead focus on commentary, helping make the Games into an even better learning experience. They&rsquo;ll be commenting without revealing competitors&rsquo; names, and even if you don&rsquo;t recognize your entry in their comments, you&rsquo;ll hopefully find plenty to learn from.</p><p>Our top prizes, however, will be awarded by a Mighty Panel of Celebrity Judges. They&rsquo;ll review all the other judges&rsquo; top picks, stack-rank them, and through some Ingenious Number Crunchingâ„¢ award the top prizes.<br>
Bet you&rsquo;d like to meet the judges.</p><ul><li><strong>Don Jones</strong> (that&rsquo;s me) is a Windows PowerShell MVP Award recipient, author of bazillions of books, and one of the most well-known PowerShell educators out there.</li><li><strong>Jeffery Hicks</strong> is also a PowerShell MVP, has also written gobs of books, and does more than a little PowerShell education here and there.</li><li><strong>June Blender</strong> is a former PowerShell team member (who wrote the Get-Help help), still a big PowerShell enthusiast, and has spent a ton of time figuring out how people learn to use the shell.</li><li><strong>Ed Wilson</strong> is the Scripting Guy, and needs absolutely no more introduction than that. He&rsquo;s single-handedly kept scripting alive, and helps us all learn every day with the &ldquo;Hey, Scripting Guy!&rdquo; blog.</li><li><strong>Jon White</strong> - As a member of the PowerShell feature team since its inception, Jon  was the first person in the world to write a production PowerShell script.</li><li><strong>David Simmons</strong> is a proud new member of the PowerShell team, but follower within Microsoft since its early days, and has been involved since the 1980"™s outside of and within Microsoft in development of hi-performance dynamic languages and their runtime engines including various JavaScript engines.</li></ul><p>Finally, this year we&rsquo;re proud to bring a member of the community on board as a judge. Selected from the top posters in the PowerShell.org forums, I bring you&hellip;</p><p><strong>Jakub JareÅ¡</strong> (nohandle in the forums), who lives in Prague, Czech Republic.</p><p>Meet him in his own words:</p><p>Since 2008 he works for Trask solutions a.s. as a system engineer focused on Microsoft desktop operating systems. He enjoys competition and solving problems that everyone else gave up on. Jakub is pretty new to the PowerShell language and the community, he is scripting roughly a year, but during that time he spent all of his free time and energy learning to unleash the power in PowerShell. He is a member of the PowerShell.org, Powershell.com forums, guest writer on PowershellMagazine.com and blogs on PowerShell.cz.</p><p>Welcome, Jakub! This just goes to show that the PowerShell community truly is a diverse one that&rsquo;s constantly growing. I hope<em>everyone</em> will be excited about grading the entries we&rsquo;ll get for each event, and showing your support for your fellow competitors.<br>
The Games commence on April 22nd, 2013!</p>
]]></content:encoded></item><item><title>Coming: Tips for the Scripting Games</title><link>https://powershell.org/articles/2013-04-05-coming-tips-for-the-scripting-games/</link><guid>https://powershell.org/articles/2013-04-05-coming-tips-for-the-scripting-games/</guid><pubDate>Sat, 06 Apr 2013 06:36:05 +0000</pubDate><description>&lt;p&gt;In preparation for the upcoming Scripting Games, the April 2013 issue of the free PowerShell.org TechLetter will feature tips, examples, and advice for helping you do the best in the Games! Remember that the Competitor Guide is now available, so you can start reviewing how the Games will be graded (by the community) and judged this year.&lt;br&gt;
If you&amp;rsquo;re not already receiving the TechLetter, subscribe by April 15th to receive the April issue in your Inbox!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>In preparation for the upcoming Scripting Games, the April 2013 issue of the free PowerShell.org TechLetter will feature tips, examples, and advice for helping you do the best in the Games! Remember that the Competitor Guide is now available, so you can start reviewing how the Games will be graded (by the community) and judged this year.<br>
If you&rsquo;re not already receiving the TechLetter, subscribe by April 15th to receive the April issue in your Inbox!</p>
]]></content:encoded></item><item><title>PowerShell Script that Relaunches as Admin</title><link>https://powershell.org/articles/2013-04-05-powershell-script-that-relaunches-as-admin/</link><guid>https://powershell.org/articles/2013-04-05-powershell-script-that-relaunches-as-admin/</guid><pubDate>Fri, 05 Apr 2013 15:08:17 +0000</pubDate><description>&lt;p&gt;If were following good security practices we run our Windows system with UAC enabled. This means that if you forget to launch your PowerShell prompt as Administrator when you run a script that requires administrative privilege then that script will fail.&lt;/p&gt;
&lt;p&gt;It would be nice to build a mechanism into our script to &amp;ldquo;auto-elevate&amp;rdquo; if UAC is enabled. The trick to doing this is to run Start-Process &amp;ldquo;“verb runas. After that you only need to figure out if the current user is an administrator and if UAC is enabled. And you have to package up the script&amp;rdquo;™s parameters as an array of strings. All of this can be accomplished fairly easily with this bit of PowerShell script:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>If were following good security practices we run our Windows system with UAC enabled. This means that if you forget to launch your PowerShell prompt as Administrator when you run a script that requires administrative privilege then that script will fail.</p><p>It would be nice to build a mechanism into our script to &ldquo;auto-elevate&rdquo; if UAC is enabled. The trick to doing this is to run Start-Process &ldquo;“verb runas. After that you only need to figure out if the current user is an administrator and if UAC is enabled. And you have to package up the script&rdquo;™s parameters as an array of strings. All of this can be accomplished fairly easily with this bit of PowerShell script:</p><p>`function
IsAdministrator
{
$Identity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$Principal = New-Object System.Security.Principal.WindowsPrincipal($Identity)
$Principal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)
}</p><p>function
IsUacEnabled
{
(Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System).EnableLua
-ne
0
}</p><h1 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><h1 id="main-script" class="ps-heading">Main script<a class="ps-heading-anchor" href="#main-script" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><h1 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h1><p>if
(!(IsAdministrator))
{</p><p>if
(IsUacEnabled)
{
[string[]]$argList = @(
&lsquo;-NoProfile&rsquo;
,
&lsquo;-NoExit&rsquo;
,
&lsquo;-File&rsquo;
, $MyInvocation.MyCommand.Path)
$argList += $MyInvocation.BoundParameters.GetEnumerator() | Foreach {
&ldquo;-$($<em>.Key)&rdquo;
,
&ldquo;$($</em>.Value)&rdquo;
}
$argList += $MyInvocation.UnboundArguments
Start-Process PowerShell.exe -Verb Runas -WorkingDirectory $pwd -ArgumentList $argList</p><p>return</p><pre><code>}</code></pre><p>else</p><pre><code>{</code></pre><p>throw</p><p>&ldquo;You must be administrator to run this script&rdquo;</p><pre><code>}</code></pre><p>}</p><p>`If you launch this script from a non-elevated context, it will fire up a new PoweShell session that is elevated assuming UAC is enabled.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/rkeithhill.wordpress.com/276/"><img src="http://feeds.wordpress.com/1.0/comments/rkeithhill.wordpress.com/276/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=rkeithhill.wordpress.com&amp;blog=18780344&amp;%23038;post=276&amp;%23038;subd=rkeithhill&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Manning Deal of the Day "“ April 6 2013</title><link>https://powershell.org/articles/2013-04-04-manning-deal-of-the-day-april-6-2013-2/</link><guid>https://powershell.org/articles/2013-04-04-manning-deal-of-the-day-april-6-2013-2/</guid><pubDate>Thu, 04 Apr 2013 20:42:32 +0000</pubDate><description>&lt;p&gt;My PowerShell and WMI book will be Manning&amp;quot;™s deal of the day for 6 April 2013. The deal will go live at Midnight US ET and will stay active for about 48 hours.&lt;/p&gt;
&lt;p&gt;This is your chance to get the book with a 50% discount.&lt;/p&gt;
&lt;p&gt;Use code dotd0406au at &lt;a href="http://manning.com/siddaway2/"&gt;manning.com/siddaway2/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The Deal of the Day offer also applies to &lt;em&gt;SharePoint Workflow in Action&lt;/em&gt; ****(&lt;a href="http://www.manning.com/wicklund/"&gt;http://www.manning.com/wicklund/&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Enjoy&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2825/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2825/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2825&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>My PowerShell and WMI book will be Manning"™s deal of the day for 6 April 2013. The deal will go live at Midnight US ET and will stay active for about 48 hours.</p><p>This is your chance to get the book with a 50% discount.</p><p>Use code dotd0406au at<a href="http://manning.com/siddaway2/">manning.com/siddaway2/</a></p><p>The Deal of the Day offer also applies to<em>SharePoint Workflow in Action</em> ****(<a href="http://www.manning.com/wicklund/">http://www.manning.com/wicklund/</a>).</p><p>Enjoy</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2825/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2825/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2825&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>2013 Scripting Games Schedule</title><link>https://powershell.org/articles/2013-04-03-2013-scripting-games-schedule/</link><guid>https://powershell.org/articles/2013-04-03-2013-scripting-games-schedule/</guid><pubDate>Thu, 04 Apr 2013 06:26:31 +0000</pubDate><description>&lt;p&gt;Registration for the 2013 Scripting Games will begin April 22nd (check this post in case we need to make a change to that). You will register for &lt;strong&gt;either&lt;/strong&gt; the Beginner or Advanced track.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://powershell.org/games/BeginnerPractice.pdf"&gt;Get the Beginner Track Practice Event&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://powershell.org/games/AdvancedPractice.pdf"&gt;Get the Advanced Track Practice Event&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each event will kick off on a Thursday, which is when you will be able to download the event details in a PDF file. You will have until the end of the following Monday to upload your one and only entry. Please pay attention to the time zone information displayed on the Web site so that you don&amp;rsquo;t misunderstand when the event starts and stops!&lt;br&gt;
The dates in this schedule refer to 00:00 hours, GMT, on the date given. So &amp;ldquo;April 25&amp;rdquo; means &amp;ldquo;00:00 hours on April 25, GMT,&amp;rdquo; or just as the clock ticks from April 24 to April 25 GMT. This is especially important for the end time - &amp;ldquo;April 30&amp;rdquo; means &amp;ldquo;as soon as it stops being April 29, GMT.&amp;rdquo;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Registration for the 2013 Scripting Games will begin April 22nd (check this post in case we need to make a change to that). You will register for<strong>either</strong> the Beginner or Advanced track.</p><ul><li><a href="https://powershell.org/games/BeginnerPractice.pdf">Get the Beginner Track Practice Event</a></li><li><a href="https://powershell.org/games/AdvancedPractice.pdf">Get the Advanced Track Practice Event</a></li></ul><p>Each event will kick off on a Thursday, which is when you will be able to download the event details in a PDF file. You will have until the end of the following Monday to upload your one and only entry. Please pay attention to the time zone information displayed on the Web site so that you don&rsquo;t misunderstand when the event starts and stops!<br>
The dates in this schedule refer to 00:00 hours, GMT, on the date given. So &ldquo;April 25&rdquo; means &ldquo;00:00 hours on April 25, GMT,&rdquo; or just as the clock ticks from April 24 to April 25 GMT. This is especially important for the end time - &ldquo;April 30&rdquo; means &ldquo;as soon as it stops being April 29, GMT.&rdquo;</p><ul><li>Event 1 starts April 25, ends April 30. Voting runs April 30 to May 7.</li><li>Event 2 starts May 2, ends May 7. Voting runs May 7 to May 14.</li><li>Event 3 starts May 9, ends May 14. Voting runs May 14 to May 21.</li><li>Event 4 starts May 16, ends May 21. Voting runs May 21 to May 28.</li><li>Event 5 starts May 23, ends May 28. Voting runs May 28 to June 4.</li><li>Event 6 starts May 30, ends June 4. Voting runs June 4 to June 11.</li></ul><p>For each event, you get to upload one and only one entry - and once uploaded, you may not change, revise, correct, or alter your entry.<br><strong>In each case,</strong> our commenting judges will be asked to post comments
during the voting period
following each event. Our celebrity judges will announce the top winners for each event about one week after the voting period ends.<a href="https://powershell.org/category/announcements/scripting-games/">We will post those announcements right here</a>.<br>
Tuesday morning after the event closes, the event opens for public viewing, which is when people can vote on your entry and our judges can comment. Voting runs for one week following event close (Tuesday to Tuesday).<br><strong>Remember: Even if you&rsquo;re not competing, you can vote on other people&rsquo;s entries. Voting is one of the best ways to win prizes in the Games this year, as each vote counts as a &ldquo;raffle ticket&rdquo; to one of our many prizes.</strong><br>
Registration and all other URLs will be prominently posted on the<a href="https://powershell.org/games">2013 Scripting Games Home Page</a>.</p>
]]></content:encoded></item><item><title>Putting the date in a file name</title><link>https://powershell.org/articles/2013-04-03-putting-the-date-in-a-file-name/</link><guid>https://powershell.org/articles/2013-04-03-putting-the-date-in-a-file-name/</guid><pubDate>Wed, 03 Apr 2013 19:18:43 +0000</pubDate><description>&lt;p&gt;I often need to create file names that include the date &amp;amp; time the file was created in the name. I&amp;quot;™ve come up with all sorts of ways to do but this I think is the simplest.&lt;/p&gt;
&lt;p&gt;I want the date in this format: year-month-day-hour-minute-second. In other words a format that is easily sortable. I discovered that if you convert a data to a string there is a formatter that does most of the work for you. That&amp;quot;™s a lower case s.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I often need to create file names that include the date &amp; time the file was created in the name. I"™ve come up with all sorts of ways to do but this I think is the simplest.</p><p>I want the date in this format: year-month-day-hour-minute-second. In other words a format that is easily sortable. I discovered that if you convert a data to a string there is a formatter that does most of the work for you. That"™s a lower case s.</p><p>PS&gt; (Get-Date).ToString(&ldquo;s&rdquo;)<br>
2013-04-03T20:09:31</p><p>You can"™t have a : symbol in a file name so need to get rid of those</p><p>PS&gt; (Get-Date).ToString(&ldquo;s&rdquo;).Replace(":","-")<br>
2013-04-03T20-10-02</p><p>To complete the file name</p><p>PS&gt; $datestring = (Get-Date).ToString(&ldquo;s&rdquo;).Replace(":","-")<br>
PS&gt; $file = &ldquo;c:\folder\Prefix_$datestring.txt&rdquo;<br>
PS&gt; $file<br>
c:\folder\Prefix_2013-04-03T20-16-48.txt<br>
PS&gt;</p><p>I"™ve done this as a two step process otherwise when you replace the : you also take out the one for the disk drive &ldquo;“ oops</p><p>Enjoy</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2824/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2824/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2824&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>PowerShell excerpt week</title><link>https://powershell.org/articles/2013-04-03-powershell-excerpt-week-2/</link><guid>https://powershell.org/articles/2013-04-03-powershell-excerpt-week-2/</guid><pubDate>Wed, 03 Apr 2013 19:00:52 +0000</pubDate><description>&lt;p&gt;The Scripting Guy is running a series of excerpts from the PowerShell books published by Manning. Today is PowerShell in Practice &lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/04/03/excel-spreadsheets.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/04/03/excel-spreadsheets.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Check out the deals all this week on Manning PowerShell books&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2823/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2823/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2823&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>The Scripting Guy is running a series of excerpts from the PowerShell books published by Manning. Today is PowerShell in Practice<a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/04/03/excel-spreadsheets.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/04/03/excel-spreadsheets.aspx</a></p><p>Check out the deals all this week on Manning PowerShell books</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2823/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2823/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2823&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>2013 Scripting Games Competitor Guide (for the Public, too!)</title><link>https://powershell.org/articles/2013-04-02-2013-scripting-games-competitor-guide-for-the-public-too/</link><guid>https://powershell.org/articles/2013-04-02-2013-scripting-games-competitor-guide-for-the-public-too/</guid><pubDate>Tue, 02 Apr 2013 14:58:41 +0000</pubDate><description>&lt;p&gt;Our Competitor Guide is now online - you can download it here:&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/04/2013CompetitorGuide.pdf"&gt;2013 Competitor Guide&lt;/a&gt;&lt;br&gt;
We&amp;rsquo;re doing things a bit differently this year. We&amp;rsquo;ll be engaging the overall PowerShell community for numeric grades - and those &lt;em&gt;doing&lt;/em&gt; the grading have an awesome chance to win some great prizes! Our expert Judges will be focused on commentary, making this even more of a learning event. Download the Guide and see what&amp;rsquo;s in store - the Games are scheduled to start the week of April 22nd.&lt;br&gt;
As a note, you should get used to checking our Scripting Games Announcements thread (&lt;a href="https://powershell.org/category/announcements/scripting-games/"&gt;https://powershell.org/category/announcements/scripting-games/&lt;/a&gt;) so that you don&amp;rsquo;t miss any goodies.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Our Competitor Guide is now online - you can download it here:<br><a href="https://powershell.org/wp-content/uploads/2013/04/2013CompetitorGuide.pdf">2013 Competitor Guide</a><br>
We&rsquo;re doing things a bit differently this year. We&rsquo;ll be engaging the overall PowerShell community for numeric grades - and those<em>doing</em> the grading have an awesome chance to win some great prizes! Our expert Judges will be focused on commentary, making this even more of a learning event. Download the Guide and see what&rsquo;s in store - the Games are scheduled to start the week of April 22nd.<br>
As a note, you should get used to checking our Scripting Games Announcements thread (<a href="https://powershell.org/category/announcements/scripting-games/">https://powershell.org/category/announcements/scripting-games/</a>) so that you don&rsquo;t miss any goodies.</p>
]]></content:encoded></item><item><title>MVP renewal 2013</title><link>https://powershell.org/articles/2013-04-01-mvp-renewal-2013/</link><guid>https://powershell.org/articles/2013-04-01-mvp-renewal-2013/</guid><pubDate>Mon, 01 Apr 2013 16:46:55 +0000</pubDate><description>&lt;p&gt;This afternoon I received the email notifying me that my MVP award had been renewed for another year.&lt;/p&gt;
&lt;p&gt;Thank you to Microsoft &amp;ldquo;“ I regard the award as a great honour.&lt;/p&gt;
&lt;p&gt;And thank you to the PowerShell community &amp;ldquo;“ its a great place to be&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2822/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2822/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2822&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>This afternoon I received the email notifying me that my MVP award had been renewed for another year.</p><p>Thank you to Microsoft &ldquo;“ I regard the award as a great honour.</p><p>And thank you to the PowerShell community &ldquo;“ its a great place to be</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2822/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2822/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2822&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Shutting down a remote computer</title><link>https://powershell.org/articles/2013-04-01-shutting-down-a-remote-computer/</link><guid>https://powershell.org/articles/2013-04-01-shutting-down-a-remote-computer/</guid><pubDate>Mon, 01 Apr 2013 11:15:52 +0000</pubDate><description>&lt;p&gt;PowerShell provides the Stop-Computer cmdlet for closing down a remote machine. I find this especially useful in my virtual test environment. I&amp;quot;™ll have several machines running but won&amp;quot;™t necessarily have logged onto them. Using Stop-Computer means that I can shut them down cleanly without the hassle of logging onto them.&lt;/p&gt;
&lt;p&gt;In modern Windows systems you have to explicitly enable remote WMI access through the Windows firewall. Stop-Computer uses WMI. If the WMI firewall ports aren&amp;quot;™t enabled you can&amp;quot;™t use Stop-Computer. I&amp;quot;™ve taken to use the CIM cmdlets rather than WMI so sometimes don&amp;quot;™t open the WMI firewall ports.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>PowerShell provides the Stop-Computer cmdlet for closing down a remote machine. I find this especially useful in my virtual test environment. I"™ll have several machines running but won"™t necessarily have logged onto them. Using Stop-Computer means that I can shut them down cleanly without the hassle of logging onto them.</p><p>In modern Windows systems you have to explicitly enable remote WMI access through the Windows firewall. Stop-Computer uses WMI. If the WMI firewall ports aren"™t enabled you can"™t use Stop-Computer. I"™ve taken to use the CIM cmdlets rather than WMI so sometimes don"™t open the WMI firewall ports.</p><p>One quick function later and I have an answer</p><p>`function</p><p>invoke-cimshutdown</p><p>{</p><p>[</p><p>CmdletBinding</p><p>(</p><p>)</p><p>]</p><p>param</p><p>(</p><p>[string]</p><p>$computername</p><p>)</p><p>$comp</p><p>=</p><p>Get-CimInstance</p><p>win32_operatingsystem</p><p>-ComputerName</p><p>$computername</p><p>Invoke-CimMethod</p><p>-InputObject</p><p>$comp</p><p>-MethodName</p><p>Shutdown</p><p>}</p><p>`Pass the computer name as a parameter &ldquo;“ I deliberately didn&rdquo;™t put a default</p><p>Use Get-CimInstance to get the Win32_operatingsystem class and use Invoke-CimMethod to call the Shutdown method.</p><p>Another reason not to enable WMI on my server 2012 firewalls.</p><p>You can use this on legacy versions of Windows if you have PowerShell v3, and therefore WSMAN v3, installed</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2821/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2821/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2821&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>CIM cmdlets</title><link>https://powershell.org/articles/2013-03-26-cim-cmdlets/</link><guid>https://powershell.org/articles/2013-03-26-cim-cmdlets/</guid><pubDate>Tue, 26 Mar 2013 21:04:00 +0000</pubDate><description>&lt;p&gt;The CIM cmdlets are found in the CIMcmdlets module.&lt;/p&gt;
&lt;p&gt;Get-Command -Module CimCmdlets produces this list of names. I&amp;quot;™ve added some information on the tasks they perform&lt;/p&gt;
&lt;p&gt;Get-CimAssociatedInstance is for working with WMI associated classes&lt;br&gt;
Get-CimClass is for discovering the properties and methods of a WMI class&lt;br&gt;
Get-CimInstance is analogous to Get-WmiObject&lt;br&gt;
Get-CimSession&lt;br&gt;
Invoke-CimMethod is analogous to Invoke-WMIMethod &lt;br&gt;
New-CimInstance can be used for creating a new WMI instance in certain circumstances&lt;br&gt;
New-CimSession&lt;br&gt;
New-CimSessionOption&lt;br&gt;
Register-CimIndicationEvent is analogous to Register-WMIEvent&lt;br&gt;
Remove-CimInstance is analogous to Remove-WMIObject&lt;br&gt;
Remove-CimSession&lt;br&gt;
Set-CimInstance is analogous to Set-WMIInstance&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>The CIM cmdlets are found in the CIMcmdlets module.</p><p>Get-Command -Module CimCmdlets produces this list of names. I"™ve added some information on the tasks they perform</p><p>Get-CimAssociatedInstance is for working with WMI associated classes<br>
Get-CimClass is for discovering the properties and methods of a WMI class<br>
Get-CimInstance is analogous to Get-WmiObject<br>
Get-CimSession<br>
Invoke-CimMethod is analogous to Invoke-WMIMethod<br>
New-CimInstance can be used for creating a new WMI instance in certain circumstances<br>
New-CimSession<br>
New-CimSessionOption<br>
Register-CimIndicationEvent is analogous to Register-WMIEvent<br>
Remove-CimInstance is analogous to Remove-WMIObject<br>
Remove-CimSession<br>
Set-CimInstance is analogous to Set-WMIInstance</p><p>The CIM session cmdlets are for working with the CIm sessions which are analogous to PowerShell remoting sessions but are used by the CIM cmdlets AND the new WMI based cmdlets in Windows 8/2012 such as the networking cmdlets</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2820/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2820/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2820&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>WMI vs CIM</title><link>https://powershell.org/articles/2013-03-24-wmi-vs-cim/</link><guid>https://powershell.org/articles/2013-03-24-wmi-vs-cim/</guid><pubDate>Sun, 24 Mar 2013 12:03:24 +0000</pubDate><description>&lt;p&gt;An email debate yesterday regarding the use of the CIM cmdlets (new in PowerShell 3) vs the WMI cmdlets made me realise that other people are probably wondering the same thing,&lt;/p&gt;
&lt;p&gt;The question is really part of a the semi-philosophical debate about when you should adopt new technology.&lt;/p&gt;
&lt;p&gt;In the case of the WMI/CIM cmdlets the resolution is fairly straightforward.&lt;/p&gt;
&lt;p&gt;If you are using PowerShell v2 you have to use the WMI cmdlets.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>An email debate yesterday regarding the use of the CIM cmdlets (new in PowerShell 3) vs the WMI cmdlets made me realise that other people are probably wondering the same thing,</p><p>The question is really part of a the semi-philosophical debate about when you should adopt new technology.</p><p>In the case of the WMI/CIM cmdlets the resolution is fairly straightforward.</p><p>If you are using PowerShell v2 you have to use the WMI cmdlets.</p><p>If you are using PowerShell v3 &ldquo;“ even if you are accessing legacy systems I would recommend the CIM cmdlets. There are a number of benefits to using the CIM cmdlets:</p><ul><li>use of WSMAN for remote access &ldquo;“ no more DCOM error. You can drop back to DCOM for accessing systems with WSMAN 2 installed</li><li>use of CIM sessions for accessing multiple machines</li><li>Get-CIMClass for investigating WMI classes</li><li>improved way of dealing with WMI associations</li></ul><p>As far as I am aware the only thing the CIM cmdlets can&rdquo;™t do is access amended qualifiers such as the class description. Seeing that many classes don&rdquo;™t that set it"™s not a major hardship.</p><p>Now that I"™ve recommended you should use them I"™d better show you how &ldquo;“ that will cover a mini-series of posts over the next few days</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2819/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2819/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2819&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>UK PowerShell group session postponement</title><link>https://powershell.org/articles/2013-03-21-uk-powershell-group-session-postponement/</link><guid>https://powershell.org/articles/2013-03-21-uk-powershell-group-session-postponement/</guid><pubDate>Thu, 21 Mar 2013 19:52:43 +0000</pubDate><description>&lt;p&gt;I&amp;quot;™m postponing the 26 March session on PowerShell and Hyper-V until 9 April. Invites will go out shortly&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2818/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2818/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2818&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I"™m postponing the 26 March session on PowerShell and Hyper-V until 9 April. Invites will go out shortly</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2818/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2818/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2818&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>PowerShell 3 SDK samples</title><link>https://powershell.org/articles/2013-03-21-powershell-3-sdk-samples/</link><guid>https://powershell.org/articles/2013-03-21-powershell-3-sdk-samples/</guid><pubDate>Thu, 21 Mar 2013 19:49:18 +0000</pubDate><description>&lt;p&gt;A sample pack for the SDK is now available - see &lt;a href="http://blogs.msdn.com/b/powershell/archive/2013/03/17/windows-powershell-3-0-sample-pack.aspx" title="http://blogs.msdn.com/b/powershell/archive/2013/03/17/windows-powershell-3-0-sample-pack.aspx"&gt;http://blogs.msdn.com/b/powershell/archive/2013/03/17/windows-powershell-3-0-sample-pack.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2817/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2817/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2817&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>A sample pack for the SDK is now available - see<a href="http://blogs.msdn.com/b/powershell/archive/2013/03/17/windows-powershell-3-0-sample-pack.aspx" title="http://blogs.msdn.com/b/powershell/archive/2013/03/17/windows-powershell-3-0-sample-pack.aspx">http://blogs.msdn.com/b/powershell/archive/2013/03/17/windows-powershell-3-0-sample-pack.aspx</a></p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2817/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2817/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2817&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Network Adapters"“Disable/Enable</title><link>https://powershell.org/articles/2013-03-11-network-adapters-disableenable/</link><guid>https://powershell.org/articles/2013-03-11-network-adapters-disableenable/</guid><pubDate>Mon, 11 Mar 2013 20:09:06 +0000</pubDate><description>&lt;p&gt;Last time we saw the Get-NetAdapter cmdlet from the NetAdapter module&lt;/p&gt;
&lt;p&gt;PS&amp;gt; Get-NetAdapter | ft Name, InterfaceDescription, Status -a&lt;/p&gt;
&lt;p&gt;Name InterfaceDescription Status
—- ——————– ——
Ethernet NVIDIA nForce 10/100/1000 Mbps Ethernet Up
WiFi Qualcomm Atheros AR5007 802.11b/g WiFi Adapter Up&lt;/p&gt;
&lt;p&gt;If you look in the module you also find Disable-NetAdapter &amp;amp; Enable-NetAdapter&lt;/p&gt;
&lt;p&gt;PS&amp;gt; Disable-NetAdapter -Name Wifi -Confirm:$false&lt;br&gt;
PS&amp;gt; Get-NetAdapter | ft Name, InterfaceDescription, Status -a&lt;/p&gt;
&lt;p&gt;Name InterfaceDescription Status
—- ——————– ——
Ethernet NVIDIA nForce 10/100/1000 Mbps Ethernet Up
WiFi Qualcomm Atheros AR5007 802.11b/g WiFi Adapter Disabled&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Last time we saw the Get-NetAdapter cmdlet from the NetAdapter module</p><p>PS&gt; Get-NetAdapter | ft Name, InterfaceDescription, Status -a</p><p>Name InterfaceDescription Status
—- ——————– ——
Ethernet NVIDIA nForce 10/100/1000 Mbps Ethernet Up
WiFi Qualcomm Atheros AR5007 802.11b/g WiFi Adapter Up</p><p>If you look in the module you also find Disable-NetAdapter &amp; Enable-NetAdapter</p><p>PS&gt; Disable-NetAdapter -Name Wifi -Confirm:$false<br>
PS&gt; Get-NetAdapter | ft Name, InterfaceDescription, Status -a</p><p>Name InterfaceDescription Status
—- ——————– ——
Ethernet NVIDIA nForce 10/100/1000 Mbps Ethernet Up
WiFi Qualcomm Atheros AR5007 802.11b/g WiFi Adapter Disabled</p><p>PS&gt; Enable-NetAdapter -Name Wifi -Confirm:$false<br>
PS&gt; Get-NetAdapter | ft Name, InterfaceDescription, Status -a</p><p>Name InterfaceDescription Status
—- ——————– ——
Ethernet NVIDIA nForce 10/100/1000 Mbps Ethernet Up
WiFi Qualcomm Atheros AR5007 802.11b/g WiFi Adapter Up</p><p>You can also enable/disable based on an Input Object, the alias (-ifalias) or the description (-InterfaceDescription)</p><p>PS&gt; Get-NetAdapter -Name Wifi | Disable-NetAdapter -Confirm:$false<br>
PS&gt; Get-NetAdapter | ft Name, InterfaceDescription, Status -a</p><p>Name InterfaceDescription Status
—- ——————– ——
Ethernet NVIDIA nForce 10/100/1000 Mbps Ethernet Up
WiFi Qualcomm Atheros AR5007 802.11b/g WiFi Adapter Disabled</p><p>PS&gt; Get-NetAdapter -Name Wifi | Enable-NetAdapter -Confirm:$false<br>
PS&gt; Get-NetAdapter | ft Name, InterfaceDescription, Status -a</p><p>Name InterfaceDescription Status
—- ——————– ——
Ethernet NVIDIA nForce 10/100/1000 Mbps Ethernet Up
WiFi Qualcomm Atheros AR5007 802.11b/g WiFi Adapter Up</p><p>What"™s the alias?</p><p>PS&gt; Get-NetAdapter | ft Name, InterfaceDescription, ifAlias, InterfaceAlias -a</p><p>Name InterfaceDescription ifAlias InterfaceAlias
—- ——————– ——- ————–
Ethernet NVIDIA nForce 10/100/1000 Mbps Ethernet Ethernet Ethernet
WiFi Qualcomm Atheros AR5007 802.11b/g WiFi Adapter WiFi WiFi</p><p>If you want to use these cmdlets against remote machines you can run them through a CIMsession</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2816/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2816/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2816&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>PhillyPoSH 03/07/2013 meeting summary and presentation materials</title><link>https://powershell.org/articles/2013-03-10-phillyposh-03072013-meeting-summary-and-presentation-materials/</link><guid>https://powershell.org/articles/2013-03-10-phillyposh-03072013-meeting-summary-and-presentation-materials/</guid><pubDate>Sun, 10 Mar 2013 23:06:50 +0000</pubDate><description>&lt;ol&gt;
&lt;li&gt;&lt;a href="http://mellositmusings.com/"&gt;John Mello&lt;/a&gt; gave a brief overview of the history of the Scripting Games and an overview of the beginner events from the 2013 Winter Scripting Camp. A copy of his presentation and 2013 Winter Scripting Camp submissions can be found &lt;a href="https://powershell.org/wp-content/uploads/2013/03/PhillPosh_2013-03-04_PT1.zip"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://paglia.org/"&gt;Lido Paglia&lt;/a&gt; gave an overview of the advanced events from the 2013 Winter Scripting Camp in addition to doing an in-depth review of &lt;a href="http://donjones.com/"&gt;Don Jones&lt;/a&gt;&amp;quot;™ &lt;a href="https://powershell.org/2013/02/11/winter-scripting-camp-the-post-mortem/"&gt;Winter Scripting Camp Post Mortem&lt;/a&gt;. A copy of his 2013 Winter Scripting Camp submissions can be found &lt;a href="https://powershell.org/wp-content/uploads/2013/03/PhillPosh_2013-03-04_PT2.zip"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Various other information worth mentioning:
&lt;ol&gt;
&lt;li&gt;Group member &lt;a href="http://tiki.gmartin.org/"&gt;Greg Martin&lt;/a&gt; presented a problem he ran into creating a COM object in PowerShell to hold an instance of Internet Explorer which he would then use to open a page. Stepping through the script worked fine, but running the script failed.  The issue was that the object would more often than not be blank when he tried to reference it. The group offered some&lt;br&gt;
suggestions and ideas to work around the issue which later helped Greg find the root cause. A breakdown of the problem and final solution can be found on &lt;a href="http://tiki.gmartin.org/tiki-view_blog_post.php?postId=181"&gt;Greg&amp;quot;™s Blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Need help making sure your script is not using aliases? Take a look at &lt;a href="http://jdhitsolutions.com/blog/2011/04/powershell-ise-alias-to-command/"&gt;Jeff Hicks convert to Alias function!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Following up on &lt;a href="http://paglia.org/"&gt;Lido Paglia&lt;/a&gt;&amp;quot;™s discussion of &lt;a href="http://donjones.com/"&gt;Don Jones&lt;/a&gt;&amp;quot;™ &lt;a href="https://powershell.org/2013/02/11/winter-scripting-camp-the-post-mortem/"&gt;Winter Scripting Camp Post Mortem&lt;/a&gt;, here is a list of approved verbs and naming conventions for PowerShell directly from Microsoft:
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms714428(v=vs.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/ms714428(v=vs.85).aspx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms714395(v=vs.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/ms714395(v=vs.85).aspx&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms714395(v=vs.85).aspx"&gt;The&lt;/a&gt; &lt;a href="http://mspsug.com/"&gt;PowerShell Mississippi User Group&lt;/a&gt; is offering a series of &lt;a href="http://mspsug.com/2013/02/27/mississippi-powershell-user-group-speaker-lineup-for-2013/"&gt;online meetings every 2nd Tuesday of the month at 8:30PM CST for the rest of 2013&lt;/a&gt;. The speaker line-up is an impressive who&amp;quot;™s who of PowerShell MVPs!&lt;/li&gt;
&lt;li&gt;Check out the &lt;a href="http://blogs.msdn.com/b/powershell/archive/2009/10/15/introducing-the-windows-7-resource-kit-powershell-pack.aspx"&gt;Windows 7 Resource Kit PowerShell Pack&lt;/a&gt;, which contains over 800 scripts in 10 different modules. For example :
&lt;ol&gt;
&lt;li&gt;ISE shortcuts&lt;/li&gt;
&lt;li&gt;Task Scheduler&lt;/li&gt;
&lt;li&gt;PowerShell Image manipulation&lt;/li&gt;
&lt;li&gt;And many more!&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Post Meeting announcement
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://paglia.org/"&gt;Lido Paglia&lt;/a&gt; came in 2nd place in the &lt;a href="https://powershell.org/category/announcements/scripting-games/"&gt;2013 Winter Scripting Camp&lt;/a&gt;! Give him a high five next time you see him!&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;</description><content:encoded>&lt;![CDATA[<ol><li><a href="http://mellositmusings.com/">John Mello</a> gave a brief overview of the history of the Scripting Games and an overview of the beginner events from the 2013 Winter Scripting Camp. A copy of his presentation and 2013 Winter Scripting Camp submissions can be found<a href="https://powershell.org/wp-content/uploads/2013/03/PhillPosh_2013-03-04_PT1.zip">here</a>.</li><li><a href="http://paglia.org/">Lido Paglia</a> gave an overview of the advanced events from the 2013 Winter Scripting Camp in addition to doing an in-depth review of<a href="http://donjones.com/">Don Jones</a>"™<a href="https://powershell.org/2013/02/11/winter-scripting-camp-the-post-mortem/">Winter Scripting Camp Post Mortem</a>. A copy of his 2013 Winter Scripting Camp submissions can be found<a href="https://powershell.org/wp-content/uploads/2013/03/PhillPosh_2013-03-04_PT2.zip">here</a>.</li><li>Various other information worth mentioning:<ol><li>Group member<a href="http://tiki.gmartin.org/">Greg Martin</a> presented a problem he ran into creating a COM object in PowerShell to hold an instance of Internet Explorer which he would then use to open a page. Stepping through the script worked fine, but running the script failed.  The issue was that the object would more often than not be blank when he tried to reference it. The group offered some<br>
suggestions and ideas to work around the issue which later helped Greg find the root cause. A breakdown of the problem and final solution can be found on<a href="http://tiki.gmartin.org/tiki-view_blog_post.php?postId=181">Greg"™s Blog</a></li><li>Need help making sure your script is not using aliases? Take a look at<a href="http://jdhitsolutions.com/blog/2011/04/powershell-ise-alias-to-command/">Jeff Hicks convert to Alias function!</a></li><li>Following up on<a href="http://paglia.org/">Lido Paglia</a>"™s discussion of<a href="http://donjones.com/">Don Jones</a>"™<a href="https://powershell.org/2013/02/11/winter-scripting-camp-the-post-mortem/">Winter Scripting Camp Post Mortem</a>, here is a list of approved verbs and naming conventions for PowerShell directly from Microsoft:<ol><li><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms714428(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/ms714428(v=vs.85).aspx</a></li><li><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms714395(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/ms714395(v=vs.85).aspx</a></li></ol></li><li><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms714395(v=vs.85).aspx">The</a><a href="http://mspsug.com/">PowerShell Mississippi User Group</a> is offering a series of<a href="http://mspsug.com/2013/02/27/mississippi-powershell-user-group-speaker-lineup-for-2013/">online meetings every 2nd Tuesday of the month at 8:30PM CST for the rest of 2013</a>. The speaker line-up is an impressive who"™s who of PowerShell MVPs!</li><li>Check out the<a href="http://blogs.msdn.com/b/powershell/archive/2009/10/15/introducing-the-windows-7-resource-kit-powershell-pack.aspx">Windows 7 Resource Kit PowerShell Pack</a>, which contains over 800 scripts in 10 different modules. For example :<ol><li>ISE shortcuts</li><li>Task Scheduler</li><li>PowerShell Image manipulation</li><li>And many more!</li></ol></li></ol></li><li>Post Meeting announcement<ol><li><a href="http://paglia.org/">Lido Paglia</a> came in 2nd place in the<a href="https://powershell.org/category/announcements/scripting-games/">2013 Winter Scripting Camp</a>! Give him a high five next time you see him!</li></ol></li></ol>
]]></content:encoded></item><item><title>Announcing Winter Scripting Camp Winners</title><link>https://powershell.org/articles/2013-03-08-announcing-winter-scripting-camp-winners/</link><guid>https://powershell.org/articles/2013-03-08-announcing-winter-scripting-camp-winners/</guid><pubDate>Fri, 08 Mar 2013 22:57:07 +0000</pubDate><description>&lt;p&gt;I know, this took forever. Mea culpa. I&amp;rsquo;ve been working my shell off, and finally got around to pulling the info.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Beginner Track&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Wouter Beens (4.667)&lt;/li&gt;
&lt;li&gt;Laurel Raven (4.5)&lt;/li&gt;
&lt;li&gt;Chris Davis (4.5)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Advanced Track&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Alexander Kuzin (4.5)&lt;/li&gt;
&lt;li&gt;Lido Paglia (4.5)&lt;/li&gt;
&lt;li&gt;(anonymous) (4)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Those are the average scores from those entries, and in case of a tie we broke it by submission timestamp. Things will be working a bit differently in the actual Games, coming your way in April, so stay tuned. In fact, you can &lt;a href="https://powershell.org/category/announcements/scripting-games/"&gt;subscribe to a specific topic for Scripting Games announcements&lt;/a&gt;, if you like.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I know, this took forever. Mea culpa. I&rsquo;ve been working my shell off, and finally got around to pulling the info.</p><p><strong>Beginner Track</strong></p><ol><li>Wouter Beens (4.667)</li><li>Laurel Raven (4.5)</li><li>Chris Davis (4.5)</li></ol><p><strong>Advanced Track</strong></p><ol><li>Alexander Kuzin (4.5)</li><li>Lido Paglia (4.5)</li><li>(anonymous) (4)</li></ol><p>Those are the average scores from those entries, and in case of a tie we broke it by submission timestamp. Things will be working a bit differently in the actual Games, coming your way in April, so stay tuned. In fact, you can<a href="https://powershell.org/category/announcements/scripting-games/">subscribe to a specific topic for Scripting Games announcements</a>, if you like.</p>
]]></content:encoded></item><item><title>WMI Explorer</title><link>https://powershell.org/articles/2013-03-08-wmi-explorer/</link><guid>https://powershell.org/articles/2013-03-08-wmi-explorer/</guid><pubDate>Fri, 08 Mar 2013 16:02:33 +0000</pubDate><description>&lt;p&gt;This is a PowerShell-based WMI Explorer tool created by Marc van Orsouw (aka //\O//). His Web site has been down for ages, but &lt;a href="http://tfl09.blogspot.com/2013/03/wmi-explorerwheres-it-gonea-temporary.html?utm_source=twitterfeed&amp;amp;utm_medium=twitter"&gt;Thomas Lee&lt;/a&gt; was helpful enough to post a copy of this, and we&amp;rsquo;re hosting it here as a backup against further unavailability.&lt;br&gt;
&lt;a href="https://powershell.org/wp-content/uploads/2013/03/wmiexplorer.zip"&gt;Download WMI Explorer&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>This is a PowerShell-based WMI Explorer tool created by Marc van Orsouw (aka //\O//). His Web site has been down for ages, but<a href="http://tfl09.blogspot.com/2013/03/wmi-explorerwheres-it-gonea-temporary.html?utm_source=twitterfeed&amp;utm_medium=twitter">Thomas Lee</a> was helpful enough to post a copy of this, and we&rsquo;re hosting it here as a backup against further unavailability.<br><a href="https://powershell.org/wp-content/uploads/2013/03/wmiexplorer.zip">Download WMI Explorer</a></p>
]]></content:encoded></item><item><title>PowerShell Summit 2014 Planning Continues</title><link>https://powershell.org/articles/2013-03-08-powershell-summit-2014-planning-continues/</link><guid>https://powershell.org/articles/2013-03-08-powershell-summit-2014-planning-continues/</guid><pubDate>Fri, 08 Mar 2013 15:09:16 +0000</pubDate><description>&lt;p&gt;In an effort to keep folks as fully informed as possible, I&amp;rsquo;ll periodically share information about the Summit for next year. In this update, I want to explain how we&amp;rsquo;re hoping to address some of the issues (all good ones, actually) that we&amp;rsquo;ve experienced with the 2013 event.&lt;/p&gt;
&lt;p&gt;First, the 2013 event sold out &lt;em&gt;fast.&lt;/em&gt; We have a fire code limit of about 100 people and we hit it quickly - and our wait list ballooned to almost as many people. The moral of that story is that (a) we need more space and (b) people gotta sign up quicker if they want a spot! This is like grabbing those U2 tickets - camp out overnight and snap &amp;rsquo;em up. So we&amp;rsquo;re hoping to be in the Microsoft Conference Center (MSCC) on campus, which should allow us around 250 attendees in 2014. We can&amp;rsquo;t book that space until about a year out, we&amp;rsquo;re told, but once we can start booking we will announce it here. Our 2013 alumni will get first dibs, and we&amp;rsquo;ll have about 25 early bird tickets to sell. We expect pricing to be about $700 for those, and about $850 for full-price tickets, plus about $40-$50 in ticketing fees (which covers credit card merchant fees and the ticketing company fee).&lt;br&gt;
Second, we &lt;em&gt;will&lt;/em&gt; offer tickets as soon as we can do so. That may include an &amp;ldquo;I&amp;rsquo;m Feeling Lucky&amp;rdquo; ticket even before we know our dates (we&amp;rsquo;re still aiming for April 2014). However, due to changing regulations, we can only offer refunds for 30 days after you make your purchase, or (due to logistics) until February 1st, &lt;em&gt;whichever comes first.&lt;/em&gt; That&amp;rsquo;s something you&amp;rsquo;ll have to take into account.&lt;br&gt;
Third, we&amp;rsquo;re going to make the waitlist process a bit more automated, and give you the ability to use the waitlist to sell your ticket to someone else if you change your mind about attending. People will be able to waitlist on PowerShell.org, and prospective ticket-sellers will be able to offer tickets to that list. You&amp;rsquo;re on your own for completing the transaction (we suggest PayPal), and you simply notify us of the transfer once it&amp;rsquo;s complete.&lt;br&gt;
Fourth, in case the question of recording the sessions comes up again, here&amp;rsquo;s the deal. It&amp;rsquo;s expensive. We&amp;rsquo;ve looked into it, and we&amp;rsquo;ll need about $8,000 in equipment, which is a one-time expense that will let us record sessions with a minimum of on-site labor. So we&amp;rsquo;re going to launch an IndieGoGo campaign in late 2013 to try and raise that money. Contributors will receive (depending on the amount they contribute) access to all future Summit recordings, a discount on Summit recordings for 2014, or full access to the 2014 recordings. If we don&amp;rsquo;t meet our goal, we won&amp;rsquo;t record, and everyone gets their money back. If we do meet our goal, only contributors will get access to the 2014 videos. However, in subsequent years we will sell (for a nominal fee) access to the videos to the public - that&amp;rsquo;ll happen after the Summit is over. In years where the Summit sells out, we&amp;rsquo;ll put the videos online for free (unless we need to recoup labor costs, in which case there might still be a nominal fee). This is the fair-est approach we could come up with that balances our need to have a successful on-site event (without the paying attendees, we can&amp;rsquo;t do this thing at all) and to accommodate the needs of folks who can&amp;rsquo;t possibly attend.&lt;br&gt;
Fifth, we still have no word on any events outside the US, and probably will not. We are simply not pursuing it at this time. It gets very complicated when a US business starts doing events in other countries, and we don&amp;rsquo;t have the manpower or resources to tackle that right now. Several folks have expressed an interest in spearheading various non-US versions of the Summit, and most of those are going nowhere. One problem is that, in Europe, nobody appears interested in a &amp;ldquo;Euro Summit;&amp;rdquo; they all want one in their own country, which makes the whole endeavor financially risky and exponentially more complicated. There&amp;rsquo;s a huge concern that if we do one in (say) Barcelona, nobody from outside that area will even come. Another problem is that the Summit involves an insane amount of work - personally, I&amp;rsquo;ve spent hundreds of hours on this and I know Kirk has as well, along with Jason, Jeff, and Richard, the Scripting Wife, and a few more volunteers. It&amp;rsquo;s a &lt;em&gt;lot&lt;/em&gt; of work, and thus far we haven&amp;rsquo;t seen anyone outside the US willing to take it on. Keep in mind that we all still &lt;em&gt;need to have our full-time jobs&lt;/em&gt; to pay for silly things like groceries and electricity; we can&amp;rsquo;t afford to take out much more volunteer time.&lt;br&gt;
Sixth, the 2014 Summit will look much like the 2013 Summit in terms of content: about three dozen sessions in one-hour blocks, with about 45 minutes per session (including Q&amp;amp;A time). We&amp;rsquo;ll feed you breakfast and lunch. We &lt;em&gt;are&lt;/em&gt; going to book out a block of rooms at a nearby hotel, and will run a shuttle bus to and from that hotel (only!) and the Summit venue. That should help lower travel costs by reducing the need for a rental car. We are &lt;em&gt;not&lt;/em&gt; going to be able to hold enough rooms for all 200-250 attendees (when you hold a room, you pay for it whether it gets used or not, so the financial risk there is huge). We are hoping to block about 60 rooms - so it&amp;rsquo;ll become important to book early. Once that block is sold, you&amp;rsquo;re on your own - although the same hotel may well have rooms at their normal rate, which is what we&amp;rsquo;re hoping will happen.&lt;br&gt;
Seventh, communications with registered attendees has been a huge PITA, mainly because some providers - like ForeFront Online Protection (FOLP) have a global block against EventBrite, our ticket company. Yeah, awesome. So for 2014 we&amp;rsquo;re going to use &lt;a href="https://powershell.org/category/announcements/powershell-summit/"&gt;THIS blog category&lt;/a&gt; and our [Twitter feed][2] to &amp;ldquo;push&amp;rdquo; communications. We&amp;rsquo;ll still attempt to use email, but it&amp;rsquo;s just not reliable in this age of ultra-spam-blocking. So if you register, &lt;em&gt;it will be your responsibility to check for updated information.&lt;/em&gt; After all, you&amp;rsquo;re supposed to be the big, smart IT professional, so you should be able to figure out how to do that .&lt;br&gt;
I&amp;rsquo;ll continue posting updates as information is available, and we hope you&amp;rsquo;ll start talking to the boss about the 2014 show. The 2013 show is &lt;strong&gt;sold out&lt;/strong&gt;. As of right now, we are no longer to able process refunds for existing attendees, so we&amp;rsquo;re no longer processing the 2013 wait list. That means it&amp;rsquo;s time to start looking at the 2014 show.&lt;br&gt;
Any questions, drop &amp;rsquo;em in the comments!&lt;br&gt;
Thanks!&lt;br&gt;
Don&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>In an effort to keep folks as fully informed as possible, I&rsquo;ll periodically share information about the Summit for next year. In this update, I want to explain how we&rsquo;re hoping to address some of the issues (all good ones, actually) that we&rsquo;ve experienced with the 2013 event.</p><p>First, the 2013 event sold out<em>fast.</em> We have a fire code limit of about 100 people and we hit it quickly - and our wait list ballooned to almost as many people. The moral of that story is that (a) we need more space and (b) people gotta sign up quicker if they want a spot! This is like grabbing those U2 tickets - camp out overnight and snap &rsquo;em up. So we&rsquo;re hoping to be in the Microsoft Conference Center (MSCC) on campus, which should allow us around 250 attendees in 2014. We can&rsquo;t book that space until about a year out, we&rsquo;re told, but once we can start booking we will announce it here. Our 2013 alumni will get first dibs, and we&rsquo;ll have about 25 early bird tickets to sell. We expect pricing to be about $700 for those, and about $850 for full-price tickets, plus about $40-$50 in ticketing fees (which covers credit card merchant fees and the ticketing company fee).<br>
Second, we<em>will</em> offer tickets as soon as we can do so. That may include an &ldquo;I&rsquo;m Feeling Lucky&rdquo; ticket even before we know our dates (we&rsquo;re still aiming for April 2014). However, due to changing regulations, we can only offer refunds for 30 days after you make your purchase, or (due to logistics) until February 1st,<em>whichever comes first.</em> That&rsquo;s something you&rsquo;ll have to take into account.<br>
Third, we&rsquo;re going to make the waitlist process a bit more automated, and give you the ability to use the waitlist to sell your ticket to someone else if you change your mind about attending. People will be able to waitlist on PowerShell.org, and prospective ticket-sellers will be able to offer tickets to that list. You&rsquo;re on your own for completing the transaction (we suggest PayPal), and you simply notify us of the transfer once it&rsquo;s complete.<br>
Fourth, in case the question of recording the sessions comes up again, here&rsquo;s the deal. It&rsquo;s expensive. We&rsquo;ve looked into it, and we&rsquo;ll need about $8,000 in equipment, which is a one-time expense that will let us record sessions with a minimum of on-site labor. So we&rsquo;re going to launch an IndieGoGo campaign in late 2013 to try and raise that money. Contributors will receive (depending on the amount they contribute) access to all future Summit recordings, a discount on Summit recordings for 2014, or full access to the 2014 recordings. If we don&rsquo;t meet our goal, we won&rsquo;t record, and everyone gets their money back. If we do meet our goal, only contributors will get access to the 2014 videos. However, in subsequent years we will sell (for a nominal fee) access to the videos to the public - that&rsquo;ll happen after the Summit is over. In years where the Summit sells out, we&rsquo;ll put the videos online for free (unless we need to recoup labor costs, in which case there might still be a nominal fee). This is the fair-est approach we could come up with that balances our need to have a successful on-site event (without the paying attendees, we can&rsquo;t do this thing at all) and to accommodate the needs of folks who can&rsquo;t possibly attend.<br>
Fifth, we still have no word on any events outside the US, and probably will not. We are simply not pursuing it at this time. It gets very complicated when a US business starts doing events in other countries, and we don&rsquo;t have the manpower or resources to tackle that right now. Several folks have expressed an interest in spearheading various non-US versions of the Summit, and most of those are going nowhere. One problem is that, in Europe, nobody appears interested in a &ldquo;Euro Summit;&rdquo; they all want one in their own country, which makes the whole endeavor financially risky and exponentially more complicated. There&rsquo;s a huge concern that if we do one in (say) Barcelona, nobody from outside that area will even come. Another problem is that the Summit involves an insane amount of work - personally, I&rsquo;ve spent hundreds of hours on this and I know Kirk has as well, along with Jason, Jeff, and Richard, the Scripting Wife, and a few more volunteers. It&rsquo;s a<em>lot</em> of work, and thus far we haven&rsquo;t seen anyone outside the US willing to take it on. Keep in mind that we all still<em>need to have our full-time jobs</em> to pay for silly things like groceries and electricity; we can&rsquo;t afford to take out much more volunteer time.<br>
Sixth, the 2014 Summit will look much like the 2013 Summit in terms of content: about three dozen sessions in one-hour blocks, with about 45 minutes per session (including Q&amp;A time). We&rsquo;ll feed you breakfast and lunch. We<em>are</em> going to book out a block of rooms at a nearby hotel, and will run a shuttle bus to and from that hotel (only!) and the Summit venue. That should help lower travel costs by reducing the need for a rental car. We are<em>not</em> going to be able to hold enough rooms for all 200-250 attendees (when you hold a room, you pay for it whether it gets used or not, so the financial risk there is huge). We are hoping to block about 60 rooms - so it&rsquo;ll become important to book early. Once that block is sold, you&rsquo;re on your own - although the same hotel may well have rooms at their normal rate, which is what we&rsquo;re hoping will happen.<br>
Seventh, communications with registered attendees has been a huge PITA, mainly because some providers - like ForeFront Online Protection (FOLP) have a global block against EventBrite, our ticket company. Yeah, awesome. So for 2014 we&rsquo;re going to use<a href="https://powershell.org/category/announcements/powershell-summit/">THIS blog category</a> and our [Twitter feed][2] to &ldquo;push&rdquo; communications. We&rsquo;ll still attempt to use email, but it&rsquo;s just not reliable in this age of ultra-spam-blocking. So if you register,<em>it will be your responsibility to check for updated information.</em> After all, you&rsquo;re supposed to be the big, smart IT professional, so you should be able to figure out how to do that .<br>
I&rsquo;ll continue posting updates as information is available, and we hope you&rsquo;ll start talking to the boss about the 2014 show. The 2013 show is<strong>sold out</strong>. As of right now, we are no longer to able process refunds for existing attendees, so we&rsquo;re no longer processing the 2013 wait list. That means it&rsquo;s time to start looking at the 2014 show.<br>
Any questions, drop &rsquo;em in the comments!<br>
Thanks!<br>
Don</p><p>[2]:<a href="http://twitter.com/pshsummit">http://twitter.com/pshsummit</a> &ldquo;Episode 218 &ldquo;“ PowerScripting Podcast &ldquo;“ PowerShell jokes and SQL talk with the MidnightDBAs&rdquo;</p>
]]></content:encoded></item><item><title>Network adapters</title><link>https://powershell.org/articles/2013-03-04-network-adapters/</link><guid>https://powershell.org/articles/2013-03-04-network-adapters/</guid><pubDate>Mon, 04 Mar 2013 20:24:52 +0000</pubDate><description>&lt;p&gt;The WMI classes Win32_NetworkAdapter and Win32_NetworkAdapterConfiguration have seen a lot of use over the years. They can be a bit fiddly to use which is why the NetAdapter module in Windows 8/2012 is a so welcome.&lt;/p&gt;
&lt;p&gt;Lets start by looking at basic information gathering&lt;/p&gt;
&lt;p&gt;PS&amp;gt; Get-NetAdapter | ft -a&lt;/p&gt;
&lt;p&gt;Name InterfaceDescription ifIndex Status MacAddress LinkSpeed
—- ——————– ——- —— ———- ———
Ethernet NVIDIA nForce 10/100/1000 Mbps Ethernet 13 Up 00-1F-16-63-F5-DF 100 Mbps
WiFi Qualcomm Atheros AR5007 802.11b/g WiFi Adapter 12 Up 00-24-2B-2F-9C-A5 54 Mbps&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>The WMI classes Win32_NetworkAdapter and Win32_NetworkAdapterConfiguration have seen a lot of use over the years. They can be a bit fiddly to use which is why the NetAdapter module in Windows 8/2012 is a so welcome.</p><p>Lets start by looking at basic information gathering</p><p>PS&gt; Get-NetAdapter | ft -a</p><p>Name InterfaceDescription ifIndex Status MacAddress LinkSpeed
—- ——————– ——- —— ———- ———
Ethernet NVIDIA nForce 10/100/1000 Mbps Ethernet 13 Up 00-1F-16-63-F5-DF 100 Mbps
WiFi Qualcomm Atheros AR5007 802.11b/g WiFi Adapter 12 Up 00-24-2B-2F-9C-A5 54 Mbps</p><p>We get the Name &amp; description, status, MAC address and link speed as the default display. Contrast with Win32_NetworkAdapter for the same two interfaces</p><p>ServiceName : athr
MACAddress : 00:24:2B:2F:9C:A5
AdapterType : Ethernet 802.3
DeviceID : 10
Name : Qualcomm Atheros AR5007 802.11b/g WiFi Adapter
NetworkAddresses :
Speed : 54000000</p><p>ServiceName : NVNET
MACAddress : 00:1F:16:63:F5:DF
AdapterType : Ethernet 802.3
DeviceID : 11
Name : NVIDIA nForce 10/100/1000 Mbps Ethernet
NetworkAddresses :
Speed : 100000000</p><p>Notice the ifIndex from Get-NetAdapter &amp; DeviceId from Win32_NetworkAdapter. Two different numbers to identify the device.</p><p>What else can Get-NetAdapter tell us:</p><p>PS&gt; Get-NetAdapter -Name Ethernet | fl *</p><p>ifAlias : Ethernet
InterfaceAlias : Ethernet
ifIndex : 13
ifDesc : NVIDIA nForce 10/100/1000 Mbps Ethernet
ifName : Ethernet_7
DriverVersion : 73.3.0.0
LinkLayerAddress : 00-1F-16-63-F5-DF
MacAddress : 00-1F-16-63-F5-DF
Status : Up
**LinkSpeed : 100 Mbps
MediaType : 802.3
PhysicalMediaType : 802.3
AdminStatus : Up
MediaConnectionState : Connected
**DriverInformation : Driver Date 2010-03-04 Version 73.3.0.0 NDIS 6.20
DriverFileName : nvmf6232.sys
NdisVersion : 6.20
ifOperStatus : Up
Caption :
Description :
ElementName :
InstanceID : {188C370D-AD90-46F3-8AD2-0C10AFB6490C}
CommunicationStatus :
DetailedStatus :
HealthState :
InstallDate :
Name : Ethernet
OperatingStatus :
OperationalStatus :
PrimaryStatus :
StatusDescriptions :
AvailableRequestedStates :
EnabledDefault : 2
EnabledState<br>
: 5
OtherEnabledState :
RequestedState : 12
TimeOfLastStateChange :
TransitioningToState : 12
AdditionalAvailability :
Availability :
CreationClassName : MSFT_NetAdapter
DeviceID : {188C370D-AD90-46F3-8AD2-0C10AFB6490C}
ErrorCleared :
ErrorDescription :
IdentifyingDescriptions :
LastErrorCode :
MaxQuiesceTime :
OtherIdentifyingInfo :
PowerManagementCapabilities :
PowerManagementSupported :
PowerOnHours :
StatusInfo :
SystemCreationClassName : CIM_NetworkPort
SystemName : RSLAPTOP01
TotalPowerOnHours :
MaxSpeed :
OtherPortType :
PortType :
RequestedSpeed :
Speed : 100000000
UsageRestriction :
ActiveMaximumTransmissionUnit : 1500
AutoSense :
FullDuplex : True
LinkTechnology :
NetworkAddresses : {001F1663F5DF}
OtherLinkTechnology :
OtherNetworkPortType :
PermanentAddress : 001F1663F5DF
PortNumber : 0
Support
edMaximumTransmissionUnit :
AdminLocked : False
ComponentID : pci\ven_10de&amp;dev_0760
ConnectorPresent : True
DeviceName : \Device{188C370D-AD90-46F3-8AD2-0C10AFB6490C}
DeviceWakeUpEnable : False
DriverDate : 2010-03-04
DriverDateData : 129121344000000000
DriverDescription : NVIDIA nForce 10/100/1000 Mbps Ethernet
DriverMajorNdisVersion : 6
DriverMinorNdisVersion : 20
DriverName : \SystemRoot\system32\DRIVERS\nvmf6232.sys
DriverProvider : NVIDIA
DriverVersionString : 73.3.0.0
EndPointInterface : False
**HardwareInterface : True
**Hidden : False
HigherLayerInterfaceIndices : {26}
IMFilter : False
InterfaceAdminStatus : 1
InterfaceDescription : NVIDIA nForce 10/100/1000 Mbps Ethernet
InterfaceGuid : {188C370D-AD90-46F3-8AD2-0C10AFB6490C}
InterfaceIndex : 13
InterfaceName : Ethernet_7
InterfaceOperationalStatus : 1
InterfaceType : 6
iSCSIInterface : False
LowerLayerInterfaceIndices :
MajorDriverVersion : 73
MediaConnectState : 1
MediaDuplexState : 2
MinorDriverVersion : 30
**MtuSize : 1500
**NdisMedium : 0
NdisPhysicalMedium : 14
NetLuid &amp;n
bsp; : 1688849977704448
NetLuidIndex : 7
NotUserRemovable : False
OperationalStatusDownDefaultPortNotAuthenticated : False
OperationalStatusDownInterfacePaused : False
OperationalStatusDownLowPowerState : False
OperationalStatusDownMediaDisconnected : False
PnPDeviceID : PCI\VEN_10DE&amp;DEV_0760&amp;SUBSYS_360A103C&amp;REV_A2\3&amp;2411E6FE&amp;0&amp;50
**PromiscuousMode : False
**ReceiveLinkSpeed : 100000000
State : 2
TransmitLinkSpeed : 100000000
Virtual : False
VlanID :
WdmInterface : False
PSComputerName :
**CimClass : ROOT/StandardCimv2:MSFT_NetAdapter
**CimInstanceProperties : {Caption, Description, ElementName, InstanceID&hellip;}
CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties</p><p>Notice the CimClass property ROOT/StandardCimv2:MSFT_NetAdapter – this is one of the new WMI classes introduced in Windows 8. Does this class have any methods?</p><p>Get-CimClass -Namespace ROOT/StandardCimv2 -ClassName MSFT_NetAdapter | select -ExpandProperty CimClassMethods</p><p>Name<br>
—-<br>
RequestStateChange<br>
SetPowerState<br>
Reset<br>
EnableDevice<br>
OnlineDevice<br>
QuiesceDevice<br>
SaveProperties<br>
RestoreProperties<br>
Enable<br>
Disable<br>
Restart<br>
Lock<br>
Unlock<br>
Rename</p><p>These will be investigated in other posts &ldquo;“ maybe we get cmdlets to work with these as well</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2815/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2815/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2815&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Windows 8 Kindle app</title><link>https://powershell.org/articles/2013-03-01-windows-8-kindle-app/</link><guid>https://powershell.org/articles/2013-03-01-windows-8-kindle-app/</guid><pubDate>Fri, 01 Mar 2013 20:22:50 +0000</pubDate><description>&lt;p&gt;Amazon have released an update for the Windows 8 Kindle app that appears to have resolved the corrupted display issue that occurred after every few pages of reading.&lt;/p&gt;
&lt;p&gt;I would recommend updating the app immediately. The app now seems to be usable.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2814/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2814/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2814&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Amazon have released an update for the Windows 8 Kindle app that appears to have resolved the corrupted display issue that occurred after every few pages of reading.</p><p>I would recommend updating the app immediately. The app now seems to be usable.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2814/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2814/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2814&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Book offer"“AD Management in a Month of Lunches</title><link>https://powershell.org/articles/2013-02-27-book-offer-ad-management-in-a-month-of-lunches/</link><guid>https://powershell.org/articles/2013-02-27-book-offer-ad-management-in-a-month-of-lunches/</guid><pubDate>Wed, 27 Feb 2013 20:24:14 +0000</pubDate><description>&lt;p&gt;AD Management in a month of lunches is today&amp;quot;™s deal of the day from Manning &amp;ldquo;“ &lt;a href="http://www.manning.com/"&gt;www.manning.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The get 50% off today using code &lt;strong&gt;dotd0227cc. The offer is good for today only&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The same code can be used for 50% off PowerShell in Practice&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2813/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2813/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2813&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>AD Management in a month of lunches is today"™s deal of the day from Manning &ldquo;“<a href="http://www.manning.com/">www.manning.com</a></p><p>The get 50% off today using code<strong>dotd0227cc. The offer is good for today only</strong></p><p>The same code can be used for 50% off PowerShell in Practice</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2813/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2813/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2813&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Last nights Live Meeting</title><link>https://powershell.org/articles/2013-02-27-last-nights-live-meeting/</link><guid>https://powershell.org/articles/2013-02-27-last-nights-live-meeting/</guid><pubDate>Wed, 27 Feb 2013 20:18:54 +0000</pubDate><description>&lt;p&gt;The sound was awful on last night&amp;quot;™s Live Meeting so I intend to re-record it at the weekend. I&amp;quot;™ll post the recording and scripts once its done.&lt;/p&gt;
&lt;p&gt;I&amp;quot;™m also investigating an alternative delivery mechanism that will hopefully solve the sound issues.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2812/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2812/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2812&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>The sound was awful on last night"™s Live Meeting so I intend to re-record it at the weekend. I"™ll post the recording and scripts once its done.</p><p>I"™m also investigating an alternative delivery mechanism that will hopefully solve the sound issues.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2812/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2812/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2812&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Filter or LDAP filter</title><link>https://powershell.org/articles/2013-02-27-filter-or-ldap-filter/</link><guid>https://powershell.org/articles/2013-02-27-filter-or-ldap-filter/</guid><pubDate>Wed, 27 Feb 2013 20:16:47 +0000</pubDate><description>&lt;p&gt;Many of the Microsoft AD cmdlets have a &amp;ldquo;“Filter and an &amp;ldquo;“LDAPFilter parameter. So what&amp;rdquo;™s the difference?&lt;/p&gt;
&lt;p&gt;PS&amp;gt; Get-Help Get-ADUser -Parameter *Filter*&lt;/p&gt;
&lt;p&gt;-Filter&lt;br&gt;
Specifies a query string that retrieves Active Directory objects. This string uses the PowerShell Expression&lt;br&gt;
Language syntax. The PowerShell Expression Language syntax provides rich type-conversion support for value types received by the Filter parameter. The syntax uses an in-order representation, which means that the operator is placed between the operand and the value. For more information about the Filter parameter, see about_ActiveDirectory_Filter.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Many of the Microsoft AD cmdlets have a &ldquo;“Filter and an &ldquo;“LDAPFilter parameter. So what&rdquo;™s the difference?</p><p>PS&gt; Get-Help Get-ADUser -Parameter *Filter*</p><p>-Filter<br>
Specifies a query string that retrieves Active Directory objects. This string uses the PowerShell Expression<br>
Language syntax. The PowerShell Expression Language syntax provides rich type-conversion support for value types received by the Filter parameter. The syntax uses an in-order representation, which means that the operator is placed between the operand and the value. For more information about the Filter parameter, see about_ActiveDirectory_Filter.</p><p>-LDAPFilter<br>
Specifies an LDAP query string that is used to filter Active Directory objects. You can use this parameter to run your existing LDAP queries. The Filter parameter syntax supports the same functionality as the LDAP syntax. For more information, see the Filter parameter description and the about_ActiveDirectory_Filter.</p><p>This means you have two ways to approach a problem. Lets think about finding a single user:</p><p>Get-ADUser -LDAPFilter &ldquo;(samAccountName=Richard)&rdquo;</p><p>Get-ADUser -Filter {samAccountName -eq &lsquo;Richard&rsquo;}</p><p>The LDAPFilter uses LDAP query syntax &ldquo;“ attribute and value. Filter uses PowerShell syntax. You could think of the &ldquo;“Filter as a condensed version of</p><p>Get-ADUser -Filter * | where samAccountName -eq &lsquo;Richard&rsquo;</p><p>Use the &ldquo;“Filter parameter because its less typing and you filter early &ldquo;“ especially important if querying across a network.</p><p>You can use multiple attributes in the filters – &amp; implies AND in the LDAP filter</p><p>Get-ADUser -LDAPFilter &ldquo;(&amp;(givenname=Bill)(sn=Green))&rdquo;</p><p>Get-ADUser -Filter {GivenName -eq &lsquo;Bill&rsquo; -and Surname -eq &lsquo;Green&rsquo;}</p><p>The LDAP filter HAS to use the correct attribute name but Filter uses the property name returned by Get-ADUser.</p><p>LDAP filters can get very complicated very quickly. For instance if you want to find the disabled user accounts</p><p>Get-ADUser -LDAPFilter &ldquo;(&amp;(objectclass=user)(objectcategory=user)(useraccountcontrol:1.2.840.113556.1.4.803:=2))&rdquo;</p><p>Get-ADUser -Filter {Enabled -eq $false}</p><p>Alternatively,and in my opinion, its simpler to use Search-ADaccount</p><p>Search-ADAccount -AccountDisabled &ldquo;“UsersOnly</p><p>Which one should you use? The one that best solves your problem. I mix &amp; match to suit the search I&rdquo;™m performing</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2811/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2811/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2811&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>PowerShell.org Forums Etiquette</title><link>https://powershell.org/articles/2013-02-27-powershell-org-forums-etiquette/</link><guid>https://powershell.org/articles/2013-02-27-powershell-org-forums-etiquette/</guid><pubDate>Wed, 27 Feb 2013 17:19:13 +0000</pubDate><description>&lt;p&gt;Folks often ask for some advice on what to do, and what not to do, in the forums. Here are some suggestions.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Don&amp;rsquo;t apologize for being a &amp;ldquo;noob&amp;rdquo; or &amp;ldquo;newbie&amp;rdquo; or &amp;ldquo;n00b.&amp;rdquo; There&amp;rsquo;s just no need - nobody will think you&amp;rsquo;re stupid, and the forums are all about asking questions. Just ask.&lt;/li&gt;
&lt;li&gt;Try to avoid using obscure or punctuation aliases (like ? and %) - use command names instead. It makes your post easier for everyone, including n00bs, to follow.&lt;/li&gt;
&lt;li&gt;Use the CODE or POWERSHELL buttons in the forums editor to format PowerShell and other code.&lt;/li&gt;
&lt;li&gt;If your problem is solved, find the little green checkmark button along the top of your message (or one of the replies; it&amp;rsquo;s near the Twitter and Facebook and other buttons), and click it. That helps indicate to everyone else that you found a solution.&lt;/li&gt;
&lt;li&gt;Don&amp;rsquo;t post massive scripts. We&amp;rsquo;re all volunteers, and we don&amp;rsquo;t have time to read all that, nor will we copy, paste, and run it. Post an excerpt, and clearly state what you&amp;rsquo;re having problems with.&lt;/li&gt;
&lt;li&gt;Post error messages, as appropriate. They help.&lt;/li&gt;
&lt;li&gt;Don&amp;rsquo;t ask folks to provide you with a complete script, or to rewrite your script. Again, we&amp;rsquo;re all volunteers - respect that we&amp;rsquo;re taking time to help you, and help us minimize that time.&lt;/li&gt;
&lt;li&gt;Try to ask just one question at a time. Posts with ten questions are a lot harder to help with.&lt;/li&gt;
&lt;li&gt;DO post what you&amp;rsquo;ve tried, what errors you got, and what didn&amp;rsquo;t work. It&amp;rsquo;s a lot easier, sometimes, to correct what you&amp;rsquo;ve already done than to try and write something from scratch.&lt;/li&gt;
&lt;li&gt;If you&amp;rsquo;ve been given a working solution, SAY THANK YOU! Then make sure you know WHY it works&amp;hellip; and ask for an explanation if you don&amp;rsquo;t!&lt;/li&gt;
&lt;li&gt;Take the time to educate yourself. Pick up a book, or a training video, or take a class, or attend a conference. Yes, those take time - but it&amp;rsquo;s time well-spent. If you&amp;rsquo;re continually asking other people to spend time answering questions that are &lt;em&gt;already&lt;/em&gt; answered in every book, video, course, etc&amp;hellip;. well, that&amp;rsquo;s kinda wasting &lt;em&gt;their&lt;/em&gt; time, right? Folks on the forums can help you more effectively if you have a base education first.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Have your own etiquette suggestions? Drop &amp;rsquo;em in the comments!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Folks often ask for some advice on what to do, and what not to do, in the forums. Here are some suggestions.</p><ol><li>Don&rsquo;t apologize for being a &ldquo;noob&rdquo; or &ldquo;newbie&rdquo; or &ldquo;n00b.&rdquo; There&rsquo;s just no need - nobody will think you&rsquo;re stupid, and the forums are all about asking questions. Just ask.</li><li>Try to avoid using obscure or punctuation aliases (like ? and %) - use command names instead. It makes your post easier for everyone, including n00bs, to follow.</li><li>Use the CODE or POWERSHELL buttons in the forums editor to format PowerShell and other code.</li><li>If your problem is solved, find the little green checkmark button along the top of your message (or one of the replies; it&rsquo;s near the Twitter and Facebook and other buttons), and click it. That helps indicate to everyone else that you found a solution.</li><li>Don&rsquo;t post massive scripts. We&rsquo;re all volunteers, and we don&rsquo;t have time to read all that, nor will we copy, paste, and run it. Post an excerpt, and clearly state what you&rsquo;re having problems with.</li><li>Post error messages, as appropriate. They help.</li><li>Don&rsquo;t ask folks to provide you with a complete script, or to rewrite your script. Again, we&rsquo;re all volunteers - respect that we&rsquo;re taking time to help you, and help us minimize that time.</li><li>Try to ask just one question at a time. Posts with ten questions are a lot harder to help with.</li><li>DO post what you&rsquo;ve tried, what errors you got, and what didn&rsquo;t work. It&rsquo;s a lot easier, sometimes, to correct what you&rsquo;ve already done than to try and write something from scratch.</li><li>If you&rsquo;ve been given a working solution, SAY THANK YOU! Then make sure you know WHY it works&hellip; and ask for an explanation if you don&rsquo;t!</li><li>Take the time to educate yourself. Pick up a book, or a training video, or take a class, or attend a conference. Yes, those take time - but it&rsquo;s time well-spent. If you&rsquo;re continually asking other people to spend time answering questions that are<em>already</em> answered in every book, video, course, etc&hellip;. well, that&rsquo;s kinda wasting<em>their</em> time, right? Folks on the forums can help you more effectively if you have a base education first.</li></ol><p>Have your own etiquette suggestions? Drop &rsquo;em in the comments!</p>
]]></content:encoded></item><item><title>Advanced Functions webcast</title><link>https://powershell.org/articles/2013-02-25-advanced-functions-webcast/</link><guid>https://powershell.org/articles/2013-02-25-advanced-functions-webcast/</guid><pubDate>Mon, 25 Feb 2013 19:30:24 +0000</pubDate><description>&lt;p&gt;Quick reminder that the UK PowerShell group is hosting a Live Meeting webcast on PowerShell Advanced functions tomorrow &amp;ldquo;“ details from&lt;/p&gt;
&lt;p&gt;&lt;a href="http://richardspowershellblog.wordpress.com/2013/02/18/uk-powershell-groupadvanced-functions/" title="http://richardspowershellblog.wordpress.com/2013/02/18/uk-powershell-groupadvanced-functions/"&gt;http://richardspowershellblog.wordpress.com/2013/02/18/uk-powershell-groupadvanced-functions/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2810/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2810/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2810&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Quick reminder that the UK PowerShell group is hosting a Live Meeting webcast on PowerShell Advanced functions tomorrow &ldquo;“ details from</p><p><a href="http://richardspowershellblog.wordpress.com/2013/02/18/uk-powershell-groupadvanced-functions/" title="http://richardspowershellblog.wordpress.com/2013/02/18/uk-powershell-groupadvanced-functions/">http://richardspowershellblog.wordpress.com/2013/02/18/uk-powershell-groupadvanced-functions/</a></p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2810/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2810/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2810&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>PowerShell in Depth"“nearly there</title><link>https://powershell.org/articles/2013-02-25-powershell-in-depth-nearly-there/</link><guid>https://powershell.org/articles/2013-02-25-powershell-in-depth-nearly-there/</guid><pubDate>Mon, 25 Feb 2013 19:26:27 +0000</pubDate><description>&lt;p&gt;PowerShell in Depth is rapidly approaching its publication date &amp;ldquo;“ see &lt;a href="http://www.manning.com/jones2"&gt;www.manning.com/jones2&lt;/a&gt; for details&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2809/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2809/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2809&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>PowerShell in Depth is rapidly approaching its publication date &ldquo;“ see<a href="http://www.manning.com/jones2">www.manning.com/jones2</a> for details</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2809/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2809/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2809&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>New book</title><link>https://powershell.org/articles/2013-02-25-new-book/</link><guid>https://powershell.org/articles/2013-02-25-new-book/</guid><pubDate>Mon, 25 Feb 2013 18:57:21 +0000</pubDate><description>&lt;p&gt;My latest book has been released on the Manning Early Access Program (MEAP). Active Directory Management in a Month of Lunches takes the newcomer to AD through the tasks they need to perform to manage their organization&amp;quot;™s AD.&lt;/p&gt;
&lt;p&gt;it assumes no knowledge of AD and shows how to perform the common management tasks from the GUI (AD Administrative Center &amp;amp; the venerable AD Users &amp;amp; Computers) as well as PowerShell (using the Microsoft cmdlets).&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>My latest book has been released on the Manning Early Access Program (MEAP). Active Directory Management in a Month of Lunches takes the newcomer to AD through the tasks they need to perform to manage their organization"™s AD.</p><p>it assumes no knowledge of AD and shows how to perform the common management tasks from the GUI (AD Administrative Center &amp; the venerable AD Users &amp; Computers) as well as PowerShell (using the Microsoft cmdlets).</p><p>Chapters 1-7 are currently available from<a href="http://www.manning.com%5Csiddaway3/">www.manning.com\siddaway3</a> with more to come soon</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2808/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2808/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2808&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>VERIFIED EFFECTIVE for PowerShell 3.0 Toolmaking now live</title><link>https://powershell.org/articles/2013-02-24-verified-effective-for-powershell-3-0-toolmaking-now-live/</link><guid>https://powershell.org/articles/2013-02-24-verified-effective-for-powershell-3-0-toolmaking-now-live/</guid><pubDate>Sun, 24 Feb 2013 19:10:05 +0000</pubDate><description>&lt;p&gt;&lt;a href="http://donjones.com/verified" title="Creating a Windows 2012 Domain Controller"&gt;It&amp;rsquo;s now available globally&lt;/a&gt;.&lt;br&gt;
I suggest downloading the Program Guide, which includes the agreement and directions for enrolling. There&amp;rsquo;s also a specific guide for the PowerShell 3.0 Toolmaking examination, which you should read prior to paying.&lt;br&gt;
Once you&amp;rsquo;ve paid, and sent in the necessary signed paperwork, you&amp;rsquo;ll get your exam info via e-mail. You can log in at any time to download your exam scenario and begin working. From the time of your first login, the clock starts ticking and you have 24 hours to upload your results. After uploading your results, you&amp;rsquo;ll hear back within 5 business days - these are graded by a human, not a machine, so be patient.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p><a href="http://donjones.com/verified" title="Creating a Windows 2012 Domain Controller">It&rsquo;s now available globally</a>.<br>
I suggest downloading the Program Guide, which includes the agreement and directions for enrolling. There&rsquo;s also a specific guide for the PowerShell 3.0 Toolmaking examination, which you should read prior to paying.<br>
Once you&rsquo;ve paid, and sent in the necessary signed paperwork, you&rsquo;ll get your exam info via e-mail. You can log in at any time to download your exam scenario and begin working. From the time of your first login, the clock starts ticking and you have 24 hours to upload your results. After uploading your results, you&rsquo;ll hear back within 5 business days - these are graded by a human, not a machine, so be patient.</p>
]]></content:encoded></item><item><title>Creating a Windows 2012 Domain Controller</title><link>https://powershell.org/articles/2013-02-21-creating-a-windows-2012-domain-controller/</link><guid>https://powershell.org/articles/2013-02-21-creating-a-windows-2012-domain-controller/</guid><pubDate>Thu, 21 Feb 2013 19:50:09 +0000</pubDate><description>&lt;p&gt;I decided to replace one of the DCs in my test environment with a Windows 2012 Server Core machine. Server Core has really come of age in Windows 2012 &amp;ldquo;“ its easy to configure.&lt;/p&gt;
&lt;p&gt;I&amp;rdquo;™ve covered configuring a server before but to recap:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Rename the machine &amp;ldquo;“ use Rename-Computer&lt;/li&gt;
&lt;li&gt;Set Network &amp;ldquo;“ use Set-NetIPInterface (address) &amp;amp; et-DnsClientServerAddress( dns address) &amp;amp; Rename-netAdapter&lt;/li&gt;
&lt;li&gt;Join to domain &amp;ldquo;“ use Add-Computer&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To create the domain controller use the ADDSDeployment module. You&amp;rdquo;™ll only find this on servers where you&amp;rdquo;™ve installed the AD Domain Services feature which you do like this:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I decided to replace one of the DCs in my test environment with a Windows 2012 Server Core machine. Server Core has really come of age in Windows 2012 &ldquo;“ its easy to configure.</p><p>I&rdquo;™ve covered configuring a server before but to recap:</p><ul><li>Rename the machine &ldquo;“ use Rename-Computer</li><li>Set Network &ldquo;“ use Set-NetIPInterface (address) &amp; et-DnsClientServerAddress( dns address) &amp; Rename-netAdapter</li><li>Join to domain &ldquo;“ use Add-Computer</li></ul><p>To create the domain controller use the ADDSDeployment module. You&rdquo;™ll only find this on servers where you&rdquo;™ve installed the AD Domain Services feature which you do like this:</p><p>Install-WindowsFeature -Name AD-Domain-Services -Confirm:$false</p><p>Import the module</p><p>Import-Module ADDSDeployment<br>
Get-Command -Module ADDSDeployment</p><p>Create the Domain Controller. This is the equivalent of running DCPROMO in earlier versions. Even better you don&rdquo;™t need the answer file. Everything is a parameter on the cmdlet.</p><p>Install-ADDSDomain Controller -DomainName &ldquo;manticore.org&rdquo; -InstallDns -Credential (Get-Credential manticore\richard) -ApplicationPartitionsToReplicate *</p><p>Thats it! Just wait for replication to happen.</p><p>You can also demote a domain controller</p><p>$cred = Get-Credential<br>
Uninstall-ADDSDomainController -Credential $cred -RemoveApplicationPartitions -Confirm:$false</p><p>Restart the machine and uninstall AD &amp; DNS</p><p>Uninstall-WindowsFeature -Name AD-Domain-Services, DNS -Confirm:$false<br>
Restart-Computer -ComputerName dc02</p><p>Leave the domain</p><p>$cred = Get-Credential manticore\richard<br>
Remove-Computer -UnjoinDomainCredential $cred -Workgroup Test</p><p>Trash the VM.</p><p>And best of all it works over remoting. You will need to recreate the session for restarts &amp; changes but it is really easy.</p><p>Server Core is now a much friendlier option.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2807/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2807/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2807&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>CIM cmdlets and remote access</title><link>https://powershell.org/articles/2013-02-18-cim-cmdlets-and-remote-access/</link><guid>https://powershell.org/articles/2013-02-18-cim-cmdlets-and-remote-access/</guid><pubDate>Mon, 18 Feb 2013 22:33:04 +0000</pubDate><description>&lt;p&gt;When you used the WMI cmdlets&lt;/p&gt;
&lt;p&gt;Get-WmiObject -Class Win32_logicalDisk -ComputerName RSLAPTOP01&lt;/p&gt;
&lt;p&gt;You were using DCOM to access the remote machine. Even if you accessed the local machine you were using DCOM.&lt;/p&gt;
&lt;p&gt;This changes in PowerShell v3 when using the CIM cmdlets.&lt;/p&gt;
&lt;p&gt;If you don&amp;quot;™t use a computername&lt;/p&gt;
&lt;p&gt;Get-CimInstance -ClassName Win32_logicalDisk&lt;/p&gt;
&lt;p&gt;You use DCOM to access the local machine.&lt;/p&gt;
&lt;p&gt;If you use &amp;ldquo;“computername&lt;/p&gt;
&lt;p&gt;Get-CimInstance -ClassName Win32_logicalDisk -ComputerName RSLAPTOP01&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You use WSMAN to access the machine named &amp;ldquo;“ irrespective of if it is local or remote&lt;/strong&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>When you used the WMI cmdlets</p><p>Get-WmiObject -Class Win32_logicalDisk -ComputerName RSLAPTOP01</p><p>You were using DCOM to access the remote machine. Even if you accessed the local machine you were using DCOM.</p><p>This changes in PowerShell v3 when using the CIM cmdlets.</p><p>If you don"™t use a computername</p><p>Get-CimInstance -ClassName Win32_logicalDisk</p><p>You use DCOM to access the local machine.</p><p>If you use &ldquo;“computername</p><p>Get-CimInstance -ClassName Win32_logicalDisk -ComputerName RSLAPTOP01</p><p><strong>You use WSMAN to access the machine named &ldquo;“ irrespective of if it is local or remote</strong></p><p>A further complication is that the named machine has to be running WSMAN 3.0 i.e. PowerShell v3 is installed.</p><p>If you try to access a PowerShell v2 (WSMAN 2.0) machine with the CIM cmdlets you will get an error. The way round that is to create a CIMsession using DCOM as the transport protocol. If you want to learn how to do that you&rdquo;™ll have to wait until after my session at the PowerShell Summit in April or buy a copy of PowerShell and WMI from<a href="http://www.manning.com/siddaway2">www.manning.com/siddaway2</a></p><p>I saw a number of people using the CIM cmdlets in the scripting games without thought to connectivity issues like this.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2806/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2806/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2806&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>UK PowerShell Group"“Advanced functions</title><link>https://powershell.org/articles/2013-02-18-uk-powershell-group-advanced-functions/</link><guid>https://powershell.org/articles/2013-02-18-uk-powershell-group-advanced-functions/</guid><pubDate>Mon, 18 Feb 2013 19:57:08 +0000</pubDate><description>&lt;p&gt;When: Tuesday, Feb 26, 2013 7:30 PM (GMT)&lt;/p&gt;
&lt;p&gt;Where: Virtual&lt;/p&gt;
&lt;p&gt;*&lt;del&gt;*&lt;/del&gt;*&lt;del&gt;*&lt;/del&gt;*&lt;del&gt;*&lt;/del&gt;*&lt;del&gt;*&lt;/del&gt;*~*&lt;/p&gt;
&lt;p&gt;Advanced functions give you ability to create functions that act like cmdlets. Learn how to get the most from this powerful part of the PowerShell functionality&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Notes&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Richard Siddaway has invited you to attend an online meeting using Live Meeting.&lt;br&gt;
&lt;strong&gt;&lt;a href="https://www.livemeeting.com/cc/usergroups/join?id=G79DNP&amp;amp;role=attend&amp;amp;pw=9%24t%23%26PK%238"&gt;Join the meeting.&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Audio Information&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Computer Audio&lt;/strong&gt;&lt;br&gt;
To use computer audio, you need speakers and microphone, or a headset.&lt;br&gt;
&lt;strong&gt;First Time Users:&lt;/strong&gt;&lt;br&gt;
To save time before the meeting, &lt;a href="http://go.microsoft.com/fwlink/?LinkId=90703"&gt;check your system&lt;/a&gt; to make sure it is ready to use Microsoft Office Live Meeting.&lt;br&gt;
&lt;strong&gt;Troubleshooting&lt;/strong&gt;&lt;br&gt;
Unable to join the meeting? Follow these steps:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>When: Tuesday, Feb 26, 2013 7:30 PM (GMT)</p><p>Where: Virtual</p><p>*<del>*</del>*<del>*</del>*<del>*</del>*<del>*</del>*~*</p><p>Advanced functions give you ability to create functions that act like cmdlets. Learn how to get the most from this powerful part of the PowerShell functionality</p><p><strong>Notes</strong></p><p>Richard Siddaway has invited you to attend an online meeting using Live Meeting.<br><strong><a href="https://www.livemeeting.com/cc/usergroups/join?id=G79DNP&amp;role=attend&amp;pw=9%24t%23%26PK%238">Join the meeting.</a></strong><br><strong>Audio Information</strong><br><strong>Computer Audio</strong><br>
To use computer audio, you need speakers and microphone, or a headset.<br><strong>First Time Users:</strong><br>
To save time before the meeting,<a href="http://go.microsoft.com/fwlink/?LinkId=90703">check your system</a> to make sure it is ready to use Microsoft Office Live Meeting.<br><strong>Troubleshooting</strong><br>
Unable to join the meeting? Follow these steps:</p><ol><li><p>Copy this address and paste it into your web browser:<br><a href="https://www.livemeeting.com/cc/usergroups/join">https://www.livemeeting.com/cc/usergroups/join</a></p></li><li><p>Copy and paste the required information:<br>
Meeting ID: G79DNP<br>
Entry Code: 9$t#&amp;PK#8<br>
Location:<a href="https://www.livemeeting.com/cc/usergroups">https://www.livemeeting.com/cc/usergroups</a></p></li></ol><p>If you still cannot enter the meeting,<a href="http://r.office.microsoft.com/r/rlidLiveMeeting?p1=12&amp;p2=en_US&amp;p3=LMInfo&amp;p4=support">contact support</a></p><p><strong>Notice</strong><br>
Microsoft Office Live Meeting can be used to record meetings. By participating in this meeting, you agree that your communications may be monitored or recorded at any time during the meeting.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2805/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2805/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2805&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Filtering</title><link>https://powershell.org/articles/2013-02-18-filtering/</link><guid>https://powershell.org/articles/2013-02-18-filtering/</guid><pubDate>Mon, 18 Feb 2013 19:38:41 +0000</pubDate><description>&lt;p&gt;I&amp;quot;™ve been grading the scripts in the warm up events for the Scripting Games and noticed a lot of people doing this:&lt;/p&gt;
&lt;p&gt;Get-WmiObject -Class Win32_LogicalDisk | where {$_.DriveType -eq 3}&lt;/p&gt;
&lt;p&gt;Ok now it works but there are a couple of things wrong with this approach.&lt;/p&gt;
&lt;p&gt;Firstly, you are ignoring the built in capabilities of the get-wmiobject cmdlet&lt;/p&gt;
&lt;p&gt;PS&amp;gt; Get-Command Get-WmiObject -Syntax&lt;/p&gt;
&lt;p&gt;Get-WmiObject [-Class] [[-Property] ] &lt;strong&gt;[-Filter ]&lt;/strong&gt; [-Amended] [-DirectRead] [-AsJob]&lt;br&gt;
[-Impersonation ] [-Authentication ] [-Locale ]&lt;br&gt;
[-EnableAllPrivileges] [-Authority ] [-Credential
] [-ThrottleLimit ] [-ComputerName&lt;br&gt;
] [-Namespace ] []&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I"™ve been grading the scripts in the warm up events for the Scripting Games and noticed a lot of people doing this:</p><p>Get-WmiObject -Class Win32_LogicalDisk | where {$_.DriveType -eq 3}</p><p>Ok now it works but there are a couple of things wrong with this approach.</p><p>Firstly, you are ignoring the built in capabilities of the get-wmiobject cmdlet</p><p>PS&gt; Get-Command Get-WmiObject -Syntax</p><p>Get-WmiObject [-Class] [[-Property] ]<strong>[-Filter ]</strong> [-Amended] [-DirectRead] [-AsJob]<br>
[-Impersonation ] [-Authentication ] [-Locale ]<br>
[-EnableAllPrivileges] [-Authority ] [-Credential
] [-ThrottleLimit ] [-ComputerName<br>
] [-Namespace ] []</p><p>Get-WmiObject [[-Class] ] [-Recurse] [-Amended] [-List] [-AsJob] [-Impersonation ]<br>
[-Authentication ] [-Locale ] [-EnableAllPrivileges] [-Authority ] [-Credential</p><p>] [-ThrottleLimit ] [-ComputerName ] [-Namespace ] []</p><p>Get-WmiObject -Query [-Amended] [-DirectRead] [-AsJob] [-Impersonation ] [-Authentication<br>
] [-Locale ] [-EnableAllPrivileges] [-Authority ] [-Credential
]<br>
[-ThrottleLimit ] [-ComputerName ] [-Namespace ] []</p><p>Get-WmiObject [-Amended] [-AsJob] [-Impersonation ] [-Authentication ]<br>
[-Locale ] [-EnableAllPrivileges] [-Authority ] [-Credential
] [-ThrottleLimit ]<br>
[-ComputerName ] [-Namespace ] []</p><p>Get-WmiObject [-Amended] [-AsJob] [-Impersonation ] [-Authentication ]<br>
[-Locale ] [-EnableAllPrivileges] [-Authority ] [-Credential
] [-ThrottleLimit ]<br>
[-ComputerName ] [-Namespace ] []</p><p>Notice the filter parameter in the first parameter set.</p><p>When you run Get-WMIObject in effect you are running a WQL query</p><p>&ldquo;SELECT * FROM Win32_LogicalDisk&rdquo;</p><p>if you move the filter into the query it changes to</p><p>&ldquo;SELECT * FROM Win32_LogicalDisk WHERE DriveType = 3&rdquo;</p><p>This is coded in the cmdlet as</p><p>Get-WmiObject -Class Win32_LogicalDisk -Filter &ldquo;DriveType = 3″</p><p>Why is this better?</p><p>Because you are doing less work against the WMI repository &ldquo;“ therefore more efficient.</p><p>Also if you are running against a remote machine filtering in the WMI query means you bring less data back across the network which makes you whole process more efficient.</p><p>Bottom line &ldquo;“ filter as early as you sensibly can and preferably on the remote machine.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2804/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2804/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2804&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>"Verified Effective" About Ready to Go Live</title><link>https://powershell.org/articles/2013-02-18-verified-effective-about-ready-to-go-live/</link><guid>https://powershell.org/articles/2013-02-18-verified-effective-about-ready-to-go-live/</guid><pubDate>Mon, 18 Feb 2013 17:01:32 +0000</pubDate><description>&lt;p&gt;Before the verification exam becomes available to the public, I need ONE OR TWO people to be the first through the complete program. This is not a &amp;ldquo;beta;&amp;rdquo; the exam is finalized and you will have to pay for your verification. The first one or two people will be semi-automated as I nail down the final payment integration bits, and then we&amp;rsquo;ll throw it open to the public.&lt;br&gt;
If you&amp;rsquo;re interested, contact me at don at Concentrated Tech.com. First come, first served.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Before the verification exam becomes available to the public, I need ONE OR TWO people to be the first through the complete program. This is not a &ldquo;beta;&rdquo; the exam is finalized and you will have to pay for your verification. The first one or two people will be semi-automated as I nail down the final payment integration bits, and then we&rsquo;ll throw it open to the public.<br>
If you&rsquo;re interested, contact me at don at Concentrated Tech.com. First come, first served.</p>
]]></content:encoded></item><item><title>PhillyPoSH 02/07/2013 meeting summary and presentation materials</title><link>https://powershell.org/articles/2013-02-16-phillyposh-02072013-meeting-summary-and-presentation-materials/</link><guid>https://powershell.org/articles/2013-02-16-phillyposh-02072013-meeting-summary-and-presentation-materials/</guid><pubDate>Sun, 17 Feb 2013 02:04:19 +0000</pubDate><description>&lt;p&gt;&lt;a href="http://jdhitsolutions.com/"&gt;Jeff Hicks&lt;/a&gt; (Microsoft MVP and &lt;a href="http://www.manning.com/search/results?cx=008207406337866288189%3Avej9zumcdec&amp;amp;cof=FORID%3A9&amp;amp;ie=UTF-8&amp;amp;q=Jeffery+Hicks&amp;amp;sa=Search"&gt;Author&lt;/a&gt;) gave a presentation on &amp;ldquo;Getting Started with PowerShell Advanced Functions&amp;rdquo;. You can download the presentation and example scripts &lt;a href="https://powershell.org/wp-content/uploads/2013/02/PhillyPosh_2013-02-07_Presentations.zip"&gt;here&lt;/a&gt; and watch a recording of the presentation below on our &lt;a href="http://www.youtube.com/channel/UCAc_ow5FIJtRpvew__9Iqzg?feature=watch"&gt;YouTube channel&lt;/a&gt;.&lt;br&gt;
[youtube_sc url=&amp;ldquo;http://www.youtube.com/watch?v=77VbOO14DFE&amp;amp;feature=youtu.be&amp;rdquo;]&lt;br&gt;
You can keep up with Jeff at his &lt;a href="http://jdhitsolutions.com/blog/"&gt;blog&lt;/a&gt;, on &lt;a href="https://twitter.com/jeffhicks"&gt;Twitter, &lt;/a&gt;and on &lt;a href="http://gplus.to/JeffHicks"&gt;Google Plus&lt;/a&gt;&lt;br&gt;
We would also like to thank &lt;a href="http://www.interfacett.com/"&gt;Interfacett&lt;/a&gt; and &lt;a href="https://powershell.org/"&gt;Powershell.org&lt;/a&gt; for providing funding for this meeting!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p><a href="http://jdhitsolutions.com/">Jeff Hicks</a> (Microsoft MVP and<a href="http://www.manning.com/search/results?cx=008207406337866288189%3Avej9zumcdec&amp;cof=FORID%3A9&amp;ie=UTF-8&amp;q=Jeffery+Hicks&amp;sa=Search">Author</a>) gave a presentation on &ldquo;Getting Started with PowerShell Advanced Functions&rdquo;. You can download the presentation and example scripts<a href="https://powershell.org/wp-content/uploads/2013/02/PhillyPosh_2013-02-07_Presentations.zip">here</a> and watch a recording of the presentation below on our<a href="http://www.youtube.com/channel/UCAc_ow5FIJtRpvew__9Iqzg?feature=watch">YouTube channel</a>.<br>
[youtube_sc url=&ldquo;http://www.youtube.com/watch?v=77VbOO14DFE&amp;feature=youtu.be&rdquo;]<br>
You can keep up with Jeff at his<a href="http://jdhitsolutions.com/blog/">blog</a>, on<a href="https://twitter.com/jeffhicks">Twitter, </a>and on<a href="http://gplus.to/JeffHicks">Google Plus</a><br>
We would also like to thank<a href="http://www.interfacett.com/">Interfacett</a> and<a href="https://powershell.org/">Powershell.org</a> for providing funding for this meeting!</p>
]]></content:encoded></item><item><title>PowerShell Workflow"“the complete series</title><link>https://powershell.org/articles/2013-02-13-powershell-workflow-the-complete-series/</link><guid>https://powershell.org/articles/2013-02-13-powershell-workflow-the-complete-series/</guid><pubDate>Wed, 13 Feb 2013 19:34:04 +0000</pubDate><description>&lt;p&gt;The series of articles on PowerShell workflows that are appearing on the Scripting Guy blog is now complete.&lt;/p&gt;
&lt;p&gt;The articles in the series that have been published are:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/09/powershell-workflows-nesting.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/09/powershell-workflows-nesting.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/16/powershell-workflows-job-engine.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/16/powershell-workflows-job-engine.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/23/powershell-workflows-restarting-the-computer.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/23/powershell-workflows-restarting-the-computer.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/30/powershell-workflows-using-parameters.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/30/powershell-workflows-using-parameters.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/06/powershell-workflows-design-considerations.aspx" title="http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/06/powershell-workflows-design-considerations.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/06/powershell-workflows-design-considerations.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/13/powershell-workflows-a-practical-example.aspx" title="http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/13/powershell-workflows-a-practical-example.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/13/powershell-workflows-a-practical-example.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The series is complete for now but as workflow is such a new topic expect more on it in the future.&lt;/p&gt;
&lt;p&gt;Until then Enjoy!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2803/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2803/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2803&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>The series of articles on PowerShell workflows that are appearing on the Scripting Guy blog is now complete.</p><p>The articles in the series that have been published are:</p><p><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx</a></p><p><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx</a></p><p><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/09/powershell-workflows-nesting.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/09/powershell-workflows-nesting.aspx</a></p><p><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/16/powershell-workflows-job-engine.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/16/powershell-workflows-job-engine.aspx</a></p><p><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/23/powershell-workflows-restarting-the-computer.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/23/powershell-workflows-restarting-the-computer.aspx</a></p><p><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/30/powershell-workflows-using-parameters.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/30/powershell-workflows-using-parameters.aspx</a></p><p><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/06/powershell-workflows-design-considerations.aspx" title="http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/06/powershell-workflows-design-considerations.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/06/powershell-workflows-design-considerations.aspx</a></p><p><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/13/powershell-workflows-a-practical-example.aspx" title="http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/13/powershell-workflows-a-practical-example.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/13/powershell-workflows-a-practical-example.aspx</a></p><p>The series is complete for now but as workflow is such a new topic expect more on it in the future.</p><p>Until then Enjoy!</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2803/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2803/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2803&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Winter Scripting Camp: The Post Mortem</title><link>https://powershell.org/articles/2013-02-11-winter-scripting-camp-the-post-mortem/</link><guid>https://powershell.org/articles/2013-02-11-winter-scripting-camp-the-post-mortem/</guid><pubDate>Mon, 11 Feb 2013 21:51:59 +0000</pubDate><description>&lt;p&gt;Ok, aftermath time. In Winter Scripting Camp I saw some very cool stuff, but I know folks want to learn from this event too, so I want to call out some stuff that I didn&amp;rsquo;t like so much, and explain why. I&amp;rsquo;m keeping these brief - if you&amp;rsquo;d like a longer explanation, hit me up in the &lt;a href="https://powershell.org/discuss/"&gt;PowerShell Q&amp;amp;A forum&lt;/a&gt;. BTW, none of the discussion below implies anything about the grade I awarded the entry. I considered a much broader range of criteria and opinions in awarding grades.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Ok, aftermath time. In Winter Scripting Camp I saw some very cool stuff, but I know folks want to learn from this event too, so I want to call out some stuff that I didn&rsquo;t like so much, and explain why. I&rsquo;m keeping these brief - if you&rsquo;d like a longer explanation, hit me up in the<a href="/discuss/">PowerShell Q&amp;A forum</a>. BTW, none of the discussion below implies anything about the grade I awarded the entry. I considered a much broader range of criteria and opinions in awarding grades.</p><h2 id="" class="ps-heading"><a class="ps-heading-anchor" href="#" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>My -f Nitpick</p><p>This bugged me a wee bit. I know, it&rsquo;s a nit:</p><p><code>Write-Warning ("{0} not online" -f $computer)</code>I&rsquo;d personally have done:</p><p><code>Write-Warning "$computer not online"</code>Personal preference; the latter is easier to read. I don&rsquo;t like using -f unless I actually need its formatting capability.</p><h2 id="my-preference-is-no-preference" class="ps-heading">My Preference is No Preference<a class="ps-heading-anchor" href="#my-preference-is-no-preference" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Next up, a script with this:</p><p><code>#$script:DebugPreference = "Continue" # debug msgs on $script:DebugPreference =  "SilentlyContinue" # debug msgs off</code>This only bugged me because this was in a script that contained a function; the function implemented [CmdletBinding()]. That means the function would suppress Write-Debug by default, and enable it when run with -Debug. Never a need to mess with those preference variables in an advanced function.</p><h2 id="redundant-code" class="ps-heading">Redundant Code<a class="ps-heading-anchor" href="#redundant-code" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>I noticed this:</p><p><code>END{Clear-Variable -Name obj}</code>Nothing wrong with that, but it&rsquo;s redundant. The variable $obj was created inside the function; PowerShell deletes the variable when its enclosing scope is destroyed. So the END block is just unnecessary code and an unnecessary step - forcing the shell to delete something before removing the scope, which would have deleted it anyway.</p><h2 id="no-examples" class="ps-heading">No Examples?<a class="ps-heading-anchor" href="#no-examples" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Another one: The author took a great deal of time to put in detailed usage examples for their command. But didn&rsquo;t do so in comment-based help&hellip; which seems odd, because they&rsquo;d added comment-based help already. That made the examples impossible to see unless you opened the script, which kinda defeats the point :(.</p><h2 id="i-got-your-silentlycontinue-right-here" class="ps-heading">I Got Your SilentlyContinue Right Here&hellip;<a class="ps-heading-anchor" href="#i-got-your-silentlycontinue-right-here" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>This is a huge concern for me, and it<strong>is</strong> something I deducted points for.<strong>Please don&rsquo;t misuse</strong><em>-ErrorAction SilentlyContinue</em><strong>and be very judicious</strong> with<em>$ErrorActionPreference=&lsquo;SilentlyContinue&rsquo;</em>. The former is appropriate when<em>you don&rsquo;t care if there&rsquo;s an error,</em> like deleting a file that doesn&rsquo;t exist. You get an error, but who cares, because mission accomplished, right? Don&rsquo;t just suppress errors. I get really bugged at SilentlyContinue on Get-WmiObject statements, for example. It&rsquo;s bad coding. The latter example<em>will make me fail your script entirely</em> if you just chuck it in at the top of a script. You&rsquo;re suppressing every error the script might generate, and it makes me wonder what you&rsquo;re hiding. Messing with $ErrorActionPreference is appropriate only when you need to suppress/handle a specific error that might be raised by a method or something else that doesn&rsquo;t have an -ErrorAction parameter. I saw some egregious overuse of this, and it&rsquo;s a bad, bad, bad, bad, bad coding practice.<br>
Sadly, some of my fellow judges disagree with me on this and think that<em>-ErrorAction SilentlyContinue</em> is merited. That&rsquo;s fine; that&rsquo;s why we have multiple judges looking at each entry. I say, if you&rsquo;re not going to<em>handle</em> an error, don&rsquo;t<em>suppress</em> it. Otherwise whoeever is running your command will be, like, &ldquo;did anything just happen, or not?&rdquo; Either let the default error messages shine through, or come up with your own alternative.<br>
I&rsquo;m gonna get a class of whiskey. Be right back.</p><h2 id="consistency" class="ps-heading">Consistency!<a class="ps-heading-anchor" href="#consistency" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Ah, that&rsquo;s better. Next up is this:</p><p><code>[Parameter(Mandatory=$true, ValueFromPipeline=$true)][string[]]$ComputerNames</code>Try to stay consistent with PowerShell&rsquo;s own naming. Look at Get-WmiObject. What parameter does it use to accept computer names? -ComputerName. Not -ComputerNames. So your commands should all use -ComputerName, even if they&rsquo;re accepting more than one computer name. Keep your public interface - your parameter and command names - consistent.</p><h2 id="youre-not-an-accumulator" class="ps-heading">You&rsquo;re Not an Accumulator<a class="ps-heading-anchor" href="#youre-not-an-accumulator" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p><code>begin {         $results = @()     } process { $results += # whatever } end {         $results | Format-Table -AutoSize     }</code>Ouch. Don&rsquo;t like to see this. The purpose of the pipeline is to accumulate output - you shouldn&rsquo;t be building internal arrays to do that. And you also shouldn&rsquo;t ever, ever, ever, ever, almost ever use a Format command in your function. When you do that, you&rsquo;re preventing me from piping the output of your command to a CSV, or to XML, or into a GridView, or anyplace else. You&rsquo;ve made your command non-reusable outside of your original scenario, a very poor programming practice. Just use Write-Output to write objects to the pipeline, and let the shell handle it from there.</p><h2 id="args0" class="ps-heading">$Args[0]<a class="ps-heading-anchor" href="#args0" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Look, if you&rsquo;re going to accept parameters,<em>document them</em> in a Param() block. So they have names and I can figure them out. $ComputerName I understand; what does $args[0] contain? I can&rsquo;t glance and tell - I have to follow the logic if your script, which means it isn&rsquo;t self-documenting, which means I&rsquo;m sad.</p><h2 id="write-host" class="ps-heading">Write-Host<a class="ps-heading-anchor" href="#write-host" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>I will not be kind to you if you use Write-Host as a means of producing output from your script, unless your script/command is named &ldquo;Show-XXXXX,&rdquo; indicating its only sad purpose in life is to display information on the screen and never anyplace else.</p><h2 id="dont-overthink" class="ps-heading">Don&rsquo;t OVERTHINK<a class="ps-heading-anchor" href="#dont-overthink" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Too many people started treating this like a certification exam, unfortunately, and we&rsquo;re going to be making some changes to the real Games to address that. A lot of folks just frankly overthought things. In one case, we were really just looking for something like:</p><p><code>Get-WmiObject -ClassName Win32_Volume -ComputerName (Get-Content names.txt) | Select-Object -Property DeviceID,@{n='FreeSpace(GB)';e={$PSItem.FreeSpace / 1GB -as [int]}}</code>(That isn&rsquo;t the exact answer to an event - it&rsquo;s an illustration). In many cases we got multi-line scripts that created a dozen variables, suppressed errors (grr), pinged computers&hellip; sometimes, less is more. Again, I&rsquo;m not saying anyone got down-checked for all the extra work, but guys and gals<em>try not to overthink this.</em> As I said, we&rsquo;re going to implement changes in the way scenarios are created for the real Games, because we want you all using creative approaches and worrying less about ticking off marks in a list. &ldquo;Did I add error handling? Did I ping the computers? What am I missing? What secret thing are they looking for that I forgot?&rdquo; Relax a little!</p><h2 id="up-next" class="ps-heading">Up Next&hellip;<a class="ps-heading-anchor" href="#up-next" aria-label="Link to this section" title="Link to this section"><i class="fas fa-link" aria-hidden="true"/></a></h2><p>Now&hellip; what&rsquo;s coming up for the real Scripting Games? Some changes, based on what we learned during Camp. Stay tuned.</p>
]]></content:encoded></item><item><title>Want to be VERIFIED EFFECTIVE for PowerShell? Here's what to expect.</title><link>https://powershell.org/articles/2013-02-05-want-to-be-verified-effective-for-powershell-heres-what-to-expect/</link><guid>https://powershell.org/articles/2013-02-05-want-to-be-verified-effective-for-powershell-heres-what-to-expect/</guid><pubDate>Tue, 05 Feb 2013 20:24:27 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;re well into our beta for the VERIFIED EFFECTIVEâ„¢ Windows PowerShell 3.0 Toolmaker exam, and expect the program to go live in March or April of 2013. There&amp;rsquo;s a good bit of information on the &lt;a href="http://donjones.com/verified"&gt;program home page&lt;/a&gt; that you should review if you&amp;rsquo;re interested in getting verified.&lt;/p&gt;
&lt;p&gt;[As a note, once the program goes live, it&amp;rsquo;ll be available to anyone worldwide - although the exam will only be available in English for the foreseeable future; we don&amp;rsquo;t have the resources at this time to offer localized versions]
I should point out first that we&amp;rsquo;re doing this program through my company, rather than directly through PowerShell.org, mainly because of some legalities. My company (Concentrated Tech) has the insurance and other items in place needed to do something like this, and I didn&amp;rsquo;t want PowerShell.org, Inc., to have to pay for those things. That said, a &lt;em&gt;lot&lt;/em&gt; of folks have been involved in vetting and designing the exam scenarios. Another advantage of using Concentrated Tech is that the company is set up to do a lot of the interviewing and statistical analysis needed to make a relevant exam.
The cost is the second thing I&amp;rsquo;ll discuss: at $150/person, I know it&amp;rsquo;s not cheap. But at least two human beings look at each person&amp;rsquo;s work - there&amp;rsquo;s no machine grading - and they gotta get paid. We also need to recoup some of the substantial investment that went into the exam design. Over a 3-year period, it&amp;rsquo;ll hopefully be about break-even. We&amp;rsquo;ll see.
On to the exam itself. There are a variety of &amp;ldquo;forms&amp;rdquo; for the exam, meaning everyone isn&amp;rsquo;t getting the same assignment. That said, the approach for each form is pretty much the same. You&amp;rsquo;ll get 2-3 &amp;ldquo;assignments&amp;rdquo; to complete, all of which involve writing scripts and/or commands. You get a specified amount of time to complete your assignments.
(as an aside, making multiple different exams that all test substantially the same skills is really tough, which is one reason we did a lot of testing and statistical analysis - to ensure the equivalency of each form - as part of the development process).
Some assignments are straightforward: write a script that does this, this, and that. You&amp;rsquo;re given a bunch of criteria and just have to spew out the commands. There&amp;rsquo;s room for creativity - so long as you (a) meet all the criteria and (b) comply with the stated best practices, you pass. &amp;ldquo;Extra&amp;rdquo; stuff doesn&amp;rsquo;t count against you, and the exact approach you use isn&amp;rsquo;t graded - so long as you achieve all of the results and comply with all of the stated criteria.
The &amp;ldquo;main&amp;rdquo; assignment in each form is harder. You&amp;rsquo;re given a shell transcript, and you&amp;rsquo;re asked to look at it and duplicate the tools you see used in it. For example:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;re well into our beta for the VERIFIED EFFECTIVEâ„¢ Windows PowerShell 3.0 Toolmaker exam, and expect the program to go live in March or April of 2013. There&rsquo;s a good bit of information on the<a href="http://donjones.com/verified">program home page</a> that you should review if you&rsquo;re interested in getting verified.</p><p>[As a note, once the program goes live, it&rsquo;ll be available to anyone worldwide - although the exam will only be available in English for the foreseeable future; we don&rsquo;t have the resources at this time to offer localized versions]
I should point out first that we&rsquo;re doing this program through my company, rather than directly through PowerShell.org, mainly because of some legalities. My company (Concentrated Tech) has the insurance and other items in place needed to do something like this, and I didn&rsquo;t want PowerShell.org, Inc., to have to pay for those things. That said, a<em>lot</em> of folks have been involved in vetting and designing the exam scenarios. Another advantage of using Concentrated Tech is that the company is set up to do a lot of the interviewing and statistical analysis needed to make a relevant exam.
The cost is the second thing I&rsquo;ll discuss: at $150/person, I know it&rsquo;s not cheap. But at least two human beings look at each person&rsquo;s work - there&rsquo;s no machine grading - and they gotta get paid. We also need to recoup some of the substantial investment that went into the exam design. Over a 3-year period, it&rsquo;ll hopefully be about break-even. We&rsquo;ll see.
On to the exam itself. There are a variety of &ldquo;forms&rdquo; for the exam, meaning everyone isn&rsquo;t getting the same assignment. That said, the approach for each form is pretty much the same. You&rsquo;ll get 2-3 &ldquo;assignments&rdquo; to complete, all of which involve writing scripts and/or commands. You get a specified amount of time to complete your assignments.
(as an aside, making multiple different exams that all test substantially the same skills is really tough, which is one reason we did a lot of testing and statistical analysis - to ensure the equivalency of each form - as part of the development process).
Some assignments are straightforward: write a script that does this, this, and that. You&rsquo;re given a bunch of criteria and just have to spew out the commands. There&rsquo;s room for creativity - so long as you (a) meet all the criteria and (b) comply with the stated best practices, you pass. &ldquo;Extra&rdquo; stuff doesn&rsquo;t count against you, and the exact approach you use isn&rsquo;t graded - so long as you achieve all of the results and comply with all of the stated criteria.
The &ldquo;main&rdquo; assignment in each form is harder. You&rsquo;re given a shell transcript, and you&rsquo;re asked to look at it and duplicate the tools you see used in it. For example:</p><p><code>PS C:\&gt; 'localhost' | Do-Something -confirm -verbose VERBOSE: Checking for status.txt VERBOSE: Status.txt exists, will append status to it VERBOSE: Pinging localhost VERBOSE: localhost responds Performing action "Do-Something" on "localhost". Continue?</code>That transcript should tell you that the command Do-Something accepts strings from the pipeline, supports the ShouldProcess mechanism, and outputs certain verbose status messages. You typically see each command used in several ways within the transcript, and each way reveals more about how that command works. Your job is to re-create the command, so that it produces the same results as shown in the transcript.<br>
We&rsquo;ve tried to use this approach to make the exam as objective as possible. If we can run the same commands using your code, and get the same output, then you probably pass. We then run a check on the &ldquo;best practices&rdquo; section (which is given to you in your assignment packet) to make sure you didn&rsquo;t deviate.<br>
There&rsquo;s a tiny little bit of unstated stuff. Like, if you hand in awfully-formatted code, you just take a terribly long-winded approach that could have been vastly simplified, you write code that takes 12x longer to run than it could or should&hellip; if you do<em>enough</em> of those wrong things in your assignment, you won&rsquo;t pass. We discussed these &ldquo;soft&rdquo; things a lot.<br>
For example, we didn&rsquo;t want to add a best practice, &ldquo;your code must run as efficiently as possible.&rdquo; That would let us explicitly ding someone who took a too-slow approach&hellip; but that kind of statement also makes people start to obsess and overthink the assignment. We don&rsquo;t care if your code runs 1s longer than our model solution. We care if it runs 10m longer. That&rsquo;s hard to state&hellip; and frankly, if someone has to<em>tell</em> you not to write crappy, slow code&hellip; you shouldn&rsquo;t be &ldquo;certified.&rdquo;<br>
So you<em>can</em> fail on unstated things&hellip; but you&rsquo;d have to be pretty egregious about it. Two humans grading you would have to be in agreement, and in a case like that our internal policy is to get a third judge to agree with the decision.<br>
Hopefully some of you are excited about this program and can&rsquo;t wait to start. Now, for some more logistics - this is stated elsewhere, but just so you&rsquo;re clear:<br>
You get started by paying, and submitting a signed Program License Agreement and a copy of a government-issued photo ID. We do store that, offline, for our records. It isn&rsquo;t in a database anywhere. Once we have those items, we enroll you and you receive an enrollment e-mail.<br>
The e-mail contains basic instructions for logging into our system and obtaining your Assignment Packet. Once you log in, your 24-hour countdown starts. From that point, you have a specified number of hours to download the Packet, read it, construct your script(s), ZIP them, and upload the ZIP file to us. You get one upload - once you do that, your answer is locked and we start grading.<br>
Allow about 5 business days for grading - longer if we&rsquo;re swamped, although if that&rsquo;s the case we&rsquo;ll let you know. After grading, you&rsquo;ll get a pass/fail e-mail. We don&rsquo;t send you commentary on why - the goal of this isn&rsquo;t to make you a better person, it&rsquo;s to see if you&rsquo;ve got the skills or not. If you fail, you can re-take after a 3-month wait (that helps prevent someone from slamming through all of our exam variations in a short period of time and cheating).<br>
I know one thing that will frustrate some folks is that we don&rsquo;t provide any feedback. That&rsquo;s very common in exam situations - Microsoft certification exams don&rsquo;t provide item-by-item feedback, either. So, for folks who<em>want</em> feedback, you can get that. We haven&rsquo;t come up with a full program yet, but you&rsquo;ll be able to purchase time with an expert, and you&rsquo;ll get a scenario similar to (but not exactly like) one of the exam assignments. You can work on your answer for as long as you like, and then sit down in LiveMeeting or Skype or whatever with the expert, who will go over your work with you. If you did a great job, you&rsquo;re still<em>not verified</em> - you have to take the exam for that. But if you&rsquo;re unsure, it&rsquo;s a way to have a small &ldquo;trial run&rdquo; that gives you some feedback on how you did. It can also be a good distance-learning experience, for someone who&rsquo;s so inclined.<br>
Anyway&hellip; there&rsquo;s the VERIFIED EFFECTIVE program in a nutshell.</p>
]]></content:encoded></item><item><title>Scripting Games warm up</title><link>https://powershell.org/articles/2013-02-05-scripting-games-warm-up/</link><guid>https://powershell.org/articles/2013-02-05-scripting-games-warm-up/</guid><pubDate>Tue, 05 Feb 2013 19:47:01 +0000</pubDate><description>&lt;p&gt;As a warm up for this years Scripting Games a two event Winter Scripting Camp has been organised. Details from &lt;a href="https://powershell.org/games/" title="https://powershell.org/games/"&gt;https://powershell.org/games/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2802/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2802/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2802&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>As a warm up for this years Scripting Games a two event Winter Scripting Camp has been organised. Details from<a href="https://powershell.org/games/" title="https://powershell.org/games/">https://powershell.org/games/</a></p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2802/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2802/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2802&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>VERIFIED EFFECTIVE PowerShell "certification" program now ready for beta</title><link>https://powershell.org/articles/2013-02-02-verified-effective-powershell-certification-program-now-ready-for-beta/</link><guid>https://powershell.org/articles/2013-02-02-verified-effective-powershell-certification-program-now-ready-for-beta/</guid><pubDate>Sat, 02 Feb 2013 23:43:15 +0000</pubDate><description>&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; As of 4th February, we&amp;rsquo;re full up for the beta. Check back later this year for the program launch.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m ready to begin a formal beta test of the new VERIFIED EFFECTIVEâ„¢ examination program, which we&amp;rsquo;d previously referred to as &amp;ldquo;PowerShell Verified.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Participation in the beta will be free, and if you pass it &amp;ldquo;counts.&amp;rdquo; If you&amp;rsquo;re interested, please &lt;a href="http://donjones.com/verified/ProgramGuide.pdf"&gt;download the Program Guide&lt;/a&gt; before February 10th, 2013.
You must agree to perform you examination on February 11th or 12th
. Complete the Program License Agreement found in the Guide, and return it, with photo ID, as indicated. Be sure to indicate either Feb 11th or 12th as your desired exam date. Materials will be sent to you via e-mail, and you will have 24 hours to complete the assignment. A qualified candidate should need no more than 4-5 hours.&lt;br&gt;
We&amp;rsquo;ve &lt;a href="http://donjones.com/verified"&gt;posted a complete set of information about the program&lt;/a&gt; in general and the PowerShell exam in particular.&lt;br&gt;
At this time, I can only accept participants who are USA residents (more on that below). International expansion will happen when the program formally launches later this year. &lt;strong&gt;I will only be accepting 2-3 beta participants.&lt;/strong&gt; If you submit your Program License Agreement but don&amp;rsquo;t hear back the same day, then you weren&amp;rsquo;t selected for participation.&lt;br&gt;
The final examination will be $150, and will be a human-graded assignment not a machine-graded exam. A certificate for passing scores will be delivered electronically, and you may order a physical certificate for a nominal fee.&lt;br&gt;
The first exam will be &lt;strong&gt;PowerShell 3.0 Toolmaking&lt;/strong&gt;. You should be able to pass if you know how to write advanced functions, including dealing with pipeline input, ShouldProcess support, and parameter attributes and validation. You will also need to know how to create custom formatting views and type extensions, and how to create script and manifest modules. You will need to be familiar with Windows PowerShell remoting and remoting configuration, and know how to create custom remoting endpoints (session configurations) having a specified configuration. You also need to know how to write proxy functions. You should know how to connect to SQL Server databases from within PowerShell, and how to issue queries to retrieve and manipulate database data. Note that not all of these topics may be included on every examination, but you should be prepared to perform all of them.&lt;br&gt;
I look forward to hearing from you!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p><strong>NOTE:</strong> As of 4th February, we&rsquo;re full up for the beta. Check back later this year for the program launch.</p><p>I&rsquo;m ready to begin a formal beta test of the new VERIFIED EFFECTIVEâ„¢ examination program, which we&rsquo;d previously referred to as &ldquo;PowerShell Verified.&rdquo;</p><p>Participation in the beta will be free, and if you pass it &ldquo;counts.&rdquo; If you&rsquo;re interested, please<a href="http://donjones.com/verified/ProgramGuide.pdf">download the Program Guide</a> before February 10th, 2013.
You must agree to perform you examination on February 11th or 12th
. Complete the Program License Agreement found in the Guide, and return it, with photo ID, as indicated. Be sure to indicate either Feb 11th or 12th as your desired exam date. Materials will be sent to you via e-mail, and you will have 24 hours to complete the assignment. A qualified candidate should need no more than 4-5 hours.<br>
We&rsquo;ve<a href="http://donjones.com/verified">posted a complete set of information about the program</a> in general and the PowerShell exam in particular.<br>
At this time, I can only accept participants who are USA residents (more on that below). International expansion will happen when the program formally launches later this year.<strong>I will only be accepting 2-3 beta participants.</strong> If you submit your Program License Agreement but don&rsquo;t hear back the same day, then you weren&rsquo;t selected for participation.<br>
The final examination will be $150, and will be a human-graded assignment not a machine-graded exam. A certificate for passing scores will be delivered electronically, and you may order a physical certificate for a nominal fee.<br>
The first exam will be<strong>PowerShell 3.0 Toolmaking</strong>. You should be able to pass if you know how to write advanced functions, including dealing with pipeline input, ShouldProcess support, and parameter attributes and validation. You will also need to know how to create custom formatting views and type extensions, and how to create script and manifest modules. You will need to be familiar with Windows PowerShell remoting and remoting configuration, and know how to create custom remoting endpoints (session configurations) having a specified configuration. You also need to know how to write proxy functions. You should know how to connect to SQL Server databases from within PowerShell, and how to issue queries to retrieve and manipulate database data. Note that not all of these topics may be included on every examination, but you should be prepared to perform all of them.<br>
I look forward to hearing from you!</p>
]]></content:encoded></item><item><title>Winter Scripting Camp Opened to the Public</title><link>https://powershell.org/articles/2013-02-01-winter-scripting-camp-opened-to-the-public/</link><guid>https://powershell.org/articles/2013-02-01-winter-scripting-camp-opened-to-the-public/</guid><pubDate>Fri, 01 Feb 2013 22:45:39 +0000</pubDate><description>&lt;p&gt;&lt;em&gt;Everything&amp;rsquo;s been going pretty smoothly, so we&amp;rsquo;ve decided to open Winter Scripting Camp to everyone! Read everything below carefully for the best camping experience!&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Scripting Camp is a precursor to the Scripting Games, which will kick off in late April. During Camp, you&amp;rsquo;ll have the opportunity to participate in two events. We aren&amp;rsquo;t offering any prizes, but we will announce winners in the PowerShell.org blog, on Twitter, and so on. Camp is really a way for us to kick the tires on our new software platform.&lt;br&gt;
If you want to participate, here&amp;rsquo;s how:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p><em>Everything&rsquo;s been going pretty smoothly, so we&rsquo;ve decided to open Winter Scripting Camp to everyone! Read everything below carefully for the best camping experience!</em></p><p>Scripting Camp is a precursor to the Scripting Games, which will kick off in late April. During Camp, you&rsquo;ll have the opportunity to participate in two events. We aren&rsquo;t offering any prizes, but we will announce winners in the PowerShell.org blog, on Twitter, and so on. Camp is really a way for us to kick the tires on our new software platform.<br>
If you want to participate, here&rsquo;s how:</p><ul><li>Start by visiting the Games home page. There, you&rsquo;ll find our competitor&rsquo;s guide, which includes best practices and scoring information. You&rsquo;ll also find instructions for providing feedback. Be sure to check back there frequently, as it&rsquo;s also where we&rsquo;ll be posting news and updates.</li><li>You will need a Microsoft Live account in order to sign-in and participate.</li><li>Visit<a href="http://thescriptinggames.com">TheScriptingGames.com</a> to join in.</li></ul><p>The first event runs Feb 1 to Feb 5; the second Feb 8 to Feb 12. You get one submission per entry, so make it count, and make sure it&rsquo;s in on time.<br>
The new platform isn&rsquo;t entirely feature-complete, but you should be able to get in and see your event, along with your scores from our judges. For Camp, we aren&rsquo;t committing to doing multiple scores per entry - again, this is mainly about testing the software.<br>
We are definitely interested in your feedback. For example, the schedule reflects that of the actual Games. Unlike prior years, we will be having non-overlapping events. You&rsquo;ll have about five days to review the event details and submit an entry - better reflecting the time pressures of a production environment. There will be a discussion forum on PowerShell.org for your feedback - please let us know what you think!</p>
]]></content:encoded></item><item><title>PowerShell and Active Directory recording</title><link>https://powershell.org/articles/2013-01-30-powershell-and-active-directory-recording/</link><guid>https://powershell.org/articles/2013-01-30-powershell-and-active-directory-recording/</guid><pubDate>Wed, 30 Jan 2013 22:05:51 +0000</pubDate><description>&lt;p&gt;The recording, slides and demo script from yesterday&amp;quot;™s PowerShell and Active Directory session can be found here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://skydrive.live.com/?cid=43cfa46a74cf3e96#cid=43CFA46A74CF3E96&amp;amp;id=43CFA46A74CF3E96%2140563" title="https://skydrive.live.com/?cid=43cfa46a74cf3e96#cid=43CFA46A74CF3E96&amp;amp;id=43CFA46A74CF3E96%2140563"&gt;https://skydrive.live.com/?cid=43cfa46a74cf3e96#cid=43CFA46A74CF3E96&amp;amp;id=43CFA46A74CF3E96%2140563&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2801/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2801/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2801&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>The recording, slides and demo script from yesterday"™s PowerShell and Active Directory session can be found here:</p><p><a href="https://skydrive.live.com/?cid=43cfa46a74cf3e96#cid=43CFA46A74CF3E96&amp;id=43CFA46A74CF3E96%2140563" title="https://skydrive.live.com/?cid=43cfa46a74cf3e96#cid=43CFA46A74CF3E96&amp;id=43CFA46A74CF3E96%2140563">https://skydrive.live.com/?cid=43cfa46a74cf3e96#cid=43CFA46A74CF3E96&amp;id=43CFA46A74CF3E96%2140563</a></p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2801/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2801/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2801&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>PowerShell workflows"“now we are six</title><link>https://powershell.org/articles/2013-01-30-powershell-workflows-now-we-are-six/</link><guid>https://powershell.org/articles/2013-01-30-powershell-workflows-now-we-are-six/</guid><pubDate>Wed, 30 Jan 2013 19:11:03 +0000</pubDate><description>&lt;p&gt;The sixth in the series of articles on PowerShell workflows that are appearing on the Scripting Guy blog has been published.&lt;/p&gt;
&lt;p&gt;The articles in the series that have been published are:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx&lt;/a&gt;&lt;br&gt;
&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx&lt;/a&gt;&lt;br&gt;
&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/09/powershell-workflows-nesting.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/09/powershell-workflows-nesting.aspx&lt;/a&gt;&lt;br&gt;
&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/16/powershell-workflows-job-engine.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/16/powershell-workflows-job-engine.aspx&lt;/a&gt;&lt;br&gt;
&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/23/powershell-workflows-restarting-the-computer.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/23/powershell-workflows-restarting-the-computer.aspx&lt;/a&gt;&lt;br&gt;
&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/30/powershell-workflows-using-parameters.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/30/powershell-workflows-using-parameters.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Look for the next article in one weeks time.&lt;/p&gt;
&lt;p&gt;Until then Enjoy!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2800/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2800/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2800&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>The sixth in the series of articles on PowerShell workflows that are appearing on the Scripting Guy blog has been published.</p><p>The articles in the series that have been published are:</p><p><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx</a><br><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx</a><br><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/09/powershell-workflows-nesting.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/09/powershell-workflows-nesting.aspx</a><br><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/16/powershell-workflows-job-engine.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/16/powershell-workflows-job-engine.aspx</a><br><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/23/powershell-workflows-restarting-the-computer.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/23/powershell-workflows-restarting-the-computer.aspx</a><br><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/30/powershell-workflows-using-parameters.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/30/powershell-workflows-using-parameters.aspx</a></p><p>Look for the next article in one weeks time.</p><p>Until then Enjoy!</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2800/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2800/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2800&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>The 2013 Winter Scripting Camp</title><link>https://powershell.org/articles/2013-01-28-the-2013-winter-scripting-camp/</link><guid>https://powershell.org/articles/2013-01-28-the-2013-winter-scripting-camp/</guid><pubDate>Mon, 28 Jan 2013 20:56:00 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;ll be announcing Winter Scripting Camp the first week of February. This is a special invite-only event that will be open to subscribers of the PowerShell.org TechLetter. It will work just like the Scripting Games, but will feature only a couple of events and will not include any prizes. We will, however, announce the top scorers.&lt;br&gt;
Scripting Camp is primarily an opportunity for us to audition our new platform, to kick the tires, and make sure everything&amp;rsquo;s ready for the official Games, which will kick off in April at the &lt;a href="https://powershell.org/summit/"&gt;PowerShell Summit 2013 North America&lt;/a&gt;.&lt;br&gt;
If you&amp;rsquo;re interested in Camping with us, please sign up for the TechLetter this week (prior to Feb 1st). We&amp;rsquo;ll be sending out a special notification to the TechLetter subscriber list with sign-up instructions.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;ll be announcing Winter Scripting Camp the first week of February. This is a special invite-only event that will be open to subscribers of the PowerShell.org TechLetter. It will work just like the Scripting Games, but will feature only a couple of events and will not include any prizes. We will, however, announce the top scorers.<br>
Scripting Camp is primarily an opportunity for us to audition our new platform, to kick the tires, and make sure everything&rsquo;s ready for the official Games, which will kick off in April at the<a href="/summit/">PowerShell Summit 2013 North America</a>.<br>
If you&rsquo;re interested in Camping with us, please sign up for the TechLetter this week (prior to Feb 1st). We&rsquo;ll be sending out a special notification to the TechLetter subscriber list with sign-up instructions.</p>
]]></content:encoded></item><item><title>PowerShell and Active Directory"“reminder</title><link>https://powershell.org/articles/2013-01-28-powershell-and-active-directory-reminder/</link><guid>https://powershell.org/articles/2013-01-28-powershell-and-active-directory-reminder/</guid><pubDate>Mon, 28 Jan 2013 18:14:58 +0000</pubDate><description>&lt;p&gt;Quick reminder for tomorrow&amp;quot;™s session from the UK PowerShell group. Details from:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/richardsiddaway/archive/2013/01/16/uk-powershell-group-29-january-2013.aspx" title="http://msmvps.com/blogs/richardsiddaway/archive/2013/01/16/uk-powershell-group-29-january-2013.aspx"&gt;http://msmvps.com/blogs/richardsiddaway/archive/2013/01/16/uk-powershell-group-29-january-2013.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2799/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2799/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2799&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Quick reminder for tomorrow"™s session from the UK PowerShell group. Details from:</p><p><a href="http://msmvps.com/blogs/richardsiddaway/archive/2013/01/16/uk-powershell-group-29-january-2013.aspx" title="http://msmvps.com/blogs/richardsiddaway/archive/2013/01/16/uk-powershell-group-29-january-2013.aspx">http://msmvps.com/blogs/richardsiddaway/archive/2013/01/16/uk-powershell-group-29-january-2013.aspx</a></p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2799/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2799/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2799&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Piping between functions</title><link>https://powershell.org/articles/2013-01-19-piping-between-functions/</link><guid>https://powershell.org/articles/2013-01-19-piping-between-functions/</guid><pubDate>Sat, 19 Jan 2013 17:04:01 +0000</pubDate><description>&lt;p&gt;A question came up about piping between advanced functions. The input to the second function might be an array. To illustrate how this works imagine a function that gets disk information &amp;ldquo;“ or better still use this one.&lt;/p&gt;
&lt;p&gt;`function&lt;/p&gt;
&lt;p&gt;get-mydisk&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;[&lt;/p&gt;
&lt;p&gt;CmdletBinding&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;]&lt;/p&gt;
&lt;p&gt;param&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;[string]&lt;/p&gt;
&lt;p&gt;$computername&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;&amp;ldquo;$env:COMPUTERNAME&amp;rdquo;&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;BEGIN&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;#begin&lt;/p&gt;
&lt;p&gt;PROCESS&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;Get-WmiObject&lt;/p&gt;
&lt;p&gt;-Class&lt;/p&gt;
&lt;p&gt;Win32_LogicalDisk&lt;/p&gt;
&lt;p&gt;-ComputerName&lt;/p&gt;
&lt;p&gt;$computername&lt;/p&gt;
&lt;p&gt;|&lt;/p&gt;
&lt;p&gt;foreach&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;New-Object&lt;/p&gt;
&lt;p&gt;-TypeName&lt;/p&gt;
&lt;p&gt;PSObject&lt;/p&gt;
&lt;p&gt;-Property&lt;/p&gt;
&lt;p&gt;@{&lt;/p&gt;
&lt;p&gt;Disk&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;$_&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;DeviceID&lt;/p&gt;
&lt;p&gt;Free&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;$_&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;FreeSpace&lt;/p&gt;
&lt;p&gt;Size&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;$_&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;Size&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;#process&lt;/p&gt;
&lt;p&gt;END&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>A question came up about piping between advanced functions. The input to the second function might be an array. To illustrate how this works imagine a function that gets disk information &ldquo;“ or better still use this one.</p><p>`function</p><p>get-mydisk</p><p>{</p><p>[</p><p>CmdletBinding</p><p>(</p><p>)</p><p>]</p><p>param</p><p>(</p><p>[string]</p><p>$computername</p><p>=</p><p>&ldquo;$env:COMPUTERNAME&rdquo;</p><p>)</p><p>BEGIN</p><p>{</p><p>}</p><p>#begin</p><p>PROCESS</p><p>{</p><p>Get-WmiObject</p><p>-Class</p><p>Win32_LogicalDisk</p><p>-ComputerName</p><p>$computername</p><p>|</p><p>foreach</p><p>{</p><p>New-Object</p><p>-TypeName</p><p>PSObject</p><p>-Property</p><p>@{</p><p>Disk</p><p>=</p><p>$_</p><p>.</p><p>DeviceID</p><p>Free</p><p>=</p><p>$_</p><p>.</p><p>FreeSpace</p><p>Size</p><p>=</p><p>$_</p><p>.</p><p>Size</p><p>}</p><p>}</p><p>}</p><p>#process</p><p>END</p><p>{</p><p>}</p><p>#end</p><p>}</p><p>`Use a computername as a parameter. Use WMI to get the disk information and output an object.</p><p>PS&gt; get-mydisk | ft -AutoSize</p><p>Disk Free Size
—- —- —-
C: 149778239488 249951154176
D: 69271552 104853504
E:<br>
F:</p><p>This works as well</p><p>PS&gt; get-mydisk | where Size -gt 0 | ft -AutoSize</p><p>Disk Free Size
—- —- —-
C: 149778108416 249951154176
D: 69271552 104853504</p><p>You now have a function outputs objects that behave properly on the pipeline.</p><p>So now you want those objects piped into another function or you want an array of objects used as the input</p><p>`function</p><p>get-freeperc</p><p>{</p><p>[</p><p>CmdletBinding</p><p>(</p><p>)</p><p>]</p><p>param</p><p>(</p><p>[</p><p>parameter</p><p>(</p><p>ValueFromPipeline</p><p>=</p><p>$true</p><p>)</p><p>]</p><p>[Object[]]</p><p>$disklist</p><p>)</p><p>BEGIN</p><p>{</p><p>}</p><p>#begin</p><p>PROCESS</p><p>{</p><p>foreach</p><p>(</p><p>$disk</p><p>in</p><p>$disklist</p><p>)</p><p>{</p><p>if</p><p>(</p><p>$disk</p><p>.</p><p>Size</p><p>-gt</p><p>)</p><p>{</p><p>$disk</p><p>|</p><p>Select</p><p>Disk</p><p>,</p><p>@{</p><p>N</p><p>=</p><p>&ldquo;Size(GB)&rdquo;</p><p>;</p><p>E</p><p>=</p><p>{</p><p>[math]</p><p>::</p><p>Round</p><p>(</p><p>(</p><p>$(</p><p>$_</p><p>.</p><p>Size</p><p>)</p><p>/</p><p>1GB</p><p>)</p><p>,</p><p>2</p><p>)</p><p>}</p><p>}</p><p>,</p><p>@{</p><p>N</p><p>=</p><p>&ldquo;FreePerc&rdquo;</p><p>;</p><p>E</p><p>=</p><p>{</p><p>[math]</p><p>::</p><p>Round</p><p>(</p><p>(</p><p>$(</p><p>$_</p><p>.</p><p>Free</p><p>)</p><p>/</p><p>$(</p><p>$_</p><p>.</p><p>Size</p><p>)</p><p>)</p><ul><li/></ul><p>100</p><p>,</p><p>2</p><p>)</p><p>}</p><p>}</p><p>}</p><p>}</p><p>}</p><p>#process</p><p>END</p><p>{</p><p>}</p><p>#end</p><p>}</p><p>`* Set the parameter to accept pipeline input
* Set the parameter to accept an array of objects
* Use a process block
* Use a foreach block in the process block</p><pre><code> This works
PS&gt; get-mydisk | get-freeperc | ft -AutoSize
Disk Size(GB) FreePerc</code></pre><p>—- ——– ——–
C: 232.79 59.92
D: 0.1 66.07</p><pre><code> or this
$disks = get-mydisk
get-freeperc -disklist $disks
or this
get-freeperc -disklist (get-mydisk)
[![](http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2798/)](http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2798/)![](http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2798&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1)</code></pre>
]]></content:encoded></item><item><title>Starting virtual machines for WSUS</title><link>https://powershell.org/articles/2013-01-17-starting-virtual-machines-for-wsus/</link><guid>https://powershell.org/articles/2013-01-17-starting-virtual-machines-for-wsus/</guid><pubDate>Thu, 17 Jan 2013 19:50:54 +0000</pubDate><description>&lt;p&gt;My test environment usually has a dozen or so machines at any one time. Some of these are short lived and used for a particular piece of testing &amp;ldquo;“ others are kept for years. I decided that I wanted to keep up to date on the patching of these virtual machines so installed WSUS on a Windows 2012 box.&lt;/p&gt;
&lt;p&gt;One issue is that if a VM isn&amp;rdquo;™t started for 10 days WSUS starts complaining that it hasn&amp;quot;™t been contacted and if you run the WSUS clean up wizard the non-reporting servers may be removed. Checking the WSUS console for which machines haven&amp;quot;™t sync&amp;quot;™d recently is a chore.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>My test environment usually has a dozen or so machines at any one time. Some of these are short lived and used for a particular piece of testing &ldquo;“ others are kept for years. I decided that I wanted to keep up to date on the patching of these virtual machines so installed WSUS on a Windows 2012 box.</p><p>One issue is that if a VM isn&rdquo;™t started for 10 days WSUS starts complaining that it hasn"™t been contacted and if you run the WSUS clean up wizard the non-reporting servers may be removed. Checking the WSUS console for which machines haven"™t sync"™d recently is a chore.</p><p>In Windows 2012 both WSUS and Hyper-V come with a PowerShell module. This means I can do this:</p><p>`$date</p><p>=</p><p>(</p><p>Get-Date</p><p>)</p><p>.</p><p>AddDays</p><p>(</p><p>-10</p><p>)</p><p>Get-WsusComputer</p><p>-ToLastSyncTime</p><p>$date</p><p>|</p><p>sort</p><p>LastSyncTime</p><p>|</p><p>select</p><p>-First</p><p>4</p><p>|</p><p>foreach</p><p>{</p><p>$computer</p><p>=</p><p>(</p><p>$_</p><p>.</p><p>FullDomainName</p><p>-split</p><p>&ldquo;.&rdquo;</p><p>)</p><p>[</p><p>]</p><p>Start-VM</p><p>-Name</p><p>$computer</p><p>-ComputerName</p><p>Server02</p><p>-Passthru</p><p>}</p><p>`I"™m using the WSUS server as my admin box but if you were accessing a remote WSUS machine change the code to</p><p>Get-WsusServer -Name w12sus -PortNumber 8530 | Get-WsusComputer &ldquo;“ToLastSyncTime $date |</p><p>I sorted the computers WSUS knows about by date &ldquo;“ picked the last 4 to sync so I didn&rdquo;™t overwhelm the Hyper-V host and started them up. Only trick is to get the computer name out of the FullDomainName property.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2797/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2797/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2797&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Account SIDs"“hopefully my last word</title><link>https://powershell.org/articles/2013-01-17-account-sids-hopefully-my-last-word/</link><guid>https://powershell.org/articles/2013-01-17-account-sids-hopefully-my-last-word/</guid><pubDate>Thu, 17 Jan 2013 08:25:50 +0000</pubDate><description>&lt;p&gt;Ok the embarrassing moral of this story is that you shouldn&amp;rsquo;t answer questions in a hurry at the end of the evening. 5 minutes after shutting down I realised that there is a far, far simpler way to get the info. Win32_AccountSID is a WMI linking class. It links Win32_SystemAccount and Win32_SID classes.&lt;/p&gt;
&lt;p&gt;Get-WmiObject -Class Win32_SystemAccount | select Caption, Domain, Name, SID, LocalAccount&lt;/p&gt;
&lt;p&gt;gets you all you need&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2796/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2796/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2796&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Ok the embarrassing moral of this story is that you shouldn&rsquo;t answer questions in a hurry at the end of the evening. 5 minutes after shutting down I realised that there is a far, far simpler way to get the info. Win32_AccountSID is a WMI linking class. It links Win32_SystemAccount and Win32_SID classes.</p><p>Get-WmiObject -Class Win32_SystemAccount | select Caption, Domain, Name, SID, LocalAccount</p><p>gets you all you need</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2796/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2796/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2796&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Account SIDs revisited</title><link>https://powershell.org/articles/2013-01-16-account-sids-revisited/</link><guid>https://powershell.org/articles/2013-01-16-account-sids-revisited/</guid><pubDate>Wed, 16 Jan 2013 22:48:05 +0000</pubDate><description>&lt;p&gt;I realised there is an easier way to get the data&lt;/p&gt;
&lt;p&gt;`function&lt;/p&gt;
&lt;p&gt;get-SID&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;param&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;[string]&lt;/p&gt;
&lt;p&gt;$computername&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;$env:COMPUTERNAME&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;Get-WmiObject&lt;/p&gt;
&lt;p&gt;-Class&lt;/p&gt;
&lt;p&gt;Win32_AccountSID&lt;/p&gt;
&lt;p&gt;-ComputerName&lt;/p&gt;
&lt;p&gt;$computername&lt;/p&gt;
&lt;p&gt;|&lt;/p&gt;
&lt;p&gt;foreach&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;$exp&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;&amp;ldquo;[wmi]'&amp;rdquo;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;$(&lt;/p&gt;
&lt;p&gt;$_&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;Element&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;ldquo;'&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Invoke-Expression&lt;/p&gt;
&lt;p&gt;-Command&lt;/p&gt;
&lt;p&gt;$exp&lt;/p&gt;
&lt;p&gt;|&lt;/p&gt;
&lt;p&gt;select&lt;/p&gt;
&lt;p&gt;Domain&lt;/p&gt;
&lt;p&gt;,&lt;/p&gt;
&lt;p&gt;Name&lt;/p&gt;
&lt;p&gt;,&lt;/p&gt;
&lt;p&gt;SID&lt;/p&gt;
&lt;p&gt;,&lt;/p&gt;
&lt;p&gt;LocalAccount&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;`Use the wmi type accelerator with the path from the Element and you can just select the data you want. As a bonus you can discover if the account is local or not&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I realised there is an easier way to get the data</p><p>`function</p><p>get-SID</p><p>{</p><p>param</p><p>(</p><p>[string]</p><p>$computername</p><p>=</p><p>$env:COMPUTERNAME</p><p>)</p><p>Get-WmiObject</p><p>-Class</p><p>Win32_AccountSID</p><p>-ComputerName</p><p>$computername</p><p>|</p><p>foreach</p><p>{</p><p>$exp</p><p>=</p><p>&ldquo;[wmi]'&rdquo;</p><ul><li/></ul><p>$(</p><p>$_</p><p>.</p><p>Element</p><p>)</p><ul><li/></ul><p>&ldquo;'&rdquo;</p><p>Invoke-Expression</p><p>-Command</p><p>$exp</p><p>|</p><p>select</p><p>Domain</p><p>,</p><p>Name</p><p>,</p><p>SID</p><p>,</p><p>LocalAccount</p><p>}</p><p>}</p><p>`Use the wmi type accelerator with the path from the Element and you can just select the data you want. As a bonus you can discover if the account is local or not</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2795/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2795/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2795&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Passing function names</title><link>https://powershell.org/articles/2013-01-16-passing-function-names/</link><guid>https://powershell.org/articles/2013-01-16-passing-function-names/</guid><pubDate>Wed, 16 Jan 2013 22:32:38 +0000</pubDate><description>&lt;p&gt;A question asked about passing a function name into another function which then called the function. It sounds worse than it is. if you need to pass the name of a command and then call it try using invoke-expression&lt;/p&gt;
&lt;p&gt;`function&lt;/p&gt;
&lt;p&gt;ffour&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;Get-Random&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;function&lt;/p&gt;
&lt;p&gt;fthree&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;Get-Date&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;function&lt;/p&gt;
&lt;p&gt;ftwo&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;param&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;[string]&lt;/p&gt;
&lt;p&gt;$fname&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;Invoke-Expression&lt;/p&gt;
&lt;p&gt;$fname&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&amp;ldquo;date&amp;rdquo;&lt;/p&gt;
&lt;p&gt;ftwo&lt;/p&gt;
&lt;p&gt;fthree&lt;/p&gt;
&lt;p&gt;&amp;ldquo;random&amp;rdquo;&lt;/p&gt;
&lt;p&gt;ftwo&lt;/p&gt;
&lt;p&gt;ffour&lt;/p&gt;
&lt;p&gt;`&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2794/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2794/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2794&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>A question asked about passing a function name into another function which then called the function. It sounds worse than it is. if you need to pass the name of a command and then call it try using invoke-expression</p><p>`function</p><p>ffour</p><p>{</p><p>Get-Random</p><p>}</p><p>function</p><p>fthree</p><p>{</p><p>Get-Date</p><p>}</p><p>function</p><p>ftwo</p><p>{</p><p>param</p><p>(</p><p>[string]</p><p>$fname</p><p>)</p><p>Invoke-Expression</p><p>$fname</p><p>}</p><p>&ldquo;date&rdquo;</p><p>ftwo</p><p>fthree</p><p>&ldquo;random&rdquo;</p><p>ftwo</p><p>ffour</p><p>`<a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2794/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2794/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2794&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Account SIDs</title><link>https://powershell.org/articles/2013-01-16-account-sids/</link><guid>https://powershell.org/articles/2013-01-16-account-sids/</guid><pubDate>Wed, 16 Jan 2013 22:22:45 +0000</pubDate><description>&lt;p&gt;A question on the forum asked about finding the accounts and SIDs on the local machine.&lt;/p&gt;
&lt;p&gt;`function&lt;/p&gt;
&lt;p&gt;get-SID&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;param&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;[string]&lt;/p&gt;
&lt;p&gt;$computername&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;$env:COMPUTERNAME&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;Get-WmiObject&lt;/p&gt;
&lt;p&gt;-Class&lt;/p&gt;
&lt;p&gt;Win32_AccountSID&lt;/p&gt;
&lt;p&gt;-ComputerName&lt;/p&gt;
&lt;p&gt;$computername&lt;/p&gt;
&lt;p&gt;|&lt;/p&gt;
&lt;p&gt;foreach&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;$da&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;$_&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;Element&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;Split&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;&amp;ldquo;.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;[&lt;/p&gt;
&lt;p&gt;1&lt;/p&gt;
&lt;p&gt;]&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;Split&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;&amp;ldquo;,&amp;rdquo;&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;$sid&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;$_&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;Setting&lt;/p&gt;
&lt;p&gt;-split&lt;/p&gt;
&lt;p&gt;&amp;ldquo;=&amp;rdquo;&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;[&lt;/p&gt;
&lt;p&gt;1&lt;/p&gt;
&lt;p&gt;]&lt;/p&gt;
&lt;p&gt;-replace&lt;/p&gt;
&lt;p&gt;&amp;lsquo;&amp;quot;&amp;rsquo;&lt;/p&gt;
&lt;p&gt;,&lt;/p&gt;
&lt;p&gt;''&lt;/p&gt;
&lt;p&gt;$props&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;[ordered]&lt;/p&gt;
&lt;p&gt;@{&lt;/p&gt;
&lt;p&gt;Domain&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;$da&lt;/p&gt;
&lt;p&gt;[&lt;/p&gt;
&lt;p&gt;]&lt;/p&gt;
&lt;p&gt;-split&lt;/p&gt;
&lt;p&gt;&amp;ldquo;=&amp;rdquo;&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;[&lt;/p&gt;
&lt;p&gt;1&lt;/p&gt;
&lt;p&gt;]&lt;/p&gt;
&lt;p&gt;-replace&lt;/p&gt;
&lt;p&gt;&amp;lsquo;&amp;quot;&amp;rsquo;&lt;/p&gt;
&lt;p&gt;,&lt;/p&gt;
&lt;p&gt;''&lt;/p&gt;
&lt;p&gt;Account&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;$da&lt;/p&gt;
&lt;p&gt;[&lt;/p&gt;
&lt;p&gt;1&lt;/p&gt;
&lt;p&gt;]&lt;/p&gt;
&lt;p&gt;-split&lt;/p&gt;
&lt;p&gt;&amp;ldquo;=&amp;rdquo;&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;[&lt;/p&gt;
&lt;p&gt;1&lt;/p&gt;
&lt;p&gt;]&lt;/p&gt;
&lt;p&gt;-replace&lt;/p&gt;
&lt;p&gt;&amp;lsquo;&amp;quot;&amp;rsquo;&lt;/p&gt;
&lt;p&gt;,&lt;/p&gt;
&lt;p&gt;''&lt;/p&gt;
&lt;p&gt;SID&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;$sid&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;New-Object&lt;/p&gt;
&lt;p&gt;-TypeName&lt;/p&gt;
&lt;p&gt;PSObject&lt;/p&gt;
&lt;p&gt;-Property&lt;/p&gt;
&lt;p&gt;$props&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;`Pass a computer name into the function &amp;ldquo;“ default is local machine.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>A question on the forum asked about finding the accounts and SIDs on the local machine.</p><p>`function</p><p>get-SID</p><p>{</p><p>param</p><p>(</p><p>[string]</p><p>$computername</p><p>=</p><p>$env:COMPUTERNAME</p><p>)</p><p>Get-WmiObject</p><p>-Class</p><p>Win32_AccountSID</p><p>-ComputerName</p><p>$computername</p><p>|</p><p>foreach</p><p>{</p><p>$da</p><p>=</p><p>(</p><p>(</p><p>$_</p><p>.</p><p>Element</p><p>)</p><p>.</p><p>Split</p><p>(</p><p>&ldquo;.&rdquo;</p><p>)</p><p>[</p><p>1</p><p>]</p><p>)</p><p>.</p><p>Split</p><p>(</p><p>&ldquo;,&rdquo;</p><p>)</p><p>$sid</p><p>=</p><p>(</p><p>$_</p><p>.</p><p>Setting</p><p>-split</p><p>&ldquo;=&rdquo;</p><p>)</p><p>[</p><p>1</p><p>]</p><p>-replace</p><p>&lsquo;"&rsquo;</p><p>,</p><p>''</p><p>$props</p><p>=</p><p>[ordered]</p><p>@{</p><p>Domain</p><p>=</p><p>(</p><p>$da</p><p>[</p><p>]</p><p>-split</p><p>&ldquo;=&rdquo;</p><p>)</p><p>[</p><p>1</p><p>]</p><p>-replace</p><p>&lsquo;"&rsquo;</p><p>,</p><p>''</p><p>Account</p><p>=</p><p>(</p><p>$da</p><p>[</p><p>1</p><p>]</p><p>-split</p><p>&ldquo;=&rdquo;</p><p>)</p><p>[</p><p>1</p><p>]</p><p>-replace</p><p>&lsquo;"&rsquo;</p><p>,</p><p>''</p><p>SID</p><p>=</p><p>$sid</p><p>}</p><p>New-Object</p><p>-TypeName</p><p>PSObject</p><p>-Property</p><p>$props</p><p>}</p><p>}</p><p>`Pass a computer name into the function &ldquo;“ default is local machine.</p><p>Use the AccountSID class which links Win32_SystemAccount and Win32_SID. For each returned instance clean up the data and create an object with three properties &ldquo;“ domain, account and SID.</p><p>You will see more than you thought &ldquo;“ some very useful information buried in there</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2793/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2793/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2793&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>UK PowerShell group "“ 29 January 2013</title><link>https://powershell.org/articles/2013-01-16-uk-powershell-group-29-january-2013/</link><guid>https://powershell.org/articles/2013-01-16-uk-powershell-group-29-january-2013/</guid><pubDate>Wed, 16 Jan 2013 20:28:38 +0000</pubDate><description>&lt;p&gt;`**When: Tuesday, Jan 29, 2013 7:30 PM (GMT)&lt;/p&gt;
&lt;p&gt;Where: virtual&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; *~*~*~*~*~*~*~*~*~*
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;`Active Directory is one of the commonest automation targets for administrators. This session will covert the basics of automating your AD admin – scripts and the Microsoft cmdlets. The new features in PowerShell for Windows 2012 AD will also be covered&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; Notes**`Richard Siddaway has invited you to attend an online meeting using Live Meeting.**[Join the meeting.](https://www.livemeeting.com/cc/usergroups/join?id=RCRWH3&amp;amp;role=attend&amp;amp;pw=5p7%24%7DS_%21h)****Audio Information****Computer Audio****To use computer audio, you need speakers and microphone, or a headset.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;First Time Users:&lt;strong&gt;&lt;strong&gt;To save time before the meeting, &lt;a href="http://go.microsoft.com/fwlink/?LinkId=90703"&gt;check your system &lt;/a&gt;to make sure it is ready to use Microsoft Office Live Meeting.
Troubleshooting&lt;/strong&gt;&lt;/strong&gt;Unable to join the meeting? Follow these steps:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>`**When: Tuesday, Jan 29, 2013 7:30 PM (GMT)</p><p>Where: virtual</p><pre><code> *~*~*~*~*~*~*~*~*~*</code></pre><p>`Active Directory is one of the commonest automation targets for administrators. This session will covert the basics of automating your AD admin – scripts and the Microsoft cmdlets. The new features in PowerShell for Windows 2012 AD will also be covered</p><pre><code> Notes**`Richard Siddaway has invited you to attend an online meeting using Live Meeting.**[Join the meeting.](https://www.livemeeting.com/cc/usergroups/join?id=RCRWH3&amp;role=attend&amp;pw=5p7%24%7DS_%21h)****Audio Information****Computer Audio****To use computer audio, you need speakers and microphone, or a headset.</code></pre><p>First Time Users:<strong><strong>To save time before the meeting,<a href="http://go.microsoft.com/fwlink/?LinkId=90703">check your system</a>to make sure it is ready to use Microsoft Office Live Meeting.
Troubleshooting</strong></strong>Unable to join the meeting? Follow these steps:</p><ul><li><p>Copy this address and paste it into your web browser:<a href="https://www.livemeeting.com/cc/usergroups/join">https://www.livemeeting.com/cc/usergroups/join</a></p><p>Copy and paste the required information:
Meeting ID: RCRWH3
Entry Code: 5p7$}S_!h
Location:<a href="https://www.livemeeting.com/cc/usergroups">https://www.livemeeting.com/cc/usergroups</a></p><p>If you still cannot enter the meeting,<a href="http://r.office.microsoft.com/r/rlidLiveMeeting?p1=12&amp;p2=en_US&amp;p3=LMInfo&amp;p4=support">contact support</a></p><p>Notice**
Microsoft Office Live Meeting can be used to record meetings. By participating in this meeting, you agree that your communications may be monitored or recorded at any time during the meeting.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2792/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2792/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2792&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/></li></ul>
]]></content:encoded></item><item><title>PowerShell wins award</title><link>https://powershell.org/articles/2013-01-16-powershell-wins-award/</link><guid>https://powershell.org/articles/2013-01-16-powershell-wins-award/</guid><pubDate>Wed, 16 Jan 2013 18:19:21 +0000</pubDate><description>&lt;p&gt;PowerShell has won one on InfoWorld&amp;quot;™s Technology of the Year awards for 2013&lt;/p&gt;
&lt;p&gt;See &lt;a href="http://www.infoworld.com/slideshow/80986/infoworlds-2013-technology-of-the-year-award-winners-210419#slide24"&gt;http://www.infoworld.com/slideshow/80986/infoworlds-2013-technology-of-the-year-award-winners-210419#slide24&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;for details&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2791/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2791/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2791&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>PowerShell has won one on InfoWorld"™s Technology of the Year awards for 2013</p><p>See<a href="http://www.infoworld.com/slideshow/80986/infoworlds-2013-technology-of-the-year-award-winners-210419#slide24">http://www.infoworld.com/slideshow/80986/infoworlds-2013-technology-of-the-year-award-winners-210419#slide24</a></p><p>for details</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2791/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2791/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2791&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Workflow article 4</title><link>https://powershell.org/articles/2013-01-16-workflow-article-4/</link><guid>https://powershell.org/articles/2013-01-16-workflow-article-4/</guid><pubDate>Wed, 16 Jan 2013 17:03:48 +0000</pubDate><description>&lt;p&gt;The next in the series of articles on PowerShell workflows that are appearing on the Scripting Guy blog has been published.&lt;/p&gt;
&lt;p&gt;The articles in the series that have been published are:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx&lt;/a&gt;&lt;br&gt;
&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx&lt;/a&gt;&lt;br&gt;
&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/09/powershell-workflows-nesting.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/09/powershell-workflows-nesting.aspx&lt;/a&gt;&lt;br&gt;
&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/16/powershell-workflows-job-engine.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/16/powershell-workflows-job-engine.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Look for the next article in one weeks time.&lt;/p&gt;
&lt;p&gt;Until then Enjoy!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2790/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2790/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2790&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>The next in the series of articles on PowerShell workflows that are appearing on the Scripting Guy blog has been published.</p><p>The articles in the series that have been published are:</p><p><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx</a><br><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx</a><br><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/09/powershell-workflows-nesting.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/09/powershell-workflows-nesting.aspx</a><br><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/16/powershell-workflows-job-engine.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/16/powershell-workflows-job-engine.aspx</a></p><p>Look for the next article in one weeks time.</p><p>Until then Enjoy!</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2790/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2790/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2790&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Updating Help on PowerShell v3</title><link>https://powershell.org/articles/2013-01-15-updating-help-on-powershell-v3/</link><guid>https://powershell.org/articles/2013-01-15-updating-help-on-powershell-v3/</guid><pubDate>Tue, 15 Jan 2013 21:37:41 +0000</pubDate><description>&lt;p&gt;One of the new features in PowerShell v3 is the capability to update the help files. In fact you have to do this because PowerShell v3 doesn&amp;quot;™t ship with any help files. Since Windows 8 RTM&amp;quot;™d there have been a succession of new help files released.&lt;/p&gt;
&lt;p&gt;I discovered one of my netbooks didn&amp;quot;™t have the latest version of the help files installed. So I needed to update them. This got me thinking that it would be better if the machine did this for me.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>One of the new features in PowerShell v3 is the capability to update the help files. In fact you have to do this because PowerShell v3 doesn"™t ship with any help files. Since Windows 8 RTM"™d there have been a succession of new help files released.</p><p>I discovered one of my netbooks didn"™t have the latest version of the help files installed. So I needed to update them. This got me thinking that it would be better if the machine did this for me.</p><p>I could think of two easy ways to do this &ldquo;“ a scheduled job or a scheduled task. I chose the scheduled task because the ScheduledTasks module is available on the version of PowerShell v3 for Windows 7 and other legacy versions of Windows. The PSScheduledJob module is only available on Windows 8/2012 as it&rdquo;™s based on WMI classes not present on older versions of Windows.</p><p>`$actionscript</p><p>=</p><p>&lsquo;-NonInteractive -WindowStyle Normal -NoLogo -NoProfile -NoExit -Command &ldquo;&amp; {Update-Help -UICulture en-US -Force}&rdquo;&rsquo;</p><p>$pstart</p><p>=</p><p>&ldquo;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe&rdquo;</p><p>#$days = &ldquo;Monday&rdquo;, &ldquo;Tuesday&rdquo;, &ldquo;Wednesday&rdquo;, &ldquo;Thursday&rdquo;, &ldquo;Friday&rdquo;, &ldquo;Saturday&rdquo;, &ldquo;Sunday&rdquo;</p><p>$days</p><p>=</p><p>&lsquo;Wednesday&rsquo;</p><p>Get-ScheduledTask</p><p>-TaskName</p><p>UpdatePSHelp</p><p>|</p><p>Unregister-ScheduledTask</p><p>-Confirm:</p><p>$false</p><p>$act</p><p>=</p><p>New-ScheduledTaskAction</p><p>-Execute</p><p>$pstart</p><p>-Argument</p><p>$actionscript</p><p>$trig</p><p>=</p><p>New-ScheduledTaskTrigger</p><p>-Weekly</p><p>-WeeksInterval</p><p>4</p><p>-At</p><p>19:00</p><p>-DaysOfWeek</p><p>$days</p><p>Register-ScheduledTask</p><p>-TaskName</p><p>UpdatePSHelp</p><p>-Action</p><p>$act</p><p>-Trigger</p><p>$trig</p><p>-RunLevel</p><p>Highest</p><p>`Start by creating the command strings to start PowerShell and the arguments you pass to it. I left it as a visible PowerShell window that stays opn so I can see the results. The PowerShell command</p><p>Update-Help -UICulture en-US &ldquo;“Force</p><p>performs the actual update. You will need to change the culture to match yours if you aren&rdquo;™t using English. You can find it by using</p><p>Get-UICulture</p><p>I"™m only going to run this on Wednesdays .</p><p>Any old copies of the task are cleaned out and new task actions (to execute PowerShell) and trigger to define when it runs are created. The last line registers the task.</p><p>You can view the task</p><p>Get-ScheduledTask -TaskName UpdatePSHelp</p><p>or start the task manually</p><p>Start-ScheduledTask -TaskName UpdatePSHelp</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2789/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2789/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2789&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Planning the PowerShell Summit North America 2014</title><link>https://powershell.org/articles/2013-01-12-planning-the-powershell-summit-north-america-2014/</link><guid>https://powershell.org/articles/2013-01-12-planning-the-powershell-summit-north-america-2014/</guid><pubDate>Sat, 12 Jan 2013 20:35:17 +0000</pubDate><description>&lt;p&gt;We&amp;rsquo;re already planning for the 2014 Summit&amp;hellip; you have to get way out in front of these things to secure space, plan a budget, and more.&lt;br&gt;
Here&amp;rsquo;s what we know:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We&amp;rsquo;ll definitely still be in the Seattle metro area. That&amp;rsquo;s the best way to ensure participation from the PowerShell team, since it doesn&amp;rsquo;t require them to leave town for days at a time.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We&amp;rsquo;ll be in April 2014. We&amp;rsquo;re going to try for April 14-16 to avoid Easter, or April 28-30.&lt;/li&gt;
&lt;li&gt;We&amp;rsquo;ll be in a bigger venue. We hope to support a crowd of up to 300, although we&amp;rsquo;re still aiming for a smaller group. That&amp;rsquo;ll give us more flexibility in session planning, along with the possibility of on-site evening events.&lt;/li&gt;
&lt;li&gt;We will &lt;strong&gt;open up early bird ticketing&lt;/strong&gt; for 2013 alumni the week of April 29-May 3. 50 tickets will be available. If there are any of those tickets left after May 3, they&amp;rsquo;ll be offered to the public May 6 through 10. Any remaining early bird tickets will be converted to full-price tickets after May 10, when general sales will begin. Early bird pricing will be in the $650 range. Full pricing will be around $850. This is more than 2013, but will help us (a) fully reimburse speaker travel expenses, which we couldn&amp;rsquo;t do in 2013, (b) pay for the larger conference venue, (c) offer a full hot breakfast every day and beverages throughout the day, and (d) allow for bussing to the event venue (see below). Early Bird tickets will be fully refundable until the end of 2013.&lt;/li&gt;
&lt;li&gt;We are going to try and hold a percentage of our full-price tickets for release in January 2014. That way, people who can&amp;rsquo;t get budget until the year-of will still have a shot at tickets. This will be a small block of tickets, though - probably less than 30 - so if you can get budget to buy your tickets in 2013, do it.&lt;/li&gt;
&lt;li&gt;We will offer bussing from &lt;strong&gt;one&lt;/strong&gt; hotel complex to the event venue in the mornings, with return busses at night. It will be crucial that you book your hotel as soon as possible once we announce, so that you can lock in a room. This can help eliminate the need for a rental car, and lower your trip expenses. At least one hotel option at around $100-$110 a night will be offered, although it may be a limited room block. For folks in the US, you should be able to attend for about $2,000 including air, hotel, and registration. Add in dinners (which we don&amp;rsquo;t provide) and you should be able to attend for under $2500 including expenses. Not bad!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As you can see, we&amp;rsquo;re still trying to keep things as affordable and accessible as possible, in keeping with the nature of a community-owned event. We&amp;rsquo;re also trying to build this event into one that can support itself and continue to grow.&lt;br&gt;
I know a lot of folks who wanted to come in 2013 missed out&amp;hellip; so that&amp;rsquo;s why I&amp;rsquo;m giving you as much heads-up as possible. Start getting the boss on board. Get purchasing on board. Start planning to have the credit card ready in April 2013. We&amp;rsquo;ll get as many folks as we can into the 2014 Summit!&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>We&rsquo;re already planning for the 2014 Summit&hellip; you have to get way out in front of these things to secure space, plan a budget, and more.<br>
Here&rsquo;s what we know:</p><ul><li/></ul><p>We&rsquo;ll definitely still be in the Seattle metro area. That&rsquo;s the best way to ensure participation from the PowerShell team, since it doesn&rsquo;t require them to leave town for days at a time.</p><ul><li>We&rsquo;ll be in April 2014. We&rsquo;re going to try for April 14-16 to avoid Easter, or April 28-30.</li><li>We&rsquo;ll be in a bigger venue. We hope to support a crowd of up to 300, although we&rsquo;re still aiming for a smaller group. That&rsquo;ll give us more flexibility in session planning, along with the possibility of on-site evening events.</li><li>We will <strong>open up early bird ticketing</strong> for 2013 alumni the week of April 29-May 3. 50 tickets will be available. If there are any of those tickets left after May 3, they&rsquo;ll be offered to the public May 6 through 10. Any remaining early bird tickets will be converted to full-price tickets after May 10, when general sales will begin. Early bird pricing will be in the $650 range. Full pricing will be around $850. This is more than 2013, but will help us (a) fully reimburse speaker travel expenses, which we couldn&rsquo;t do in 2013, (b) pay for the larger conference venue, (c) offer a full hot breakfast every day and beverages throughout the day, and (d) allow for bussing to the event venue (see below). Early Bird tickets will be fully refundable until the end of 2013.</li><li>We are going to try and hold a percentage of our full-price tickets for release in January 2014. That way, people who can&rsquo;t get budget until the year-of will still have a shot at tickets. This will be a small block of tickets, though - probably less than 30 - so if you can get budget to buy your tickets in 2013, do it.</li><li>We will offer bussing from <strong>one</strong> hotel complex to the event venue in the mornings, with return busses at night. It will be crucial that you book your hotel as soon as possible once we announce, so that you can lock in a room. This can help eliminate the need for a rental car, and lower your trip expenses. At least one hotel option at around $100-$110 a night will be offered, although it may be a limited room block. For folks in the US, you should be able to attend for about $2,000 including air, hotel, and registration. Add in dinners (which we don&rsquo;t provide) and you should be able to attend for under $2500 including expenses. Not bad!</li></ul><p>As you can see, we&rsquo;re still trying to keep things as affordable and accessible as possible, in keeping with the nature of a community-owned event. We&rsquo;re also trying to build this event into one that can support itself and continue to grow.<br>
I know a lot of folks who wanted to come in 2013 missed out&hellip; so that&rsquo;s why I&rsquo;m giving you as much heads-up as possible. Start getting the boss on board. Get purchasing on board. Start planning to have the credit card ready in April 2013. We&rsquo;ll get as many folks as we can into the 2014 Summit!</p>
]]></content:encoded></item><item><title>Select-string "“ keeping in context</title><link>https://powershell.org/articles/2013-01-11-select-string-keeping-in-context/</link><guid>https://powershell.org/articles/2013-01-11-select-string-keeping-in-context/</guid><pubDate>Fri, 11 Jan 2013 19:43:05 +0000</pubDate><description>&lt;p&gt;Today&amp;quot;™s question involves using the Context parameter:&lt;/p&gt;
&lt;p&gt;*It&amp;rsquo;s probably just me, but I&amp;rsquo;ve never gotten the switch &amp;lsquo;-context 5 *&lt;em&gt;or -context 2, 7′ to work predictably – where 5 lines before and after or 2
before and 7 after will come out – have you?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;quot;™s start by looking at the default behaviour of select-string using the search pattern you&amp;quot;™ve seen previously:&lt;/p&gt;
&lt;p&gt;PS&amp;gt; Select-String -Path c:\test*.txt -Pattern &amp;ldquo;\A\w{5}ABCD&amp;rdquo;&lt;/p&gt;
&lt;p&gt;C:\test\fixedcol.txt:1:12345ABCD123451234512345&lt;/p&gt;
&lt;p&gt;C:\test\fixedcol.txt:3:12345ABCD123451234512345&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Today"™s question involves using the Context parameter:</p><p>*It&rsquo;s probably just me, but I&rsquo;ve never gotten the switch &lsquo;-context 5 *<em>or -context 2, 7′ to work predictably – where 5 lines before and after or 2
before and 7 after will come out – have you?</em></p><p>Let"™s start by looking at the default behaviour of select-string using the search pattern you"™ve seen previously:</p><p>PS&gt; Select-String -Path c:\test*.txt -Pattern &ldquo;\A\w{5}ABCD&rdquo;</p><p>C:\test\fixedcol.txt:1:12345ABCD123451234512345</p><p>C:\test\fixedcol.txt:3:12345ABCD123451234512345</p><p>C:\test\fixedcol.txt:4:12345abcd123451234512345</p><p>C:\test\fixedcol.txt:6:12345ABCD123451234512345</p><p>C:\test\fixedcol2.txt:1:12345ABCD123451234512345</p><p>As you can see the line which matches your pattern is returned.</p><p>Often this is all that is required but there are occasions when you need to be able to put the line into context that is you need to understand how the line containing you pattern relates to the data around it.</p><p>The is what the context parameter can provide.</p><p>If you look at the Select-String help file you will find this information on context.</p><p>-Context** *</p><p>Captures the specified number of lines before and after the line with the match. This allows you to view the match in context.</p><p>Required?</p><p>false</p><p>Position?</p><p>named</p><p>Default value</p><p>Accept pipeline input?</p><p>false</p><p>Accept wildcard characters?</p><p>false</p><p>The first thing to note is that the parameter takes an array of integers. The first (or only member of the array) tells PowerShell how many lines to show from before* and *after *the matching line while the second member of the array controls the number of lines that are displayed<em>after</em> the matching line. Put simply if you supply one values it controls the number of lines from before and after you match that are displayed but if you specify two values then you explicitly control the lines from before the match with the first value and the lines from after the match with the second. Some examples should make this clear.</p><p>I"™m going to use a file where we know the contents &ldquo;“ it makes the explanations easier. If you run this:</p><p>Get-Process | sort CPU -Descending | Out-File -FilePath c:\test\proc.txt &ldquo;“Force</p><p>You get a text file with the processes listed by CPU usage. You can examine the file for a particular process &ldquo;“ this case let&rdquo;™s look at Word:</p><p>PS&gt; Select-String -Path c:\test*.txt -Pattern &ldquo;Winword&rdquo; -SimpleMatch</p><p>C:\test\proc.txt:8:</p><p>360</p><p>25</p><p>20368</p><p>61728</p><p>331</p><p>41.89</p><p>4976 WINWORD</p><p>You know that the file is ordered by CPU usage so what are the processes using similar amounts of CPU to Word?</p><p>PS&gt; Select-String -Path c:\test*.txt -Pattern &ldquo;Winword&rdquo; -SimpleMatch -Context 2</p><p>C:\test\proc.txt:6:</p><p>653</p><p>34</p><p>66640</p><p>94416</p><p>286</p><p>48.77</p><p>3724 powershell</p><p>C:\test\proc.txt:7:</p><p>1124</p><p>29</p><p>13912</p><p>19336</p><p>210</p><p>47.71</p><p>5868 LiveComm</p><blockquote><p>C:\test\proc.txt:8:</p></blockquote><p>360</p><p>25</p><p>20368</p><p>61728</p><p>331</p><p>41.89</p><p>4976 WINWORD</p><p>C:\test\proc.txt:9:</p><p>212</p><p>9</p><p>2788</p><p>10956</p><p>78</p><p>28.67</p><p>4112 SynTPEnh</p><p>C:\test\proc.txt:10:</p><p>565</p><p>35</p><p>49172</p><p>82572</p><p>347</p><p>12.50</p><p>5660 WWAHost</p><p>The matching line is marked with a &gt; symbol. I&rdquo;™ve made it bold in the above listing for emphasis.</p><p>If you specify a number such that the file doesn&rdquo;™t have enough lines to display then only those lines that are available will be displayed for instance</p><p>Select-String -Path c:\test*.txt -Pattern &ldquo;Winword&rdquo; -SimpleMatch -Context 12</p><p>This can only display the seven lines prior to the match so that"™s all it does.</p><p>What about the situation where you only want the three processes that are using more CPU than Word?</p><p>PS&gt; Select-String -Path c:\test*.txt -Pattern &ldquo;Winword&rdquo; -SimpleMatch -Context 3,0</p><p>C:\test\proc.txt:5:</p><p>1555</p><p>74</p><p>30660</p><p>87176</p><p>465</p><p>80.70</p><p>5308 explorer</p><p>C:\test\proc.txt:6:</p><p>653</p><p>34</p><p>66640</p><p>94416</p><p>286</p><p>48.77</p><p>3724 powershell</p><p>C:\test\proc.txt:7:</p><p>1124</p><p>29</p><p>13912</p><p>19336</p><p>210</p><p>47.71</p><p>5868 LiveComm</p><blockquote><p>C:\test\proc.txt:8:</p></blockquote><p>360</p><p>25</p><p>20368</p><p>61728</p><p>331</p><p>41.89</p><p>4976 WINWORD</p><p>This works as well</p><p>PS&gt; Select-String -Path c:\test*.txt -Pattern &ldquo;Winword&rdquo; -SimpleMatch -Context 3,$null</p><p>C:\test\proc.txt:5:</p><p>1555</p><p>74</p><p>30660</p><p>87176</p><p>465</p><p>80.70</p><p>5308 explorer</p><p>C:\test\proc.txt:6:</p><p>653</p><p>34</p><p>66640</p><p>94416</p><p>286</p><p>48.77</p><p>3724 powershell</p><p>C:\test\proc.txt:7:</p><p>1124</p><p>29</p><p>13912</p><p>19336</p><p>210</p><p>47.71</p><p>5868 LiveComm</p><blockquote><p>C:\test\proc.txt:8:</p></blockquote><p>360</p><p>25</p><p>20368</p><p>61728</p><p>331</p><p>41.89</p><p>4976 WINWORD</p><p>The one thing you can"™t do is this:</p><p>PS&gt; Select-String -Path c:\test*.txt -Pattern &ldquo;Winword&rdquo; -SimpleMatch -Context 3,</p><blockquote><blockquote/></blockquote><p>PowerShell expects something after the comma and will prompt you to supply it.</p><p>The converse holds true if you want the lines that occur after the match. You can use a 0 as the first element:</p><p>PS&gt; Select-String -Path c:\test*.txt -Pattern &ldquo;Winword&rdquo; -SimpleMatch -Context 0,3</p><blockquote><p>C:\test\proc.txt:8:</p></blockquote><p>360</p><p>25</p><p>20368</p><p>61728</p><p>331</p><p>41.89</p><p>4976 WINWORD</p><p>C:\test\proc.txt:9:</p><p>212</p><p>9</p><p>2788</p><p>10956</p><p>78</p><p>28.67</p><p>4112 SynTPEnh</p><p>C:\test\proc.txt:10:</p><p>565</p><p>35</p><p>49172</p><p>82572</p><p>347</p><p>12.50</p><p>5660 WWAHost</p><p>C:\test\proc.txt:11:</p><p>276</p><p>19</p><p>6608</p><p>12628</p><p>88</p><p>9.33</p><p>5252 taskhostex</p><p>Or $null</p><p>PS&gt; Select-String -Path c:\test*.txt -Pattern &ldquo;Winword&rdquo; -SimpleMatch -Context $null,3</p><blockquote><p>C:\test\proc.txt:8:</p></blockquote><p>360</p><p>25</p><p>20368</p><p>61728</p><p>331</p><p>41.89</p><p>4976 WINWORD</p><p>C:\test\proc.txt:9:</p><p>212</p><p>9</p><p>2788</p><p>10956</p><p>78</p><p>28.67</p><p>4112 SynTPEnh</p><p>C:\test\proc.txt:10:</p><p>565</p><p>35</p><p>49172</p><p>82572</p><p>347</p><p>12.50</p><p>5660 WWAHost</p><p>C:\test\proc.txt:11:</p><p>276</p><p>19</p><p>6608</p><p>12628</p><p>88</p><p>9.33</p><p>5252 taskhostex</p><p>You can"™t leave the first element blank</p><p>PS&gt; Select-String -Path c:\test*.txt -Pattern &ldquo;Winword&rdquo; -SimpleMatch -Context ,3</p><p>At line:1 char:76</p><ul><li><p>Select-String -Path c:\test*.txt -Pattern &ldquo;Winword&rdquo; -SimpleMatch -Context ,3</p></li><li/></ul><p>~</p><p>Missing argument in parameter list.</p><ul><li>CategoryInfo</li></ul><p>: ParserError: (:) [], ParentContainsErrorRecordException</p><ul><li><p>FullyQualifiedErrorId : MissingArgument</p><p>This leads to the situation where you need to display a different number of lines before and after the match:</p><p>PS&gt; Select-String -Path c:\test*.txt -Pattern &ldquo;Winword&rdquo; -SimpleMatch -Context 3,2</p></li></ul><p>C:\test\proc.txt:5:</p><p>1555</p><p>74</p><p>30660</p><p>87176</p><p>465</p><p>80.70</p><p>5308 explorer</p><p>C:\test\proc.txt:6:</p><p>653</p><p>34</p><p>66640</p><p>94416</p><p>286</p><p>48.77</p><p>3724 powershell</p><p>C:\test\proc.txt:7:</p><p>1124</p><p>29</p><p>13912</p><p>19336</p><p>210</p><p>47.71</p><p>5868 LiveComm</p><blockquote><p>C:\test\proc.txt:8:</p></blockquote><p>360</p><p>25</p><p>20368</p><p>61728</p><p>331</p><p>41.89</p><p>4976 WINWORD</p><p>C:\test\proc.txt:9:</p><p>212</p><p>9</p><p>2788</p><p>10956</p><p>78</p><p>28.67</p><p>4112 SynTPEnh</p><p>C:\test\proc.txt:10:</p><p>565</p><p>35</p><p>49172</p><p>82572</p><p>347</p><p>12.50</p><p>5660 WWAHost</p><p>What happens if you have multiple matches and their contexts overlap?</p><p>PS&gt; Select-String -Path c:\test*.txt -Pattern &ldquo;PowerShell&rdquo; -SimpleMatch</p><p>C:\test\proc.txt:9:</p><p>669</p><p>34</p><p>67544</p><p>62228</p><p>286</p><p>54.99</p><p>3724 powershell</p><p>C:\test\proc.txt:12:</p><p>473</p><p>23</p><p>69112</p><p>86616</p><p>366</p><p>11.73</p><p>1688 powershell_ise</p><p>C:\test\proc.txt:19:</p><p>346</p><p>13</p><p>39576</p><p>44540</p><p>207</p><p>3.15</p><p>280 PowerShell</p><p>This file shows matches on lines 9, 12 and 19 so let"™s try this</p><p>PS&gt; Select-String -Path c:\test*.txt -Pattern &ldquo;PowerShell&rdquo; -SimpleMatch -Context 4,5</p><p>C:\test\proc.txt:5:</p><p>1840</p><p>91</p><p>35836</p><p>75652</p><p>545</p><p>142.49</p><p>5308 explorer</p><p>C:\test\proc.txt:6:</p><p>618</p><p>23</p><p>68524</p><p>28788</p><p>194</p><p>108.84</p><p>5072 SkyDrive</p><p>C:\test\proc.txt:7:</p><p>1377</p><p>29</p><p>15668</p><p>23440</p><p>210</p><p>95.07</p><p>5868 LiveComm</p><p>C:\test\proc.txt:8:</p><p>211</p><p>9</p><p>2792</p><p>4516</p><p>78</p><p>59.98</p><p>4112 SynTPEnh</p><p>**&gt; C:\test\proc.txt:9:</p><p>669</p><p>34</p><p>67544</p><p>62228</p><p>286</p><p>54.99</p><p>3724 powershell**</p><p>C:\test\proc.txt:10:</p><p>560</p><p>35</p><p>53480</p><p>88760</p><p>370</p><p>22.95</p><p>2656 WWAHost</p><p>C:\test\proc.txt:11:</p><p>240</p><p>8</p><p>1952</p><p>2340</p><p>71</p><p>12.32</p><p>5580 TabTip</p><p>**&gt; C:\test\proc.txt:12:</p><p>473</p><p>23</p><p>69112</p><p>86616</p><p>366</p><p>11.73</p><p>1688 powershell_ise**</p><p>C:\test\proc.txt:13:</p><p>254</p><p>9</p><p>4684</p><p>9940</p><p>86</p><p>11.31</p><p>6136 RuntimeBroker</p><p>C:\test\proc.txt:14:</p><p>285</p><p>14</p><p>4116</p><p>4724</p><p>84</p><p>10.19</p><p>5252 taskhostex</p><p>C:\test\proc.txt:15:</p><p>82</p><p>5</p><p>2008</p><p>6148</p><p>55</p><p>7.52</p><p>2416 conhost</p><p>C:\test\proc.txt:16:</p><p>305</p><p>14</p><p>17608</p><p>5088</p><p>184</p><p>5.19</p><p>404 IAStorIcon</p><p>C:\test\proc.txt:17:</p><p>337</p><p>8</p><p>2180</p><p>536</p><p>76</p><p>4.79</p><p>376 InputPersonalization</p><p>C:\test\proc.txt:18:</p><p>409</p><p>12</p><p>4416</p><p>5464</p><p>79</p><p>4.26</p><p>5276 taskhost</p><p>**&gt; C:\test\proc.txt:19:</p><p>346</p><p>13</p><p>39576</p><p>44540</p><p>207</p><p>3.15</p><p>280 powershell**</p><p>C:\test\proc.txt:20:</p><p>125</p><p>5</p><p>2820</p><p>744</p><p>70</p><p>2.61</p><p>908 splwow64</p><p>C:\test\proc.txt:21:</p><p>347</p><p>13</p><p>12180</p><p>804</p><p>183</p><p>2.40</p><p>4788 PopUp_DM</p><p>C:\test\proc.txt:22:</p><p>335</p><p>10</p><p>2576</p><p>1756</p><p>83</p><p>2.20</p><p>4636 AdobeARM</p><p>C:\test\proc.txt:23:</p><p>249</p><p>21</p><p>6628</p><p>540</p><p>129</p><p>1.44</p><p>5220 SRSPremiumPanel</p><p>C:\test\proc.txt:24:</p><p>387</p><p>11</p><p>3436</p><p>12280</p><p>83</p><p>0.94</p><p>3828 WSHost</p><p>I"™ve highlighted the lines that actually match.</p><p>Starting with the first match you get 4 lines before it as requested. There should be 5 lines after the match BUT the next match is only 3 lines on and you asked for 5 lines after that. The lines before the last match overlap the lines after the second match. The lines after the last match are shown as requested.</p><p>At first glance it looks like the command hasn"™t worked but what seems to be happening is that only unique lines are displayed.</p><p>I looked at the individual matches</p><p>$finds = Select-String -Path c:\test*.txt -Pattern &ldquo;PowerShell&rdquo; -SimpleMatch -Context 4,5</p><p>for ($i=0; $i -le $finds.count; $i++){$finds[$i]; &ldquo;###"*8}</p><p>and received this output (I&rdquo;™ve split the display so you can see what is produced.</p><p>First match:</p><p>C:\test\proc.txt:5:</p><p>1840</p><p>91</p><p>35836</p><p>75652</p><p>545</p><p>142.49</p><p>5308 explorer</p><p>C:\test\proc.txt:6:</p><p>618</p><p>23</p><p>68524</p><p>28788</p><p>194</p><p>108.84</p><p>5072 SkyDrive</p><p>C:\test\proc.txt:7:</p><p>1377</p><p>29</p><p>15668</p><p>23440</p><p>210</p><p>95.07</p><p>5868 LiveComm</p><p>C:\test\proc.txt:8:</p><p>211</p><p>9</p><p>2792</p><p>4516</p><p>78</p><p>59.98</p><p>4112 SynTPEnh</p><p>**&gt; C:\test\proc.txt:9:</p><p>669</p><p>34</p><p>67544</p><p>62228</p><p>286</p><p>54.99</p><p>3724 powershell**</p><p>C:\test\proc.txt:10:</p><p>560</p><p>35</p><p>53480</p><p>88760</p><p>370</p><p>22.95</p><p>2656 WWAHost</p><p>C:\test\proc.txt:11:</p><p>240</p><p>8</p><p>1952</p><p>2340</p><p>71</p><p>12.32</p><p>5580 TabTip</p><p>########################</p><p>Correct number before but restricted output after</p><p>Second match:</p><p>**&gt; C:\test\proc.txt:12:</p><p>473</p><p>23</p><p>69112</p><p>86616</p><p>366</p><p>11.73</p><p>1688 powershell_ise**</p><p>C:\test\proc.txt:13:</p><p>254</p><p>9</p><p>4684</p><p>9940</p><p>86</p><p>11.31</p><p>6136 RuntimeBroker</p><p>C:\test\proc.txt:14:</p><p>285</p><p>14</p><p>4116</p><p>4724</p><p>84</p><p>10.19</p><p>5252 taskhostex</p><p>C:\test\proc.txt:15:</p><p>82</p><p>5</p><p>2008</p><p>6148</p><p>55</p><p>7.52</p><p>2416 conhost</p><p>C:\test\proc.txt:16:</p><p>305</p><p>14</p><p>17608</p><p>5088</p><p>184</p><p>5.19</p><p>404 IAStorIcon</p><p>C:\test\proc.txt:17:</p><p>337</p><p>8</p><p>2180</p><p>536</p><p>76</p><p>4.79</p><p>376 InputPersonalization</p><p>########################</p><p>Nothing before and correct output after the match</p><p>Last match:</p><p>C:\test\proc.txt:18:</p><p>409</p><p>12</p><p>4416</p><p>5464</p><p>79</p><p>4.26</p><p>5276 taskhost</p><p>**&gt; C:\test\proc.txt:19:</p><p>346</p><p>13</p><p>39576</p><p>44540</p><p>207</p><p>3.15</p><p>280 powershell**</p><p>C:\test\proc.txt:20:</p><p>125</p><p>5</p><p>2820</p><p>744</p><p>70</p><p>2.61</p><p>908 splwow64</p><p>C:\test\proc.txt:21:</p><p>347</p><p>13</p><p>12180</p><p>804</p><p>183</p><p>2.40</p><p>4788 PopUp_DM</p><p>C:\test\proc.txt:22:</p><p>335</p><p>10</p><p>2576</p><p>1756</p><p>83</p><p>2.20</p><p>4636 AdobeARM</p><p>C:\test\proc.txt:23:</p><p>249</p><p>21</p><p>6628</p><p>540</p><p>129</p><p>1.44</p><p>5220 SRSPremiumPanel</p><p>C:\test\proc.txt:24:</p><p>387</p><p>11</p><p>3436</p><p>12280</p><p>83</p><p>0.94</p><p>3828 WSHost</p><p>########################</p><p>One line before the match and correct number after the match.</p><p>This confirms that if a line has appeared in a previous match you won"™t see it again. Is there a way to see the full context for each match? Unfortunately, Select-String doesn"™t appear to provide that capability directly. A little bit of working with the output should enable this.</p><p>Select-String -Path c:\test*.txt -Pattern &ldquo;PowerShell&rdquo; -SimpleMatch -Context 4,5 |</p><p>foreach {</p><p>#matching line</p><p>$padlength = (" {0}:{1:00}: " -f $<em>.Path, $</em>.LineNumber).Length</p><p>$pad = " &ldquo;*$padlength</p><p>$<em>.Context.PreContext | foreach {$</em>.Trim().Insert(0,$pad)}</p><p>"&rdquo;</p><p>" {0}:{1:00}: {2}" -f $<em>.Path, $</em>.LineNumber, ($_.Line).Trim()</p><p>""</p><p>$<em>.Context.PostContext | foreach {$</em>.Trim().Insert(0,$pad)}</p><p>""</p><p>""</p><p>}</p><p>Run the select-string as before. For each of the matches find the length of the formatted path and line number and create a blank string of that length.</p><p>If you examine the MatchInfo type that Select-String produces you will see a Property called Context. If you examine that you will see it contains the collection of data for the pre and post context. (There are also display versions of the context).</p><p>For each line in the pre-context insert the pad characters at the beginning. Display the formatted match line and then display the post-context data.</p><p>I"™ve inserted some blank lines to help format the display</p><p>You will get output like this:</p><p>1840</p><p>91</p><p>35836</p><p>75652</p><p>545</p><p>142.49</p><p>5308 explorer</p><p>618</p><p>23</p><p>68524</p><p>28788</p><p>194</p><p>108.84</p><p>5072 SkyDrive</p><p>1377</p><p>29</p><p>15668</p><p>23440</p><p>210</p><p>95.07</p><p>5868 LiveComm</p><p>211</p><p>9</p><p>2792</p><p>4516</p><p>78</p><p>59.98</p><p>4112 SynTPEnh</p><p>C:\test\proc.txt:09: 669</p><p>34</p><p>67544</p><p>62228</p><p>286</p><p>54.99</p><p>3724 powershell</p><p>560</p><p>35</p><p>53480</p><p>88760</p><p>370</p><p>22.95</p><p>2656 WWAHost</p><p>240</p><p>8</p><p>1952</p><p>2340</p><p>71</p><p>12.32</p><p>5580 TabTip</p><p>473</p><p>23</p><p>69112</p><p>86616</p><p>366</p><p>11.73</p><p>1688 powershell_ise</p><p>254</p><p>9</p><p>4684</p><p>9940</p><p>86</p><p>11.31</p><p>6136 RuntimeBroker</p><p>285</p><p>14</p><p>4116</p><p>4724</p><p>84</p><p>10.19</p><p>5252 taskhostex</p><p>211</p><p>9</p><p>2792</p><p>4516</p><p>78</p><p>59.98</p><p>4112 SynTPEnh</p><p>669</p><p>34</p><p>67544</p><p>62228</p><p>286</p><p>54.99</p><p>3724 powershell</p><p>560</p><p>35</p><p>53480</p><p>88760</p><p>370</p><p>22.95</p><p>2656 WWAHost</p><p>240</p><p>8</p><p>1952</p><p>2340</p><p>71</p><p>12.32</p><p>5580 TabTip</p><p>C:\test\proc.txt:12: 473</p><p>23</p><p>69112</p><p>86616</p><p>366</p><p>11.73</p><p>1688 powershell_ise</p><p>254</p><p>9</p><p>4684</p><p>9940</p><p>86</p><p>11.31</p><p>6136 RuntimeBroker</p><p>285</p><p>14</p><p>4116</p><p>4724</p><p>84</p><p>10.19</p><p>5252 taskhostex</p><p>82</p><p>5</p><p>2008</p><p>6148</p><p>55</p><p>7.52</p><p>2416 conhost</p><p>305</p><p>14</p><p>17608</p><p>5088</p><p>184</p><p>5.19</p><p>404 IAStorIcon</p><p>337</p><p>8</p><p>2180</p><p>536</p><p>76</p><p>4.79</p><p>376 InputPersonalization</p><p>82</p><p>5</p><p>2008</p><p>6148</p><p>55</p><p>7.52</p><p>2416 conhost</p><p>305</p><p>14</p><p>17608</p><p>5088</p><p>184</p><p>5.19</p><p>404 IAStorIcon</p><p>337</p><p>8</p><p>2180</p><p>536</p><p>76</p><p>4.79</p><p>376 InputPersonalization</p><p>409</p><p>12</p><p>4416</p><p>5464</p><p>79</p><p>4.26</p><p>5276 taskhost</p><p>C:\test\proc.txt:19: 346</p><p>13</p><p>39576</p><p>44540</p><p>207</p><p>3.15</p><p>280 powershell</p><p>125</p><p>5</p><p>2820</p><p>744</p><p>70</p><p>2.61</p><p>908 splwow64</p><p>347</p><p>13</p><p>12180</p><p>804</p><p>183</p><p>2.40</p><p>4788 PopUp_DM</p><p>335</p><p>10</p><p>2576</p><p>1756</p><p>83</p><p>2.20</p><p>4636 AdobeARM</p><p>249</p><p>21</p><p>6628</p><p>540</p><p>129</p><p>1.44</p><p>5220 SRSPremiumPanel</p><p>387</p><p>11</p><p>3436</p><p>12280</p><p>83</p><p>0.94</p><p>3828 WSHost</p><p>Not the greatest of displays but you do get to see the data. It should be possible to do this through PowerShell"™s formatting system but that"™s a post for another day.</p><p>Bottom line &ldquo;“ the context parameter only displays unique lines so you won&rdquo;™t necessarily get what you expect if there are multiple matches in a file.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2788/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2788/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2788&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Windows PowerShell V3 Language Specification Posted</title><link>https://powershell.org/articles/2013-01-11-windows-powershell-v3-language-specification-posted/</link><guid>https://powershell.org/articles/2013-01-11-windows-powershell-v3-language-specification-posted/</guid><pubDate>Fri, 11 Jan 2013 15:52:14 +0000</pubDate><description>&lt;p&gt;You can download it &lt;a href="http://www.microsoft.com/en-us/download/details.aspx?id=36389"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/rkeithhill.wordpress.com/275/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/rkeithhill.wordpress.com/275/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=rkeithhill.wordpress.com&amp;amp;blog=18780344&amp;amp;%23038;post=275&amp;amp;%23038;subd=rkeithhill&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>You can download it<a href="http://www.microsoft.com/en-us/download/details.aspx?id=36389">here</a>.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/rkeithhill.wordpress.com/275/"><img src="http://feeds.wordpress.com/1.0/comments/rkeithhill.wordpress.com/275/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=rkeithhill.wordpress.com&amp;blog=18780344&amp;%23038;post=275&amp;%23038;subd=rkeithhill&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Writing 10961A: The Damn Variables</title><link>https://powershell.org/articles/2013-01-10-writing-10961a-the-damn-variables/</link><guid>https://powershell.org/articles/2013-01-10-writing-10961a-the-damn-variables/</guid><pubDate>Thu, 10 Jan 2013 17:51:07 +0000</pubDate><description>&lt;p&gt;When I wrote Microsoft course 10325A, their original 5-day Windows PowerShell course, I saved variables until Module 11. My thought at the time was to focus on teaching just what students needed for what they were about to do - and no more. &amp;ldquo;Just in time learning&amp;rdquo; can be effective, because it lets you immediately experiment with whatever you&amp;rsquo;ve just learned, and helps minimize the need to store up concepts for later use. I&amp;rsquo;d also had a lot of class experiences where bringing up variables too soon engaged a defensive mechanism in some students: &amp;ldquo;I&amp;rsquo;m not a programmer, variables are programming, and I&amp;rsquo;m shutting down right now.&amp;rdquo;&lt;br&gt;
The biggest piece of MCT feedback from 10325A was, &amp;ldquo;don&amp;rsquo;t do that.&amp;rdquo; Trainers told me they were often teaching module 11 much sooner. Jeff Hicks had what I think is the best explanation for why: Without variables, you&amp;rsquo;re locked into the one-liner approach in PowerShell. While one-liners are &lt;em&gt;neat,&lt;/em&gt; and effective, they aren&amp;rsquo;t always easy to read or to mentally de-construct. Using variables earlier in the course, Jeff argued, let you break things down into smaller logical chunks.&lt;br&gt;
Now, one thing I&amp;rsquo;ve had to accept in writing 10961A is that I can&amp;rsquo;t please everyone. The feedback on 10325A is incredibly contradictory. Some MCTs want more programming, others want none at all. Some want classes to run 9am-4pm; others want 8am-6pm. Some want less content on the slides (actually, most wanted that). So what I decided to do is try and provide the material to accommodate what it felt like everyone was asking for, and rely on MCT&amp;rsquo;s ability to mix things up as needed for their classes.&lt;br&gt;
(As an aside, I do think some MCTs jump into the &amp;ldquo;programming&amp;rdquo; aspect of PowerShell too quickly. It&amp;rsquo;s fine if you&amp;rsquo;ve got a room of people with programming experience, but it keeps students from learning some valuable fundamentals and turns the class into a &amp;ldquo;scripting&amp;rdquo; class awfully quickly. I&amp;rsquo;m not sure every MCT has done a really thorough cognitive analysis of their class results to determine if the programming-first approach is best; my experience with &lt;em&gt;Month of Lunches&lt;/em&gt; readers suggest it isn&amp;rsquo;t.)&lt;br&gt;
But I still didn&amp;rsquo;t want to do the full deep-dive on variables super-early in the course. So here&amp;rsquo;s what I think I&amp;rsquo;m doing: early in the course, you&amp;rsquo;ll be exposed to variables, in a very simplistic sense. They&amp;rsquo;re described as a named place to store objects, and used to de-construct a complex one-liner into a multi-line series of logical steps. Early in the course, I don&amp;rsquo;t go into naming rules, the double quotes tricks, or anything else. You learn exactly enough about variables for the task at hand - and no more.&lt;br&gt;
In module 7, which is right before the module where you turn a command-line into a parameterized script, I cover variables more formally. I cover their rules, usage, double quotes, all that stuff. So you learn a wee bit about variables early, and then learn the full details later - &lt;em&gt;just&lt;/em&gt; before you need to use variables more seriously in a script. So, keeping with the just-in-time learning.&lt;br&gt;
The variables material is broken out into its own lesson in module 7, so an MCT hell-bent on teaching everything about variables right up-front can do so.While the feedback from 10325A suggests that MCTs think every course should be designed for the way &lt;em&gt;they&lt;/em&gt; teach, I&amp;rsquo;m not sure they all realize how &lt;em&gt;differently&lt;/em&gt; they all teach. The best I can do is provide the material in standalone chunks that MCTs can rearrange as needed. After all, the whole point of having a live instructor, as opposed to a recording, is the instructor&amp;rsquo;s ability to teach to your specific needs. So MCTs will have to be happy rearranging the material a bit as-needed; my outline is the &lt;em&gt;recommnded&lt;/em&gt; approach that will work best across the broadest array of students, but it isn&amp;rsquo;t perfect for &lt;em&gt;everyone.&lt;/em&gt; Nothing could be.&lt;br&gt;
As a point of reference, 10961A doesn&amp;rsquo;t dive into scripting as deeply as 10325A did. PowerShell 3.0 has enough new, extra stuff that a 5-day course doesn&amp;rsquo;t allow for deep programming topics. You do take a command and walk it through to being a script module, so you &lt;em&gt;see&lt;/em&gt; the range of scripting options, but you don&amp;rsquo;t &lt;em&gt;practice&lt;/em&gt; them in depth. It&amp;rsquo;s inch-deep, mile-wide coverage of scripting, as opposed to something deeper and more focused. I&amp;rsquo;m hoping Microsoft can find budget for a full-on &amp;ldquo;scripting/toolmaking&amp;rdquo; class in the future, but 10961A ain&amp;rsquo;t it.&lt;br&gt;
So&amp;hellip; what do you think of this approach?&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>When I wrote Microsoft course 10325A, their original 5-day Windows PowerShell course, I saved variables until Module 11. My thought at the time was to focus on teaching just what students needed for what they were about to do - and no more. &ldquo;Just in time learning&rdquo; can be effective, because it lets you immediately experiment with whatever you&rsquo;ve just learned, and helps minimize the need to store up concepts for later use. I&rsquo;d also had a lot of class experiences where bringing up variables too soon engaged a defensive mechanism in some students: &ldquo;I&rsquo;m not a programmer, variables are programming, and I&rsquo;m shutting down right now.&rdquo;<br>
The biggest piece of MCT feedback from 10325A was, &ldquo;don&rsquo;t do that.&rdquo; Trainers told me they were often teaching module 11 much sooner. Jeff Hicks had what I think is the best explanation for why: Without variables, you&rsquo;re locked into the one-liner approach in PowerShell. While one-liners are<em>neat,</em> and effective, they aren&rsquo;t always easy to read or to mentally de-construct. Using variables earlier in the course, Jeff argued, let you break things down into smaller logical chunks.<br>
Now, one thing I&rsquo;ve had to accept in writing 10961A is that I can&rsquo;t please everyone. The feedback on 10325A is incredibly contradictory. Some MCTs want more programming, others want none at all. Some want classes to run 9am-4pm; others want 8am-6pm. Some want less content on the slides (actually, most wanted that). So what I decided to do is try and provide the material to accommodate what it felt like everyone was asking for, and rely on MCT&rsquo;s ability to mix things up as needed for their classes.<br>
(As an aside, I do think some MCTs jump into the &ldquo;programming&rdquo; aspect of PowerShell too quickly. It&rsquo;s fine if you&rsquo;ve got a room of people with programming experience, but it keeps students from learning some valuable fundamentals and turns the class into a &ldquo;scripting&rdquo; class awfully quickly. I&rsquo;m not sure every MCT has done a really thorough cognitive analysis of their class results to determine if the programming-first approach is best; my experience with<em>Month of Lunches</em> readers suggest it isn&rsquo;t.)<br>
But I still didn&rsquo;t want to do the full deep-dive on variables super-early in the course. So here&rsquo;s what I think I&rsquo;m doing: early in the course, you&rsquo;ll be exposed to variables, in a very simplistic sense. They&rsquo;re described as a named place to store objects, and used to de-construct a complex one-liner into a multi-line series of logical steps. Early in the course, I don&rsquo;t go into naming rules, the double quotes tricks, or anything else. You learn exactly enough about variables for the task at hand - and no more.<br>
In module 7, which is right before the module where you turn a command-line into a parameterized script, I cover variables more formally. I cover their rules, usage, double quotes, all that stuff. So you learn a wee bit about variables early, and then learn the full details later -<em>just</em> before you need to use variables more seriously in a script. So, keeping with the just-in-time learning.<br>
The variables material is broken out into its own lesson in module 7, so an MCT hell-bent on teaching everything about variables right up-front can do so.While the feedback from 10325A suggests that MCTs think every course should be designed for the way<em>they</em> teach, I&rsquo;m not sure they all realize how<em>differently</em> they all teach. The best I can do is provide the material in standalone chunks that MCTs can rearrange as needed. After all, the whole point of having a live instructor, as opposed to a recording, is the instructor&rsquo;s ability to teach to your specific needs. So MCTs will have to be happy rearranging the material a bit as-needed; my outline is the<em>recommnded</em> approach that will work best across the broadest array of students, but it isn&rsquo;t perfect for<em>everyone.</em> Nothing could be.<br>
As a point of reference, 10961A doesn&rsquo;t dive into scripting as deeply as 10325A did. PowerShell 3.0 has enough new, extra stuff that a 5-day course doesn&rsquo;t allow for deep programming topics. You do take a command and walk it through to being a script module, so you<em>see</em> the range of scripting options, but you don&rsquo;t<em>practice</em> them in depth. It&rsquo;s inch-deep, mile-wide coverage of scripting, as opposed to something deeper and more focused. I&rsquo;m hoping Microsoft can find budget for a full-on &ldquo;scripting/toolmaking&rdquo; class in the future, but 10961A ain&rsquo;t it.<br>
So&hellip; what do you think of this approach?</p>
]]></content:encoded></item><item><title>Select-String "“ finding the first and last matches</title><link>https://powershell.org/articles/2013-01-09-select-string-finding-the-first-and-last-matches/</link><guid>https://powershell.org/articles/2013-01-09-select-string-finding-the-first-and-last-matches/</guid><pubDate>Wed, 09 Jan 2013 17:55:40 +0000</pubDate><description>&lt;p&gt;Today&amp;rsquo;s question concerns finding the first and last matches in a file&lt;/p&gt;
&lt;p&gt;Sometimes, I need to make two passes at seeking content in this file, once for the first occurrence; and a second grep for obtaining the last occurrence of a phrase. After the second pass, I figure placing the values into an array is the best way, then need to combine first and last values onto one output line {somewhere else}.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Today&rsquo;s question concerns finding the first and last matches in a file</p><p>Sometimes, I need to make two passes at seeking content in this file, once for the first occurrence; and a second grep for obtaining the last occurrence of a phrase. After the second pass, I figure placing the values into an array is the best way, then need to combine first and last values onto one output line {somewhere else}.</p><p>Let&rsquo;s consider the file we used in the first article in the series –<a href="http://msmvps.com/blogs/richardsiddaway/archive/2013/01/07/select-string-scenarios-fixed-columns.aspx">http://msmvps.com/blogs/richardsiddaway/archive/2013/01/07/select-string-scenarios-fixed-columns.aspx</a></p><p>The file looks like this</p><p>12345ABCD123451234512345<br>
1234512345ABCD1234512345<br>
12345ABCD123451234512345<br>
12345abcd123451234512345<br>
123451234512345ABCD12345<br>
12345ABCD123451234512345<br>
123451234512345ABCD12345<br>
12345123451234512345ABCD<br>
1234512345ABCD1234512345</p><p>If you this select-string</p><p>Select-String -Path c:\test*.txt -Pattern &ldquo;\A\w{5}ABCD</p><p>you will get multiple matches</p><p>C:\test\fixedcol.txt:1:12345ABCD123451234512345<br>
C:\test\fixedcol.txt:3:12345ABCD123451234512345<br>
C:\test\fixedcol.txt:4:12345abcd123451234512345<br>
C:\test\fixedcol.txt:6:12345ABCD123451234512345</p><p>So, how can we find the first and last matches – preferably in one pass.</p><p>I think the easiest way is to use the trick from the last article</p><p>$finds = Select-String -Path c:\test*.txt -Pattern &ldquo;\A\w{5}ABCD&rdquo;</p><p>$finds[0]$finds[-1]</p><p>The $finds variable conatins a collection of the MatchInfo objects created by Select-String. The first match will always have the index of 0 and the last can always be referenecd by an index of -1. This information is returned:</p><p>C:\test\fixedcol.txt:1:12345ABCD123451234512345<br>
C:\test\fixedcol.txt:6:12345ABCD123451234512345</p><p>If you want this in an object for further processing – try something like this</p><p>Get-ChildItem -Path c:\test -Filter *.txt -Recurse |<br>
foreach {</p><p>$finds = $null<br>
$finds = Select-String -Path $_.Fullname -Pattern &ldquo;\A\w{5}ABCD&rdquo;</p><p>if ($finds){</p><p>$props = [ordered]@{<br>
Filename = $finds[0].Path<br>
FirstLine = $finds[0].LineNumber<br>
FirstData = $finds[0].Line<br>
LastLine = $finds[-1].LineNumber<br>
LastData = $finds[-1].Line<br>
}<br>
New-Object -TypeName PSObject -Property $props<br>
}<br>
}</p><p>Use Get-ChildItem to find the files. For each of them run Select-String with your pattern. If you get any matches create an object holding the file path and your required properties. In this case I&rsquo;m taking the first and last line numbers with the match data.</p><p>If you only have a single match in a file you will get the same data in the First* and Last* properties as the first and last match are the same. You could put another if statement to control this so the Last* properties aren&rsquo;t populated if you want.</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2787/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2787/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2787&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Workflow article 3</title><link>https://powershell.org/articles/2013-01-09-workflow-article-3/</link><guid>https://powershell.org/articles/2013-01-09-workflow-article-3/</guid><pubDate>Wed, 09 Jan 2013 17:19:28 +0000</pubDate><description>&lt;p&gt;The next in the series of articles on PowerShell workflows that are appearing on the Scripting Guy blog has been published.&lt;/p&gt;
&lt;p&gt;The articles in the series that have been published are:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx&lt;/a&gt;&lt;br&gt;
&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx&lt;/a&gt;&lt;br&gt;
&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/09/powershell-workflows-nesting.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/09/powershell-workflows-nesting.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Look for the next article in one weeks time.&lt;/p&gt;
&lt;p&gt;Until then Enjoy!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2786/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2786/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2786&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>The next in the series of articles on PowerShell workflows that are appearing on the Scripting Guy blog has been published.</p><p>The articles in the series that have been published are:</p><p><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx</a><br><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx</a><br><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/09/powershell-workflows-nesting.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/09/powershell-workflows-nesting.aspx</a></p><p>Look for the next article in one weeks time.</p><p>Until then Enjoy!</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2786/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2786/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2786&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Select-String"“information on matching files</title><link>https://powershell.org/articles/2013-01-08-select-string-information-on-matching-files/</link><guid>https://powershell.org/articles/2013-01-08-select-string-information-on-matching-files/</guid><pubDate>Tue, 08 Jan 2013 21:31:36 +0000</pubDate><description>&lt;p&gt;Following on from yesterday&amp;quot;™s post this is the second question:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Since I&amp;rsquo;m recursively searching thru files to find matching phrases, how can I obtain other directory service information about the matching files file(s) – this is more of a methodology technique question because I realize there are multiple ways of achieving this?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;You could do something like this&lt;/p&gt;
&lt;p&gt;foreach ($find in Select-String -Path c:\test*.txt -Pattern &amp;ldquo;\A\w{5}ABCD&amp;rdquo; -List){&lt;br&gt;
Get-ChildItem -Path $find.Path&lt;br&gt;
}&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Following on from yesterday"™s post this is the second question:</p><p><em>Since I&rsquo;m recursively searching thru files to find matching phrases, how can I obtain other directory service information about the matching files file(s) – this is more of a methodology technique question because I realize there are multiple ways of achieving this?</em></p><p>You could do something like this</p><p>foreach ($find in Select-String -Path c:\test*.txt -Pattern &ldquo;\A\w{5}ABCD&rdquo; -List){<br>
Get-ChildItem -Path $find.Path<br>
}</p><p>Run the Select-String as before but only get the first match in each file. Use foreach to access the match information and use the Path property to feed into Get-ChildItem.</p><p>If you want things to be a bit simpler &ldquo;“ break it down to:</p><p>$finds = Select-String -Path c:\test*.txt -Pattern &ldquo;\A\w{5}ABCD&rdquo; -List<br>
foreach ($find in $finds){<br>
Get-ChildItem -Path $find.Path<br>
}</p><p>Alternatively if you want the PowerShell one-liner approach try</p><p>Get-ChildItem -Path (Select-String -Path c:\test*.txt -Pattern &ldquo;\A\w{5}ABCD&rdquo; -List).Path</p><p>Personally I would probably go for the simple approach</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2785/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2785/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2785&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>3 Updated Free PowerShell eBooks in January 2013!</title><link>https://powershell.org/articles/2013-01-08-3-updated-free-powershell-ebooks-in-january-2013/</link><guid>https://powershell.org/articles/2013-01-08-3-updated-free-powershell-ebooks-in-january-2013/</guid><pubDate>Tue, 08 Jan 2013 17:06:34 +0000</pubDate><description>&lt;p&gt;I&amp;rsquo;ve been working to update my three free PowerShell ebooks for this month:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Secrets of PowerShell Remoting&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Creating HTML Reports in PowerShell&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Making Historical and Trend Reports in PowerShell&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The updated versions will be made available to subscribers of the PowerShell.org TechLetter on January 15th. If you&amp;rsquo;re not already signed up to receive this, you can [sign up right now][1]. The January issue will also feature a walkthrough article of how I started creating a new, better ConvertTo-HTML command, which gets used in the ebook on HTML reporting. Going forward, I&amp;rsquo;ll be making updated ebooks available primarily through the TechLetter.&lt;br&gt;
If you&amp;rsquo;re not a subscriber and don&amp;rsquo;t want to be, well fine. I&amp;rsquo;ll just take my ball and go play in someone else&amp;rsquo;s sandbox. Kidding . I&amp;rsquo;ll post the updates at the end of January. However, right now access to the books still requires a subscription to the newsletter, although you can immediately unsubscribe if you want to. I had to put that &amp;ldquo;hurdle&amp;rdquo; in the way because we were losing a ton of bandwidth to people direct-linking the download files. Mostly from China, for some reason. You&amp;rsquo;re welcome to host the files on your own server, if you want to (they&amp;rsquo;re licensed for that), but bandwidth costs me money, so I&amp;rsquo;m trying to conserve a bit.&lt;br&gt;
Anyway, keep an eye out for the TechLetter in your inbox on Jan 15th. Check those spam filters, and make sure &lt;a href="mailto:newsletter@powershell.org"&gt;newsletter@powershell.org&lt;/a&gt; is in your address book, so that your mail server will know it&amp;rsquo;s a legitimate sender.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I&rsquo;ve been working to update my three free PowerShell ebooks for this month:</p><ul><li><em>Secrets of PowerShell Remoting</em></li><li><em>Creating HTML Reports in PowerShell</em></li><li><em>Making Historical and Trend Reports in PowerShell</em></li></ul><p>The updated versions will be made available to subscribers of the PowerShell.org TechLetter on January 15th. If you&rsquo;re not already signed up to receive this, you can [sign up right now][1]. The January issue will also feature a walkthrough article of how I started creating a new, better ConvertTo-HTML command, which gets used in the ebook on HTML reporting. Going forward, I&rsquo;ll be making updated ebooks available primarily through the TechLetter.<br>
If you&rsquo;re not a subscriber and don&rsquo;t want to be, well fine. I&rsquo;ll just take my ball and go play in someone else&rsquo;s sandbox. Kidding . I&rsquo;ll post the updates at the end of January. However, right now access to the books still requires a subscription to the newsletter, although you can immediately unsubscribe if you want to. I had to put that &ldquo;hurdle&rdquo; in the way because we were losing a ton of bandwidth to people direct-linking the download files. Mostly from China, for some reason. You&rsquo;re welcome to host the files on your own server, if you want to (they&rsquo;re licensed for that), but bandwidth costs me money, so I&rsquo;m trying to conserve a bit.<br>
Anyway, keep an eye out for the TechLetter in your inbox on Jan 15th. Check those spam filters, and make sure<a href="mailto:newsletter@powershell.org">newsletter@powershell.org</a> is in your address book, so that your mail server will know it&rsquo;s a legitimate sender.</p><p>[1]:<a href="https://powershell.org/newsletter">https://powershell.org/newsletter</a> &ldquo;Select-String scenarios &ldquo;“ fixed columns&rdquo;</p>
]]></content:encoded></item><item><title>Select-String scenarios "“ fixed columns</title><link>https://powershell.org/articles/2013-01-07-select-string-scenarios-fixed-columns/</link><guid>https://powershell.org/articles/2013-01-07-select-string-scenarios-fixed-columns/</guid><pubDate>Mon, 07 Jan 2013 22:43:53 +0000</pubDate><description>&lt;p&gt;I had some questions come in after mu recent post regarding select-string. I&amp;quot;™ll answer them as a series of posts. First off:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;I&amp;rsquo;m recursively searching thru many files, and want to pull out specific data in &amp;lsquo;fixed column&amp;rsquo; positions from the line(s) that match the phrase I&amp;rsquo;m seeking, i.e. position 10 thru 15 of the line or position 6 thru the end of the line (which might be unknown).&lt;br&gt;
What is your preferred method for handling this situation?&lt;/em&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I had some questions come in after mu recent post regarding select-string. I"™ll answer them as a series of posts. First off:</p><p><em>I&rsquo;m recursively searching thru many files, and want to pull out specific data in &lsquo;fixed column&rsquo; positions from the line(s) that match the phrase I&rsquo;m seeking, i.e. position 10 thru 15 of the line or position 6 thru the end of the line (which might be unknown).<br>
What is your preferred method for handling this situation?</em></p><p>I started by creating a file</p><p>12345ABCD123451234512345<br>
1234512345ABCD1234512345<br>
12345ABCD123451234512345<br>
12345abcd123451234512345<br>
123451234512345ABCD12345<br>
12345ABCD123451234512345<br>
123451234512345ABCD12345<br>
12345123451234512345ABCD<br>
1234512345ABCD1234512345</p><p>I want to pick out the string ABCD but ONLY when its in columns6-9. A quick inspection shows I should get four lines returned.</p><p>If you go with a simple match you get all lines returned</p><p>PS&gt; Select-String -Path c:\test*.txt -Pattern &ldquo;ABCD&rdquo; -SimpleMatch</p><p>C:\test\fxedcol.txt:1:12345ABCD123451234512345<br>
C:\test\fxedcol.txt:2:1234512345ABCD1234512345<br>
C:\test\fxedcol.txt:3:12345ABCD123451234512345<br>
C:\test\fxedcol.txt:4:12345abcd123451234512345<br>
C:\test\fxedcol.txt:5:123451234512345ABCD12345<br>
C:\test\fxedcol.txt:6:12345ABCD123451234512345<br>
C:\test\fxedcol.txt:7:123451234512345ABCD12345<br>
C:\test\fxedcol.txt:8:12345123451234512345ABCD<br>
C:\test\fxedcol.txt:9:1234512345ABCD1234512345</p><p>Notice the match is case INSENSITIVE</p><p>This means we get into the world of regular expressions &ldquo;“ joy!</p><p>This will work</p><p>Select-String -Path c:\test*.txt -Pattern &ldquo;\A.{5}ABCD&rdquo;</p><p>The regular expression means match any 5 characters followed by ABCD starting at the beginning of the string.</p><p>Alternatively you could use</p><p>Select-String -Path c:\test*.txt -Pattern &ldquo;\A\w{5}ABCD&rdquo;</p><p>This is the same except its accepting any word character (letter, digit, math symbol and punctuation)</p><p>These two searches are case INSENSITIVE</p><p>if you need case sensitivity then compare</p><p>Select-String -Path c:\test*.txt -Pattern &ldquo;\A\w{5}ABCD&rdquo; -CaseSensitive<br>
Select-String -Path c:\test*.txt -Pattern &ldquo;\A\w{5}abcd&rdquo; -CaseSensitive</p><p>or</p><p>Select-String -Path c:\test*.txt -Pattern &ldquo;\A.{5}ABCD&rdquo; -CaseSensitive<br>
Select-String -Path c:\test*.txt -Pattern &ldquo;\A.{5}abcd&rdquo; -CaseSensitive</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2784/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2784/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2784&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>PhillyPoSH 01/03/2013 meeting summary and presentation materials</title><link>https://powershell.org/articles/2013-01-07-phillyposh-01032013-meeting-summary-and-presentation-materials/</link><guid>https://powershell.org/articles/2013-01-07-phillyposh-01032013-meeting-summary-and-presentation-materials/</guid><pubDate>Mon, 07 Jan 2013 18:23:39 +0000</pubDate><description>&lt;ol&gt;
&lt;li&gt;User group member &lt;a href="http://tiki.gmartin.org/" title="Greg's blog"&gt;Greg Martin&lt;/a&gt; gave a presentation on Active Directory and PowerShell. A copy of his presentation can be found &lt;a href="https://powershell.org/wp-content/uploads/2013/01/PhillyPosh_2013-01-03_Presentations.zip"&gt;here&lt;/a&gt; and included the following topics:
&lt;ol&gt;
&lt;li&gt;Building a copy of your production AD domain&lt;/li&gt;
&lt;li&gt;Notifying users of expiring passwords&lt;/li&gt;
&lt;li&gt;Dealing with expired computer accounts&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;User group member &lt;a href="http://tekout.wordpress.com/"&gt;Sunny Chakraborty&lt;/a&gt; gave a presentation on how to use the techniques of Prof &lt;a href="http://en.wikipedia.org/wiki/George_P%C3%B3lya"&gt;George Poyla&lt;/a&gt; and Chess Grandmasters in order to improve your scripting skills. A copy of his presentation materials can be found &lt;a href="https://powershell.org/wp-content/uploads/2013/01/PhillyPosh_2013-01-03_Presentations.zip"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Various other information worth mentioning
&lt;ol&gt;
&lt;li&gt;User group member &lt;a href="http://tekout.wordpress.com/"&gt;Sunny Chakraborty&lt;/a&gt; submitted a list of PowerShell commands to retrieve Dell specific WMI objects. A copy of that list can be found &lt;a href="https://powershell.org/wp-content/uploads/2013/01/PhillyPosh_2013-01-03_Extras.zip"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Another group member (Name forthcoming!) submitted a list of PowerShell commands to retrieve HP Insight manager WMI Objects. A copy of that list can be found &lt;a href="https://powershell.org/wp-content/uploads/2013/01/PhillyPosh_2013-01-03_Extras.zip"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://blogs.msdn.com/b/powershell/archive/2012/12/20/windows-management-framework-3-0-compatibility-update.aspx"&gt;Do not install Windows Management Framework 3.0 (PowerShell 3.0) on the following systems&lt;/a&gt;, if you have please uninstall it so that you do not run into any issues with subsequent patches.
&lt;ol&gt;
&lt;li&gt;System Center 2012 Configuration Manager running on any Windows Server 2008 or 2008 R2 version&lt;/li&gt;
&lt;li&gt;System Center Virtual Machine Manager running on any Windows Server 2008 or 2008 R2 version&lt;/li&gt;
&lt;li&gt;Microsoft Exchange 2007 or 2010 running on any Windows Server 2008 or 2008 R2 version&lt;/li&gt;
&lt;li&gt;Microsoft SharePoint 2010 running on any Windows Server 2008 or 2008 R2 version&lt;/li&gt;
&lt;li&gt;Windows Small Business Server 2008 or 2011&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;On Twitter? Follow the &lt;a href="https://twitter.com/search?q=%23Powershell&amp;amp;src=typd"&gt;#PowerShell&lt;/a&gt; hashtag or check our &lt;a href="http://paglia.org/"&gt;Lido Paglia&amp;quot;™s&lt;/a&gt; &lt;a href="https://twitter.com/nicemarmot/powershellers"&gt;Powershell Twitter List&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;On Google+? Join the &lt;a href="https://plus.google.com/u/0/communities/114336958783305019912"&gt;PowerShell community&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Still haven&amp;quot;™t purchased a copy of &lt;a href="http://www.manning.com/jones3/"&gt;Learn PowerShell in a Month of Lunches&lt;/a&gt; or any other PowerShell book on &lt;a href="http://www.manning.com/"&gt;Manning Publications&lt;/a&gt;? Signup for their &lt;a href="http://www.manning.com/free/dotd.html"&gt;deal of the day&lt;/a&gt; newsletter or check the front page every day to see when it&amp;quot;™s on sale!&lt;/li&gt;
&lt;li&gt;If you&amp;quot;™re looking for .NET assembly browser and decomplier, take a look at &lt;a href="http://tekout.wordpress.com/"&gt;Sunny Chakraborty&amp;quot;™s&lt;/a&gt; favorite utility: &lt;a href="http://ilspy.net/"&gt;ILSpy&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Attachments:&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<ol><li>User group member <a href="http://tiki.gmartin.org/" title="Greg's blog">Greg Martin</a> gave a presentation on Active Directory and PowerShell. A copy of his presentation can be found<a href="https://powershell.org/wp-content/uploads/2013/01/PhillyPosh_2013-01-03_Presentations.zip">here</a> and included the following topics:<ol><li>Building a copy of your production AD domain</li><li>Notifying users of expiring passwords</li><li>Dealing with expired computer accounts</li></ol></li><li>User group member<a href="http://tekout.wordpress.com/">Sunny Chakraborty</a> gave a presentation on how to use the techniques of Prof<a href="http://en.wikipedia.org/wiki/George_P%C3%B3lya">George Poyla</a> and Chess Grandmasters in order to improve your scripting skills. A copy of his presentation materials can be found<a href="https://powershell.org/wp-content/uploads/2013/01/PhillyPosh_2013-01-03_Presentations.zip">here</a>.</li><li>Various other information worth mentioning<ol><li>User group member<a href="http://tekout.wordpress.com/">Sunny Chakraborty</a> submitted a list of PowerShell commands to retrieve Dell specific WMI objects. A copy of that list can be found<a href="https://powershell.org/wp-content/uploads/2013/01/PhillyPosh_2013-01-03_Extras.zip">here</a>.</li><li>Another group member (Name forthcoming!) submitted a list of PowerShell commands to retrieve HP Insight manager WMI Objects. A copy of that list can be found<a href="https://powershell.org/wp-content/uploads/2013/01/PhillyPosh_2013-01-03_Extras.zip">here</a>.</li><li><a href="http://blogs.msdn.com/b/powershell/archive/2012/12/20/windows-management-framework-3-0-compatibility-update.aspx">Do not install Windows Management Framework 3.0 (PowerShell 3.0) on the following systems</a>, if you have please uninstall it so that you do not run into any issues with subsequent patches.<ol><li>System Center 2012 Configuration Manager running on any Windows Server 2008 or 2008 R2 version</li><li>System Center Virtual Machine Manager running on any Windows Server 2008 or 2008 R2 version</li><li>Microsoft Exchange 2007 or 2010 running on any Windows Server 2008 or 2008 R2 version</li><li>Microsoft SharePoint 2010 running on any Windows Server 2008 or 2008 R2 version</li><li>Windows Small Business Server 2008 or 2011</li></ol></li><li>On Twitter? Follow the<a href="https://twitter.com/search?q=%23Powershell&amp;src=typd">#PowerShell</a> hashtag or check our<a href="http://paglia.org/">Lido Paglia"™s</a><a href="https://twitter.com/nicemarmot/powershellers">Powershell Twitter List</a>.</li><li>On Google+? Join the<a href="https://plus.google.com/u/0/communities/114336958783305019912">PowerShell community</a>.</li><li>Still haven"™t purchased a copy of<a href="http://www.manning.com/jones3/">Learn PowerShell in a Month of Lunches</a> or any other PowerShell book on<a href="http://www.manning.com/">Manning Publications</a>? Signup for their<a href="http://www.manning.com/free/dotd.html">deal of the day</a> newsletter or check the front page every day to see when it"™s on sale!</li><li>If you"™re looking for .NET assembly browser and decomplier, take a look at<a href="http://tekout.wordpress.com/">Sunny Chakraborty"™s</a> favorite utility:<a href="http://ilspy.net/">ILSpy</a>.</li></ol></li></ol><p>Attachments:</p><ul><li><a href="https://powershell.org/wp-content/uploads/2013/01/PhillyPosh_2013-01-03_Presentations.zip">PhillyPosh_2013-01-03_Presentations</a></li><li><a href="https://powershell.org/wp-content/uploads/2013/01/PhillyPosh_2013-01-03_Extras.zip">PhillyPosh_2013-01-03_Extras</a></li></ul>
]]></content:encoded></item><item><title>Select-String confusion</title><link>https://powershell.org/articles/2013-01-05-select-string-confusion/</link><guid>https://powershell.org/articles/2013-01-05-select-string-confusion/</guid><pubDate>Sat, 05 Jan 2013 13:08:59 +0000</pubDate><description>&lt;p&gt;I have seen a lot of confusion recently over the use of Select-String.&lt;/p&gt;
&lt;p&gt;One mis-conception is that you need to use Get-Content to pipe the file contents into Select-String. Not so. Select-String will read the file for you.&lt;/p&gt;
&lt;p&gt;If you just want to scan the files in a single folder to find a specific string then Select-String can do the work for you&lt;/p&gt;
&lt;p&gt;Select-String -Path C:\Test*.txt -Pattern &amp;ldquo;trial&amp;rdquo; &amp;ldquo;“SimpleMatch&lt;/p&gt;
&lt;p&gt;If you need to work through a folder structure add get-ChildItem to the pipeline&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I have seen a lot of confusion recently over the use of Select-String.</p><p>One mis-conception is that you need to use Get-Content to pipe the file contents into Select-String. Not so. Select-String will read the file for you.</p><p>If you just want to scan the files in a single folder to find a specific string then Select-String can do the work for you</p><p>Select-String -Path C:\Test*.txt -Pattern &ldquo;trial&rdquo; &ldquo;“SimpleMatch</p><p>If you need to work through a folder structure add get-ChildItem to the pipeline</p><p>Get-ChildItem -Path C:\Test -Filter *.txt -Recurse |<br>
Select-String -Pattern &ldquo;trial&rdquo; &ldquo;“SimpleMatch</p><p>One line of PowerShell gives you a very powerful way of filtering the files recursively and testing their contents for a given string</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2783/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2783/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2783&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Number of processors in a box</title><link>https://powershell.org/articles/2013-01-05-number-of-processors-in-a-box/</link><guid>https://powershell.org/articles/2013-01-05-number-of-processors-in-a-box/</guid><pubDate>Sat, 05 Jan 2013 12:21:23 +0000</pubDate><description>&lt;p&gt;WMI enables you find the number of processors in your system:&lt;/p&gt;
&lt;p&gt;PS&amp;gt; Get-WmiObject -Class Win32_ComputerSystem | fl Number*&lt;/p&gt;
&lt;p&gt;NumberOfLogicalProcessors : 2&lt;br&gt;
NumberOfProcessors : 1&lt;/p&gt;
&lt;p&gt;This works fine for Windows Vista/Windows 2008 and above.&lt;/p&gt;
&lt;p&gt;Earlier versions of Windows mis-report the number of processors &amp;ldquo;“ it counts the number of logical processors reports it as the number of physical processors.&lt;/p&gt;
&lt;p&gt;Win32_Processor has the same problem on Windows 2003 and below.&lt;/p&gt;
&lt;p&gt;There is a hotfix available from &lt;a href="http://support.microsoft.com/kb/932370" title="http://support.microsoft.com/kb/932370"&gt;http://support.microsoft.com/kb/932370&lt;/a&gt; that will correct the behaviour of these two WMI classes so that they report correctly&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>WMI enables you find the number of processors in your system:</p><p>PS&gt; Get-WmiObject -Class Win32_ComputerSystem | fl Number*</p><p>NumberOfLogicalProcessors : 2<br>
NumberOfProcessors : 1</p><p>This works fine for Windows Vista/Windows 2008 and above.</p><p>Earlier versions of Windows mis-report the number of processors &ldquo;“ it counts the number of logical processors reports it as the number of physical processors.</p><p>Win32_Processor has the same problem on Windows 2003 and below.</p><p>There is a hotfix available from<a href="http://support.microsoft.com/kb/932370" title="http://support.microsoft.com/kb/932370">http://support.microsoft.com/kb/932370</a> that will correct the behaviour of these two WMI classes so that they report correctly</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2782/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2782/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2782&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Finding the domain controller that authenticated you</title><link>https://powershell.org/articles/2013-01-04-finding-the-domain-controller-that-authenticated-you/</link><guid>https://powershell.org/articles/2013-01-04-finding-the-domain-controller-that-authenticated-you/</guid><pubDate>Fri, 04 Jan 2013 17:57:56 +0000</pubDate><description>&lt;p&gt;A question on my blog asked how do you know which domain controller you are running against when you search Active Directory. Unless you explicitly instruct your script to use a specific domain controller it will use the one to which you authenticated.&lt;/p&gt;
&lt;p&gt;You can find the DC to which you authenticated with this simple function&lt;/p&gt;
&lt;p&gt;function get-logonserver{&lt;br&gt;
$env:LOGONSERVER -replace &amp;ldquo;\&amp;rdquo;, &amp;quot;&amp;quot;&lt;br&gt;
}&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2781/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2781/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2781&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>A question on my blog asked how do you know which domain controller you are running against when you search Active Directory. Unless you explicitly instruct your script to use a specific domain controller it will use the one to which you authenticated.</p><p>You can find the DC to which you authenticated with this simple function</p><p>function get-logonserver{<br>
$env:LOGONSERVER -replace &ldquo;\&rdquo;, ""<br>
}</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2781/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2781/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2781&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Writing 10961: Trademarks</title><link>https://powershell.org/articles/2013-01-04-writing-10961-trademarks/</link><guid>https://powershell.org/articles/2013-01-04-writing-10961-trademarks/</guid><pubDate>Fri, 04 Jan 2013 16:09:02 +0000</pubDate><description>&lt;p&gt;Microsoft&amp;rsquo;s a big company, and that makes it a big target for lawsuits. We all know that. But what doesn&amp;rsquo;t always sink in is how careful the company has to be.&lt;br&gt;
For example, in Microsoft Official Curriculum course 10961, Automating Administration with Windows PowerShell 3.0, I have to type &lt;em&gt;Windows PowerShell&lt;/em&gt; every single time. I&amp;rsquo;ve actually been using &amp;ldquo;the shell&amp;rdquo; a lot, just to break things up a bit. We all casually refer to the shell as &lt;em&gt;PowerShell,&lt;/em&gt; but Microsoft never does. Their trademark is on &lt;em&gt;Windows&lt;/em&gt; PowerShell, and believe it or not someone has a trademark on &lt;em&gt;PowerShell.&lt;/em&gt; I think it&amp;rsquo;s a sporting equipment manufacturer.&lt;br&gt;
As I&amp;rsquo;m writing the course, I started using &lt;em&gt;Windows PowerShell&lt;/em&gt; on first reference, and then naturally - for me, at least - used just &lt;em&gt;PowerShell&lt;/em&gt; from then on. Nope. Had to go fix &amp;rsquo;em all.&lt;br&gt;
Weird, huh?&lt;br&gt;
I mean, technically&amp;hellip; legally&amp;hellip; you don&amp;rsquo;t trademark an entire word. You trademark it for use in a particular field. So it&amp;rsquo;s theoretically possible for Microsoft to own the trademark &lt;em&gt;PowerShell&lt;/em&gt; in the world of computer software, and another company to own the same trademark for making backpacks or ski boots or whatever. But&amp;hellip; I get it. You gotta be careful, and it&amp;rsquo;s easier just to not overlap with someone else&amp;rsquo;s trademark.&lt;br&gt;
Maybe they should have named it FrabulouShellâ„¢ instead, just to be really sure.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>Microsoft&rsquo;s a big company, and that makes it a big target for lawsuits. We all know that. But what doesn&rsquo;t always sink in is how careful the company has to be.<br>
For example, in Microsoft Official Curriculum course 10961, Automating Administration with Windows PowerShell 3.0, I have to type<em>Windows PowerShell</em> every single time. I&rsquo;ve actually been using &ldquo;the shell&rdquo; a lot, just to break things up a bit. We all casually refer to the shell as<em>PowerShell,</em> but Microsoft never does. Their trademark is on<em>Windows</em> PowerShell, and believe it or not someone has a trademark on<em>PowerShell.</em> I think it&rsquo;s a sporting equipment manufacturer.<br>
As I&rsquo;m writing the course, I started using<em>Windows PowerShell</em> on first reference, and then naturally - for me, at least - used just<em>PowerShell</em> from then on. Nope. Had to go fix &rsquo;em all.<br>
Weird, huh?<br>
I mean, technically&hellip; legally&hellip; you don&rsquo;t trademark an entire word. You trademark it for use in a particular field. So it&rsquo;s theoretically possible for Microsoft to own the trademark<em>PowerShell</em> in the world of computer software, and another company to own the same trademark for making backpacks or ski boots or whatever. But&hellip; I get it. You gotta be careful, and it&rsquo;s easier just to not overlap with someone else&rsquo;s trademark.<br>
Maybe they should have named it FrabulouShellâ„¢ instead, just to be really sure.</p>
]]></content:encoded></item><item><title>Displaying data from multiple servers as HTML</title><link>https://powershell.org/articles/2013-01-03-displaying-data-from-multiple-servers-as-html/</link><guid>https://powershell.org/articles/2013-01-03-displaying-data-from-multiple-servers-as-html/</guid><pubDate>Thu, 03 Jan 2013 19:12:53 +0000</pubDate><description>&lt;p&gt;A forum question regarding retrieving WMI based data from multiple servers and displaying it as HTML was interesting. I would approach it like this&lt;/p&gt;
&lt;p&gt;`$servers&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;Get-Content&lt;/p&gt;
&lt;p&gt;-Path&lt;/p&gt;
&lt;p&gt;C:\scripts\servers.txt&lt;/p&gt;
&lt;p&gt;$data&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;@(&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;foreach&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;$server&lt;/p&gt;
&lt;p&gt;in&lt;/p&gt;
&lt;p&gt;$servers&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;$compdata&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;New-Object&lt;/p&gt;
&lt;p&gt;-TypeName&lt;/p&gt;
&lt;p&gt;PSObject&lt;/p&gt;
&lt;p&gt;-Property&lt;/p&gt;
&lt;p&gt;@{&lt;/p&gt;
&lt;p&gt;Computer&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;$server&lt;/p&gt;
&lt;p&gt;Contactable&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;$false&lt;/p&gt;
&lt;p&gt;LastBootTime&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;&amp;quot;&amp;quot;&lt;/p&gt;
&lt;p&gt;AllowTSConnections&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;$false&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;if&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;Test-Connection&lt;/p&gt;
&lt;p&gt;-ComputerName&lt;/p&gt;
&lt;p&gt;$server&lt;/p&gt;
&lt;p&gt;-Quiet&lt;/p&gt;
&lt;p&gt;-Count&lt;/p&gt;
&lt;p&gt;1&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;$compdata&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;Contactable&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;$true&lt;/p&gt;
&lt;p&gt;$os&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;Get-WmiObject&lt;/p&gt;
&lt;p&gt;-Class&lt;/p&gt;
&lt;p&gt;Win32_OperatingSystem&lt;/p&gt;
&lt;p&gt;-ComputerName&lt;/p&gt;
&lt;p&gt;$server&lt;/p&gt;
&lt;p&gt;$compdata&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;LastBootTime&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;$os&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;ConvertToDateTime&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;$os&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;LastBootUpTime&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;$ts&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>A forum question regarding retrieving WMI based data from multiple servers and displaying it as HTML was interesting. I would approach it like this</p><p>`$servers</p><p>=</p><p>Get-Content</p><p>-Path</p><p>C:\scripts\servers.txt</p><p>$data</p><p>=</p><p>@(</p><p>)</p><p>foreach</p><p>(</p><p>$server</p><p>in</p><p>$servers</p><p>)</p><p>{</p><p>$compdata</p><p>=</p><p>New-Object</p><p>-TypeName</p><p>PSObject</p><p>-Property</p><p>@{</p><p>Computer</p><p>=</p><p>$server</p><p>Contactable</p><p>=</p><p>$false</p><p>LastBootTime</p><p>=</p><p>""</p><p>AllowTSConnections</p><p>=</p><p>$false</p><p>}</p><p>if</p><p>(</p><p>Test-Connection</p><p>-ComputerName</p><p>$server</p><p>-Quiet</p><p>-Count</p><p>1</p><p>)</p><p>{</p><p>$compdata</p><p>.</p><p>Contactable</p><p>=</p><p>$true</p><p>$os</p><p>=</p><p>Get-WmiObject</p><p>-Class</p><p>Win32_OperatingSystem</p><p>-ComputerName</p><p>$server</p><p>$compdata</p><p>.</p><p>LastBootTime</p><p>=</p><p>$os</p><p>.</p><p>ConvertToDateTime</p><p>(</p><p>$os</p><p>.</p><p>LastBootUpTime</p><p>)</p><p>$ts</p><p>=</p><p>Get-WmiObject</p><p>-Namespace</p><p>root\cimv2\terminalservices</p><p>-Class</p><p>Win32_TerminalServiceSetting</p><p>-ComputerName</p><p>$server</p><p>-Authentication</p><p>PacketPrivacy</p><p>if</p><p>(</p><p>$ts</p><p>.</p><p>AllowTSConnections</p><p>-eq</p><p>1</p><p>)</p><p>{</p><p>$compdata</p><p>.</p><p>AllowTSConnections</p><p>=</p><p>$true</p><p>}</p><p>}</p><p>$data</p><p>+=</p><p>$compdata</p><p>}</p><p>$data</p><p>$data</p><p>|</p><p>ConvertTo-Html</p><p>|</p><p>Out-File</p><p>-FilePath</p><p>c:\scripts\report.html</p><p>Invoke-Item</p><p>-Path</p><p>c:\scripts\report.html</p><p>`Put the list of servers in a text file &amp; read it in via get-content.</p><p>use foreach to iterate over the list of servers.</p><p>For each server create an object and then test if you can ping the server. Note that the default setting for Contactable is $false so don"™t need to deal with that case.</p><p>Get the WMI data and set the properties on the object.</p><p>Add the object to an array</p><p>After you"™ve hit all the servers use ConvertTo-Html and write to a file with out-file.</p><p>use Invoke-Item to view the report</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2780/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2780/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2780&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>Ensuring that parameter values are passed to your function</title><link>https://powershell.org/articles/2013-01-03-ensuring-that-parameter-values-are-passed-to-your-function/</link><guid>https://powershell.org/articles/2013-01-03-ensuring-that-parameter-values-are-passed-to-your-function/</guid><pubDate>Thu, 03 Jan 2013 18:46:59 +0000</pubDate><description>&lt;p&gt;A question on the forum about a function had me thinking. The user had defined two parameters for the function and then used Read-Host to get the values.&lt;/p&gt;
&lt;p&gt;NO&lt;/p&gt;
&lt;p&gt;Much better way is to use an advanced function and make the parameters mandatory&lt;/p&gt;
&lt;p&gt;`function&lt;/p&gt;
&lt;p&gt;Getuserdetails&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;[&lt;/p&gt;
&lt;p&gt;CmdletBinding&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;]&lt;/p&gt;
&lt;p&gt;param&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;[&lt;/p&gt;
&lt;p&gt;parameter&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;Mandatory&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;$true&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;]&lt;/p&gt;
&lt;p&gt;[string]&lt;/p&gt;
&lt;p&gt;$Givenname&lt;/p&gt;
&lt;p&gt;,&lt;/p&gt;
&lt;p&gt;[&lt;/p&gt;
&lt;p&gt;parameter&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;Mandatory&lt;/p&gt;
&lt;p&gt;=&lt;/p&gt;
&lt;p&gt;$true&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;]&lt;/p&gt;
&lt;p&gt;[string]&lt;/p&gt;
&lt;p&gt;$Surname&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;Get-ADUser&lt;/p&gt;
&lt;p&gt;-properties&lt;/p&gt;
&lt;p&gt;telephonenumber&lt;/p&gt;
&lt;p&gt;,&lt;/p&gt;
&lt;p&gt;office&lt;/p&gt;
&lt;p&gt;-Filter&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;GivenName&lt;/p&gt;
&lt;p&gt;-eq&lt;/p&gt;
&lt;p&gt;$Givenname&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;-and&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt;Surname&lt;/p&gt;
&lt;p&gt;-eq&lt;/p&gt;
&lt;p&gt;$Surname&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;`If you call the function and don&amp;quot;™t give values for the parameters you will be prompted for them&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>A question on the forum about a function had me thinking. The user had defined two parameters for the function and then used Read-Host to get the values.</p><p>NO</p><p>Much better way is to use an advanced function and make the parameters mandatory</p><p>`function</p><p>Getuserdetails</p><p>{</p><p>[</p><p>CmdletBinding</p><p>(</p><p>)</p><p>]</p><p>param</p><p>(</p><p>[</p><p>parameter</p><p>(</p><p>Mandatory</p><p>=</p><p>$true</p><p>)</p><p>]</p><p>[string]</p><p>$Givenname</p><p>,</p><p>[</p><p>parameter</p><p>(</p><p>Mandatory</p><p>=</p><p>$true</p><p>)</p><p>]</p><p>[string]</p><p>$Surname</p><p>)</p><p>Get-ADUser</p><p>-properties</p><p>telephonenumber</p><p>,</p><p>office</p><p>-Filter</p><p>{</p><p>(</p><p>GivenName</p><p>-eq</p><p>$Givenname</p><p>)</p><p>-and</p><p>(</p><p>Surname</p><p>-eq</p><p>$Surname</p><p>)</p><p>}</p><p>}</p><p>`If you call the function and don"™t give values for the parameters you will be prompted for them</p><p>The other point is the &ldquo;“Filter property on get-aduser. Don&rdquo;™t put quotes round the variable</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2779/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2779/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2779&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item><item><title>PowerShell workflow articles</title><link>https://powershell.org/articles/2013-01-03-powershell-workflow-articles/</link><guid>https://powershell.org/articles/2013-01-03-powershell-workflow-articles/</guid><pubDate>Thu, 03 Jan 2013 12:01:51 +0000</pubDate><description>&lt;p&gt;I&amp;quot;™ve written a series of articles on PowerShell workflows that are appearing on the Scripting Guy blog. The first two in the series have been published at:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx" title="http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx" title="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx"&gt;http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Enjoy&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2778/"&gt;&lt;img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2778/" alt=""&gt;&lt;/a&gt;&lt;img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;amp;blog=16267735&amp;amp;%23038;post=2778&amp;amp;%23038;subd=richardspowershellblog&amp;amp;%23038;ref=&amp;amp;%23038;feed=1" alt=""&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I"™ve written a series of articles on PowerShell workflows that are appearing on the Scripting Guy blog. The first two in the series have been published at:</p><p><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx" title="http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx</a></p><p><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx" title="http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx">http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx</a></p><p>Enjoy</p><p><a href="http://feeds.wordpress.com/1.0/gocomments/richardspowershellblog.wordpress.com/2778/"><img src="http://feeds.wordpress.com/1.0/comments/richardspowershellblog.wordpress.com/2778/" alt=""/><img src="http://stats.wordpress.com/b.gif?host=richardspowershellblog.wordpress.com&amp;blog=16267735&amp;%23038;post=2778&amp;%23038;subd=richardspowershellblog&amp;%23038;ref=&amp;%23038;feed=1" alt=""/>
]]></content:encoded></item></channel></rss>