<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Something About Scripting</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/stephap/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/stephap/feed.xml</link>
    <description />
    <lastBuildDate>Fri, 17 Apr 2015 00:45:19 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Building Forms with PowerShell – Part 1 (The Form)</title>
      <link>https://docs.microsoft.com/archive/blogs/stephap/building-forms-with-powershell-part-1-the-form</link>
      <pubDate>Mon, 23 Apr 2012 10:59:55 GMT</pubDate>
      <dc:creator><![CDATA[Stephanie Peters]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/stephap/2012/04/23/building-forms-with-powershell-part-1-the-form/</guid>
      <description><![CDATA[When I teach PowerShell workshops, I’m frequently asked if there are any good resources for learning...]]></description>
      <content:encoded><![CDATA[<p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-ansi-language: en" lang="EN"><font face="Calibri"><font style="font-size: 11pt" color="#000000">When I teach PowerShell workshops, I’m frequently asked if there are any good resources for learning about how to build forms in PowerShell. There are a number of good resources out there to be sure, but you can never have too many. This is my contribution to the education of the scripting masses. I’m going to start very simple, and over the next several posts, we’ll build up an advanced form repertoire.</font></font></span></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-ansi-language: en" lang="EN"><font face="Calibri"><font style="font-size: 11pt" color="#000000">This first post is about the form itself. The form is just a window on which we can put useful (or whatever) things to build a GUI. For the most part, the form is the easiest of the elements to work with, but you can get somewhat fancy with it. We’ll explore some different form scenarios.</font></font></span></p>  <h1 style="line-height: 16pt; list-style-type: disc; margin: 24pt 0in 0pt; clear: none"><font face="Cambria"><font style="font-size: 14pt" color="#365f91"><font style="font-weight: bold">The Simplest Form</font></font></font></h1>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-ansi-language: en" lang="EN"><font face="Calibri"><font style="font-size: 11pt" color="#000000">There are only three things required to launch a form from PowerShell: </font></font></span></p>  <p style="line-height: 13pt; list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpFirst"><font color="#000000"><span style="mso-ansi-language: en; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin" lang="EN"><span style="mso-list: ignore"><font face="Calibri"><font style="font-size: 11pt">1.</font></font><span style="line-height: normal; font-family: "><font face="Times New Roman"><font style="font-size: 7pt">&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></span><span style="mso-ansi-language: en" lang="EN"><font face="Calibri"><font style="font-size: 11pt">You must load the System.Windows.Forms assembly (if not already done); </font></font></span></font></p>  <p style="line-height: 13pt; list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpMiddle"><font color="#000000"><span style="mso-ansi-language: en; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin" lang="EN"><span style="mso-list: ignore"><font face="Calibri"><font style="font-size: 11pt">2.</font></font><span style="line-height: normal; font-family: "><font face="Times New Roman"><font style="font-size: 7pt">&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></span><span style="mso-ansi-language: en" lang="EN"><font face="Calibri"><font style="font-size: 11pt">You must create a new object of type system.windows.forms.form; and, </font></font></span></font></p>  <p style="line-height: 13pt; list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpLast"><font color="#000000"><span style="mso-ansi-language: en; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin" lang="EN"><span style="mso-list: ignore"><font face="Calibri"><font style="font-size: 11pt">3.</font></font><span style="line-height: normal; font-family: "><font face="Times New Roman"><font style="font-size: 7pt">&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></span><span style="mso-ansi-language: en" lang="EN"><font face="Calibri"><font style="font-size: 11pt">You must call the ShowDialog() method on your new object. Note—don’t try calling the Show() method, unless you want your script to hang. </font></font></span></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-ansi-language: en" lang="EN"><font face="Calibri"><font style="font-size: 11pt" color="#000000">For example:</font></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#0000ff"><font style="font-size: 9.5pt">Add-Type</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000080">-AssemblyName</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#8a2be2">System.Windows.Forms</font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#000000"> </font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">=</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#0000ff">New-Object</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#8a2be2">system.Windows.Forms.Form</font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#000000">ShowDialog() </font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"><font face="Times New Roman"><font style="font-size: 12pt" color="#000000">&#160;</font></font></span></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-ansi-language: en" lang="EN"><font face="Calibri"><font style="font-size: 11pt" color="#000000">Depending on your Windows shell environment, this is what your form might look like:</font></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" class="MsoNormal"><span style="mso-no-proof: yes"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/4478.clip_image001_0FE1765B.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/4478.clip_5F00_image001_5F00_0FE1765B.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image001" border="0" alt="clip_image001" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/2728.clip_image001_thumb_03DF8627.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/2728.clip_5F00_image001_5F00_thumb_5F00_03DF8627.png" width="300" height="300" /></a></span><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-ansi-language: en" lang="EN"><font face="Calibri"><font style="font-size: 11pt" color="#000000">Of course, that’s not terribly useful, so we’ll keep going.</font></font></span></p>  <h1 style="line-height: 16pt; list-style-type: disc; margin: 24pt 0in 0pt; clear: none"><span style="mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"><font face="Cambria"><font style="font-size: 14pt" color="#365f91"><font style="font-weight: bold">Adding Some Text</font></font></font></span></h1>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-ansi-language: en" lang="EN"><font face="Calibri"><font style="font-size: 11pt" color="#000000">Text will be helpful in adding some purpose to our form. There are a couple of pieces of text we’ll add. </font></font></span></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-ansi-language: en" lang="EN"><font face="Calibri"><font style="font-size: 11pt" color="#000000">First, let’s add a window title for the form by setting the form’s Text property. This will show up in the top of the form and will also serve as the window title as shown in the task bar.</font></font></span></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-ansi-language: en" lang="EN"><font face="Calibri"><font style="font-size: 11pt" color="#000000">Then we’ll add some text in the main window by adding a label control. In order to add a label, we need to create a new Label object, set the relevant properties and add it to the Controls collection of the form. For now, we’ll set only two properties—Text and AutoSize. Enabling AutoSize will ensure that our label is large enough to display all our text.</font></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#0000ff"><font style="font-size: 9.5pt">Add-Type</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000080">-AssemblyName</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#8a2be2">System.Windows.Forms</font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#000000"> </font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">=</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#0000ff">New-Object</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#8a2be2">system.Windows.Forms.Form</font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">.</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000">Text </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">=</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#8b0000">&quot;Sample Form&quot;</font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">=</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#0000ff">New-Object</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#8a2be2">System.Windows.Forms.Label</font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">.</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000">Text </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">=</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#8b0000">&quot;This form is very simple.&quot;</font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">.</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000">AutoSize </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">=</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#ff4500">$True</font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">.</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000">Controls</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">.</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000">Add(</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500">$Label</font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#000000">)</font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">.</font></span></font><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;; mso-shading-themecolor: background2" lang="EN"><font style="font-size: 9.5pt" color="#000000">ShowDialog()</font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; mso-layout-grid-align: none" class="MsoNormal"><span style="mso-no-proof: yes"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/2235.clip_image002_14E3B40A.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/2235.clip_5F00_image002_5F00_14E3B40A.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image002" border="0" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/4314.clip_image002_thumb_01C2875E.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/4314.clip_5F00_image002_5F00_thumb_5F00_01C2875E.png" width="300" height="300" /></a></span><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"><font face="Times New Roman"><font style="font-size: 12pt" color="#000000">&#160;</font></font></span></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-ansi-language: en" lang="EN"><font face="Calibri"><font style="font-size: 11pt" color="#000000">Note – Most forms will contain at least several controls. Usually there would be at least one button. We’ll add more controls later in this series, but for now we’ll just stick with a single label.</font></font></span></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-ansi-language: en" lang="EN"><font face="Calibri"><font style="font-size: 11pt" color="#000000">We might want to change the font used by the form. In order to change the font, we need to create a new font object with the appropriate properties and assign the new font object to the form’s Font property. </font></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#0000ff"><font style="font-size: 9.5pt">Add-Type</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000080">-AssemblyName</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#8a2be2">System.Windows.Forms</font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#000000"> </font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">=</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#0000ff">New-Object</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#8a2be2">system.Windows.Forms.Form</font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">.</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000">Text </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">=</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#8b0000">&quot;Sample Form&quot;</font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Font</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">=</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#0000ff">New-Object</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#8a2be2">System.Drawing.Font</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000">(</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#8b0000">&quot;Times New Roman&quot;</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">,</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#800080">18</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">,</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#008080">[System.Drawing.FontStyle]</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">::</font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#000000">Italic)</font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font face="Lucida Console"><font style="font-size: 9.5pt" color="#006400"># Font styles are: Regular, Bold, Italic, Underline, Strikeout</font></font></span><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">.</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000">Font </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">=</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#ff4500">$Font</font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">=</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#0000ff">New-Object</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#8a2be2">System.Windows.Forms.Label</font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">.</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000">Text </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">=</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#8b0000">&quot;This form is very simple.&quot;</font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">.</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000">AutoSize </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">=</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#ff4500">$True</font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">.</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000">Controls</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">.</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000">Add(</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500">$Label</font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#000000">)</font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">.</font></span></font><span style="background-image: none; background-attachment: scroll; background-repeat: repeat; font-family: ; background-position: 0% 0%; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;; mso-shading-themecolor: background2" lang="EN"><font style="font-size: 9.5pt" color="#000000">ShowDialog()</font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"><span style="mso-no-proof: yes"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/2251.clip_image003_40B407F9.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/2251.clip_5F00_image003_5F00_40B407F9.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image003" border="0" alt="clip_image003" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/5554.clip_image003_thumb_235EB02F.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/5554.clip_5F00_image003_5F00_thumb_5F00_235EB02F.png" width="300" height="300" /></a></span><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-ansi-language: en" lang="EN"><font face="Calibri"><font style="font-size: 11pt" color="#000000">&#160;</font></font></span></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-ansi-language: en" lang="EN"><font face="Calibri"><font style="font-size: 11pt" color="#000000">Now we have a bit of a problem because the text is too large to fit on the form in its default size. There are a few different ways we could address this:</font></font></span></p>  <p style="line-height: 13pt; list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 10pt 0.5in; mso-list: l1 level1 lfo3" class="MsoListParagraph"><font color="#000000"><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol" lang="EN"><span style="mso-list: ignore"><font face="Symbol"><font style="font-size: 11pt">·</font></font><span style="line-height: normal; font-family: "><font face="Times New Roman"><font style="font-size: 7pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></span><span style="mso-ansi-language: en" lang="EN"><font face="Calibri"><font style="font-size: 11pt">Specify a form size – we could set a particular height and width that would be large enough. This would work, but it’s somewhat difficult to figure out what the appropriate size should be. </font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt 0.5in; background: white; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">.</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000">Width </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">=</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#800080">500</font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 5pt 0.5in; background: white; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">.</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000">Height </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">=</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#800080">200 </font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 5pt 0.5in; background: white; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"><font face="Times New Roman"><font style="font-size: 12pt" color="#000000">&#160;</font></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 5pt 0.5in; background: white; mso-layout-grid-align: none" class="MsoNormal"><a style="cursor: auto" href="file:///C:\Users\stephap\AppData\Local\Temp\WindowsLiveWriter-429641856\supfiles2B1763D3\image17.png"><span style="font-family: ; color: ; text-decoration: ; mso-fareast-font-family: &#39;Times New Roman&#39;; text-underline: none; mso-no-proof: yes"><span style="mso-ignore: vglayout"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/4786.clip_image004_5DD9B003.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/4786.clip_5F00_image004_5F00_5DD9B003.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image004" border="0" alt="clip_image004" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/1830.clip_image004_thumb_4EC2D129.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/1830.clip_5F00_image004_5F00_thumb_5F00_4EC2D129.png" width="426" height="173" /></a></span></span></a><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: 13pt; list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 10pt 0.5in; mso-list: l2 level1 lfo2" class="MsoListParagraph"><font color="#000000"><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol" lang="EN"><span style="mso-list: ignore"><font face="Symbol"><font style="font-size: 11pt">·</font></font><span style="line-height: normal; font-family: "><font face="Times New Roman"><font style="font-size: 7pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></span><span style="mso-ansi-language: en" lang="EN"><font face="Calibri"><font style="font-size: 11pt">Enable scroll bars – By enabling AutoScroll, we allow the user to scroll over to see the remaining text. This is obviously not an optimum solution, but scroll bars are probably a good idea when necessary. </font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 5pt 0.5in; background: white; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">.</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000">AutoScroll </font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#a9a9a9">=</font></span><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font color="#000000"> </font></span></font><span style="font-family: ; color: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;; mso-bidi-font-family: &#39;Lucida Console&#39;" lang="EN"><font style="font-size: 9.5pt" color="#ff4500">$True </font></span></font><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 7.5pt 0.5in; background: white; mso-layout-grid-align: none" class="MsoNormal"><span style="mso-no-proof: yes"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/4061.clip_image005_6D994507.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/4061.clip_5F00_image005_5F00_6D994507.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image005" border="0" alt="clip_image005" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/4477.clip_image005_thumb_5A78185B.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/4477.clip_5F00_image005_5F00_thumb_5F00_5A78185B.png" width="300" height="300" /></a></span><span style="font-family: ; mso-ansi-language: en; mso-fareast-font-family: &#39;Times New Roman&#39;" lang="EN"></span></p>  <p style="line-height: 13pt; list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l2 level1 lfo2" class="MsoListParagraphCxSpFirst"><font color="#000000"><span style="font-family: ; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore"><font face="Symbol"><font style="font-size: 11pt">·</font></font><span style="line-height: normal; font-family: "><font face="Times New Roman"><font style="font-size: 7pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></span><font face="Calibri"><font style="font-size: 11pt">Enable AutoSize – This is a much better idea for our purposes.<span style="mso-spacerun: yes">&#160; </span>By enabling AutoSize on the form, it will automatically resize to accommodate whatever controls we add to it. </font></font></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 0pt 0.5in" class="MsoListParagraphCxSpMiddle"><font face="Calibri"><font style="font-size: 11pt" color="#000000">&#160;</font></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt 0.5in; background: white; text-autospace: ; mso-layout-grid-align: none; mso-add-space: auto" class="MsoListParagraphCxSpMiddle"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">AutoSize </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$True</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt 0.5in; background: white; text-autospace: ; mso-layout-grid-align: none; mso-add-space: auto" class="MsoListParagraphCxSpMiddle"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">AutoSizeMode </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;GrowAndShrink&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt 0.5in; background: white; text-autospace: ; mso-layout-grid-align: none; mso-add-space: auto" class="MsoListParagraphCxSpMiddle"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9.5pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9.5pt" color="#006400"># or GrowOnly </font></span></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt 0.5in; background: white; text-autospace: ; mso-layout-grid-align: none; mso-add-space: auto" class="MsoListParagraphCxSpLast"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><font style="font-size: 9.5pt" color="#006400">&#160;</font></font></span></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt 0.5in" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">However, you should know that enabling AutoSize in this way will prevent the user from manually resizing the form.<span style="mso-spacerun: yes">&#160; </span>The strategy you choose will depend on your specific requirements. </font></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">Here is the new form code:</font></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#0000ff"><font style="font-size: 9.5pt">Add-Type</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#000080">-AssemblyName</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">System.Windows.Forms</font></span><font color="#000000"> </font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">New-Object</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8a2be2">system.Windows.Forms.Form</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Text </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;Sample Form&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><font style="font-size: 9.5pt" color="#000000">&#160;</font></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#0000ff"><font style="font-size: 9.5pt">Form.AutoScroll</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$True</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">AutoSize </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$True</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">AutoSizeMode </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;GrowAndShrink&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9.5pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9.5pt" color="#006400"># or GrowOnly</font></span></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><font style="font-size: 9.5pt" color="#000000">&#160;</font></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#0000ff"><font style="font-size: 9.5pt">Font</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">New-Object</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">System.Drawing.Font</font></span><font color="#000000">(</font><span style="color: "><font color="#8b0000">&quot;Times New Roman&quot;</font></span><span style="color: "><font color="#a9a9a9">,</font></span><span style="color: "><font color="#800080">24</font></span><span style="color: "><font color="#a9a9a9">,</font></span><span style="color: "><font color="#008080">[System.Drawing.FontStyle]</font></span><span style="color: "><font color="#a9a9a9">::</font></span><font color="#000000">Italic)</font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9.5pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9.5pt" color="#006400"># Font styles are: Regular, Bold, Italic, Underline, Strikeout</font></span></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Font </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$Font</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">New-Object</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8a2be2">System.Windows.Forms.Label</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Text </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;This form is very simple.&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">AutoSize </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$True</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Controls</font><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">Add(</font><span style="color: "><font color="#ff4500">$Label</font></span><font color="#000000">)</font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt" color="#000000">ShowDialog() </font></span></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">&#160;</font></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-no-proof: yes"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/2313.clip_image006_4B613981.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/2313.clip_5F00_image006_5F00_4B613981.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image006" border="0" alt="clip_image006" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/5140.clip_image006_thumb_6384A3DC.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/5140.clip_5F00_image006_5F00_thumb_5F00_6384A3DC.png" width="355" height="81" /></a></span></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">It’s looking better.<span style="mso-spacerun: yes">&#160; </span>Now let’s keep going.</font></font></p>  <h1 style="line-height: 16pt; list-style-type: disc; margin: 24pt 0in 0pt; clear: none"><font face="Cambria"><font style="font-size: 14pt" color="#365f91"><font style="font-weight: bold">Window Settings</font></font></font></h1>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">There are a number of window settings we can customize for our form.<span style="mso-spacerun: yes">&#160; </span>Here we’ll experiment with the following:</font></font></p>  <p style="line-height: 13pt; list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l2 level1 lfo2" class="MsoListParagraphCxSpFirst"><font color="#000000"><span style="font-family: ; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore"><font face="Symbol"><font style="font-size: 11pt">·</font></font><span style="line-height: normal; font-family: "><font face="Times New Roman"><font style="font-size: 7pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></span><font face="Calibri"><font style="font-size: 11pt">Disabling the minimize and maximize functionality</font></font></font></p>  <p style="line-height: 13pt; list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l2 level1 lfo2" class="MsoListParagraphCxSpMiddle"><font color="#000000"><span style="font-family: ; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore"><font face="Symbol"><font style="font-size: 11pt">·</font></font><span style="line-height: normal; font-family: "><font face="Times New Roman"><font style="font-size: 7pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></span><font face="Calibri"><font style="font-size: 11pt">Setting the window state to normal (versus maximized or minimized)</font></font></font></p>  <p style="line-height: 13pt; list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l2 level1 lfo2" class="MsoListParagraphCxSpMiddle"><font color="#000000"><span style="font-family: ; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore"><font face="Symbol"><font style="font-size: 11pt">·</font></font><span style="line-height: normal; font-family: "><font face="Times New Roman"><font style="font-size: 7pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></span><font face="Calibri"><font style="font-size: 11pt">Hiding the size grip (usually in the lower right corner of the window)</font></font></font></p>  <p style="line-height: 13pt; list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l2 level1 lfo2" class="MsoListParagraphCxSpMiddle"><font color="#000000"><span style="font-family: ; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore"><font face="Symbol"><font style="font-size: 11pt">·</font></font><span style="line-height: normal; font-family: "><font face="Times New Roman"><font style="font-size: 7pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></span><font face="Calibri"><font style="font-size: 11pt">Setting the opacity to 70%, making the window partially transparent</font></font></font></p>  <p style="line-height: 13pt; list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 10pt 0.5in; mso-list: l2 level1 lfo2" class="MsoListParagraphCxSpLast"><font color="#000000"><span style="font-family: ; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore"><font face="Symbol"><font style="font-size: 11pt">·</font></font><span style="line-height: normal; font-family: "><font face="Times New Roman"><font style="font-size: 7pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></span><font face="Calibri"><font style="font-size: 11pt">Setting the window start position so that the window will open in the middle of the visible screen</font></font></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#0000ff"><font style="font-size: 9.5pt">Add-Type</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#000080">-AssemblyName</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">System.Windows.Forms</font></span><font color="#000000"> </font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">New-Object</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8a2be2">system.Windows.Forms.Form</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Text </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;Sample Form&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#0000ff"><font style="font-size: 9.5pt">Form.AutoScroll</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$True</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">AutoSize </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$True</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">AutoSizeMode </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;GrowAndShrink&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9.5pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9.5pt" color="#006400"># or GrowOnly</font></span></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><font style="font-size: 9.5pt" color="#000000">&#160;</font></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">MinimizeBox </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$False</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">MaximizeBox </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$False</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">WindowState </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;Normal&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9.5pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9.5pt" color="#006400"># Maximized, Minimized, Normal</font></span></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">SizeGripStyle </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;Hide&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9.5pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9.5pt" color="#006400"># Auto, Hide, Show</font></span></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">ShowInTaskbar </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$False</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Opacity </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#800080">0.7</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9.5pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9.5pt" color="#006400"># 1.0 is fully opaque; 0.0 is invisible</font></span></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">StartPosition </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;CenterScreen&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9.5pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9.5pt" color="#006400"># CenterScreen, Manual, WindowsDefaultLocation, WindowsDefaultBounds, CenterParent</font></span></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><font style="font-size: 9.5pt" color="#000000">&#160;</font></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#0000ff"><font style="font-size: 9.5pt">Font</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#8a2be2">=</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">New-Object</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">System.Drawing.Font</font></span><font color="#000000">(</font><span style="color: "><font color="#8b0000">&quot;Times New Roman&quot;</font></span><span style="color: "><font color="#a9a9a9">,</font></span><span style="color: "><font color="#800080">24</font></span><span style="color: "><font color="#a9a9a9">,</font></span><span style="color: "><font color="#008080">[System.Drawing.FontStyle]</font></span><span style="color: "><font color="#a9a9a9">::</font></span><font color="#000000">Italic)</font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9.5pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9.5pt" color="#006400"># Font styles are: Regular, Bold, Italic, Underline, Strikeout</font></span></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Font </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$Font</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">New-Object</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8a2be2">System.Windows.Forms.Label</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Text </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;This form is very simple.&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">AutoSize </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$True</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Controls</font><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">Add(</font><span style="color: "><font color="#ff4500">$Label</font></span><font color="#000000">)</font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt" color="#000000">ShowDialog() </font></span></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">&#160;</font></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-no-proof: yes"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/3487.clip_image007_5782B3A8.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/3487.clip_5F00_image007_5F00_5782B3A8.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image007" border="0" alt="clip_image007" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/5554.clip_image007_thumb_36230E0C.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/5554.clip_5F00_image007_5F00_thumb_5F00_36230E0C.png" width="355" height="81" /></a></span></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">Note – I’ve positioned this form over the well-known sample image penguins.jpg to demonstrate that the form is 30% transparent.</font></font></p>  <h1 style="line-height: 16pt; list-style-type: disc; margin: 24pt 0in 0pt; clear: none"><font face="Cambria"><font style="font-size: 14pt" color="#365f91"><font style="font-weight: bold">Visual Stimulation</font></font></font></h1>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">Note – for this section, we’ll revert the window settings changes we made to the form in the previous section.</font></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">There are a few things we can do to make our form pop visually.<span style="mso-spacerun: yes">&#160; </span>The easiest way to change the look and feed is to change the background color of the form.</font></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#0000ff"><font style="font-size: 9.5pt">Add-Type</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#000080">-AssemblyName</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">System.Windows.Forms</font></span><font color="#000000"> </font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">New-Object</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8a2be2">system.Windows.Forms.Form</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Text </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;Sample Form&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">AutoSize </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$True</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">AutoSizeMode </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;GrowAndShrink&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9.5pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9.5pt" color="#006400"># or GrowOnly</font></span></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><font style="font-size: 9.5pt" color="#000000">&#160;</font></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">BackColor </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;Lime&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9.5pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9.5pt" color="#006400"># color names are static properties of System.Drawing.Color</font></span></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9.5pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9.5pt" color="#006400"># you can also use ARGB values, such as &quot;#FFFFEBCD&quot;</font></span></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><font style="font-size: 9.5pt" color="#000000">&#160;</font></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Font</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">New-Object</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">System.Drawing.Font</font></span><font color="#000000">(</font><span style="color: "><font color="#8b0000">&quot;Times New Roman&quot;</font></span><span style="color: "><font color="#a9a9a9">,</font></span><span style="color: "><font color="#800080">24</font></span><span style="color: "><font color="#a9a9a9">,</font></span><span style="color: "><font color="#008080">[System.Drawing.FontStyle]</font></span><span style="color: "><font color="#a9a9a9">::</font></span><font color="#000000">Italic)</font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9.5pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9.5pt" color="#006400"># Font styles are: Regular, Bold, Italic, Underline, Strikeout</font></span></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Font </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$Font</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">New-Object</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8a2be2">System.Windows.Forms.Label</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Text </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;This form is very simple.&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">AutoSize </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$True</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Controls</font><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">Add(</font><span style="color: "><font color="#ff4500">$Label</font></span><font color="#000000">)</font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt" color="#000000">ShowDialog() </font></span></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">&#160;</font></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-no-proof: yes"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/7610.clip_image008_14C36870.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/7610.clip_5F00_image008_5F00_14C36870.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image008" border="0" alt="clip_image008" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/5037.clip_image008_thumb_2CE6D2CB.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/5037.clip_5F00_image008_5F00_thumb_5F00_2CE6D2CB.png" width="355" height="81" /></a></span></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">Hmmm, interesting, but maybe not quite what we were looking for.</font></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">Let’s try adding a visually pleasing background image for our form.<span style="mso-spacerun: yes">&#160; </span>In order to do that, we need to do the following:</font></font></p>  <p style="line-height: 13pt; list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l3 level1 lfo4" class="MsoListParagraphCxSpFirst"><font color="#000000"><span style="font-family: ; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore"><font face="Symbol"><font style="font-size: 11pt">·</font></font><span style="line-height: normal; font-family: "><font face="Times New Roman"><font style="font-size: 7pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></span><font face="Calibri"><font style="font-size: 11pt">Create a new system.drawing.image object from an image file (in this the sample picture “Oryx Antelope.jpg) and assign it to the BackgroundImage property of the form</font></font></font></p>  <p style="line-height: 13pt; list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l3 level1 lfo4" class="MsoListParagraphCxSpMiddle"><font color="#000000"><span style="font-family: ; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore"><font face="Symbol"><font style="font-size: 11pt">·</font></font><span style="line-height: normal; font-family: "><font face="Times New Roman"><font style="font-size: 7pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></span><font face="Calibri"><font style="font-size: 11pt">Set the BackgroundImageLayout to None (The default is Tile, which tiles the image across the form as many times as it will fit.)</font></font></font></p>  <p style="line-height: 13pt; list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l3 level1 lfo4" class="MsoListParagraphCxSpMiddle"><font color="#000000"><span style="font-family: ; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore"><font face="Symbol"><font style="font-size: 11pt">·</font></font><span style="line-height: normal; font-family: "><font face="Times New Roman"><font style="font-size: 7pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></span><font face="Calibri"><font style="font-size: 11pt">Remove the AutoSize feature from the form and instead set the size of the form to mage the image dimensions.</font></font></font></p>  <p style="line-height: 13pt; list-style-type: disc; text-indent: -0.25in; margin: 0in 0in 10pt 0.5in; mso-list: l3 level1 lfo4" class="MsoListParagraphCxSpLast"><font color="#000000"><span style="font-family: ; mso-fareast-font-family: symbol; mso-bidi-font-family: symbol"><span style="mso-list: ignore"><font face="Symbol"><font style="font-size: 11pt">·</font></font><span style="line-height: normal; font-family: "><font face="Times New Roman"><font style="font-size: 7pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></span><font face="Calibri"><font style="font-size: 11pt">Configure the label so that it’s background is transparent, so as not to obstruct the picture</font></font></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#0000ff"><font style="font-size: 9.5pt">Add-Type</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#000080">-AssemblyName</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">System.Windows.Forms</font></span><font color="#000000"> </font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">New-Object</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8a2be2">system.Windows.Forms.Form</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Text </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;Sample Form&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><font style="font-size: 9.5pt" color="#000000">&#160;</font></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Image</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#008080">[system.drawing.image]</font></span><span style="color: "><font color="#a9a9a9">::</font></span><font color="#000000">FromFile(</font><span style="color: "><font color="#8b0000">&quot;$($Env:Public)\Pictures\Sample Pictures\Oryx Antelope.jpg&quot;</font></span><font color="#000000">)</font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">BackgroundImage </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$Image</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">BackgroundImageLayout </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;None&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9.5pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9.5pt" color="#006400"># None, Tile, Center, Stretch, Zoom</font></span></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><font style="font-size: 9.5pt" color="#000000">&#160;</font></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Width </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$Image</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">Width</font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Height </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$Image</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">Height</font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><font style="font-size: 9.5pt" color="#000000">&#160;</font></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Font</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">New-Object</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">System.Drawing.Font</font></span><font color="#000000">(</font><span style="color: "><font color="#8b0000">&quot;Times New Roman&quot;</font></span><span style="color: "><font color="#a9a9a9">,</font></span><span style="color: "><font color="#800080">24</font></span><span style="color: "><font color="#a9a9a9">,</font></span><span style="color: "><font color="#008080">[System.Drawing.FontStyle]</font></span><span style="color: "><font color="#a9a9a9">::</font></span><font color="#000000">Italic)</font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9.5pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9.5pt" color="#006400"># Font styles are: Regular, Bold, Italic, Underline, Strikeout</font></span></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Font </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$Font</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">New-Object</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8a2be2">System.Windows.Forms.Label</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Text </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;This form is very simple.&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><font style="font-size: 9.5pt" color="#000000">&#160;</font></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">BackColor </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;Transparent&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><font style="font-size: 9.5pt" color="#000000">&#160;</font></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">AutoSize </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$True</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Controls</font><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">Add(</font><span style="color: "><font color="#ff4500">$Label</font></span><font color="#000000">)</font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt" color="#000000">ShowDialog() </font></span></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">&#160;</font></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-no-proof: yes"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/8171.clip_image010_0BF36024.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/8171.clip_5F00_image010_5F00_0BF36024.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image010" border="0" alt="clip_image010" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/2620.clip_image010_thumb_2AC9D402.jpg" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/2620.clip_5F00_image010_5F00_thumb_5F00_2AC9D402.jpg" width="624" height="468" /></a></span></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">Very nice.</font></font></p>  <h1 style="line-height: 16pt; list-style-type: disc; margin: 24pt 0in 0pt; clear: none"><font face="Cambria"><font style="font-size: 14pt" color="#365f91"><font style="font-weight: bold">Finishing Touch</font></font></font></h1>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font color="#000000" face="Calibri"><font style="font-size: 11pt">One last thing we can do to refine our form is to add a customized icon.<span style="mso-spacerun: yes">&#160; </span>We can load an icon from an image file (in this case GRAPH.ICO which is part of Office).<span style="mso-spacerun: yes">&#160; </span>A good resource for creating custom icon files is </font></font><font style="font-size: 11pt"><a style="cursor: auto" href="http://www.xiconeditor.com/"><font color="#0000ff" face="Calibri"><u>http://www.xiconeditor.com/</u></font></a></font><font face="Calibri"><font color="#000000"><font style="font-size: 11pt">.</font><span style="mso-spacerun: yes"><font style="font-size: 11pt">&#160; </font></span></font></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Icon</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">New-Object</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">system.drawing.icon</font></span><font color="#000000"> (</font><span style="color: "><font color="#8b0000">&quot;C:\Program Files\Microsoft Office\Office14\GRAPH.ICO&quot;</font></span><font color="#000000">)</font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Icon </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$Icon </font></span></span></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">&#160;</font></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-no-proof: yes"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/1738.clip_image011_34AEC56D.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/1738.clip_5F00_image011_5F00_34AEC56D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image011" border="0" alt="clip_image011" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/5432.clip_image011_thumb_1276B9E7.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/5432.clip_5F00_image011_5F00_thumb_5F00_1276B9E7.png" width="470" height="250" /></a></span></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">Alternatively, we can extract an icon from an associated file, such as PowerShell.exe.</font></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#0000ff"><font style="font-size: 9.5pt">Add-Type</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#000080">-AssemblyName</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">System.Windows.Forms</font></span><font color="#000000"> </font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">New-Object</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8a2be2">system.Windows.Forms.Form</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Text </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;Sample Form&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><font style="font-size: 9.5pt" color="#000000">&#160;</font></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Icon</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#008080">[system.drawing.icon]</font></span><span style="color: "><font color="#a9a9a9">::</font></span><font color="#000000">ExtractAssociatedIcon(</font><span style="color: "><font color="#ff4500">$PSHOME</font></span><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">+</font></span><font color="#000000"> </font><span style="color: "><font color="#8b0000">&quot;\powershell.exe&quot;</font></span><font color="#000000">)</font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Icon </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$Icon</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: white; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><font style="font-size: 9.5pt" color="#000000">&#160;</font></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Image</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#008080">[system.drawing.image]</font></span><span style="color: "><font color="#a9a9a9">::</font></span><font color="#000000">FromFile(</font><span style="color: "><font color="#8b0000">&quot;$($Env:Public)\Pictures\Sample Pictures\Oryx Antelope.jpg&quot;</font></span><font color="#000000">)</font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">BackgroundImage </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$Image</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">BackgroundImageLayout </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;None&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9.5pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9.5pt" color="#006400"># None, Tile, Center, Stretch, Zoom</font></span></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Width </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$Image</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">Width</font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Height </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#ff4500">$Image</font></span><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">Height</font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Font</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">New-Object</font></span><font color="#000000"> </font><span style="color: "><font color="#8a2be2">System.Drawing.Font</font></span><font color="#000000">(</font><span style="color: "><font color="#8b0000">&quot;Times New Roman&quot;</font></span><span style="color: "><font color="#a9a9a9">,</font></span><span style="color: "><font color="#800080">24</font></span><span style="color: "><font color="#a9a9a9">,</font></span><span style="color: "><font color="#008080">[System.Drawing.FontStyle]</font></span><span style="color: "><font color="#a9a9a9">::</font></span><font color="#000000">Italic)</font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font face="Lucida Console"><span style="mso-spacerun: yes"><font color="#000000"><font style="font-size: 9.5pt">&#160;&#160;&#160; </font></font></span><span style="color: "><font style="font-size: 9.5pt" color="#006400"># Font styles are: Regular, Bold, Italic, Underline, Strikeout</font></span></font></span></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Font </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$Font</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000"> </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font><span style="color: "><font color="#0000ff">New-Object</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8a2be2">System.Windows.Forms.Label</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Text </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;This form is very simple.&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">BackColor </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#8b0000">&quot;Transparent&quot;</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Label</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">AutoSize </font><span style="color: "><font color="#a9a9a9">=</font></span><font color="#000000"> </font></font><span style="color: "><font style="font-size: 9.5pt" color="#ff4500">$True</font></span></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt"><font color="#000000">Controls</font><span style="color: "><font color="#a9a9a9">.</font></span><font color="#000000">Add(</font><span style="color: "><font color="#ff4500">$Label</font></span><font color="#000000">)</font></font></span></font></p>  <p style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; background: #eeece1; text-autospace: ; mso-layout-grid-align: none; mso-background-themecolor: background2" class="MsoNormal"><font face="Lucida Console"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#ff4500"><font style="font-size: 9.5pt">$Form</font></font></span><font style="font-size: 9.5pt"><span style="font-family: ; color: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font color="#a9a9a9">.</font></span></font><span style="font-family: ; mso-bidi-font-family: &#39;Lucida Console&#39;"><font style="font-size: 9.5pt" color="#000000">ShowDialog() </font></span></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">&#160;</font></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">&#160;</font></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><span style="mso-no-proof: yes"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/7178.clip_image012_3727D15E.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/7178.clip_5F00_image012_5F00_3727D15E.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image012" border="0" alt="clip_image012" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/75/92/metablogapi/4530.clip_image012_thumb_544D7968.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-75-92-metablogapi/4530.clip_5F00_image012_5F00_thumb_5F00_544D7968.png" width="470" height="349" /></a></span></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font color="#000000"><font style="font-size: 11pt">Beautiful.</font><span style="mso-spacerun: yes"><font style="font-size: 11pt">&#160; </font></span></font></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font color="#000000" face="Calibri"><font style="font-size: 11pt">So we’ve seen most of the commonly used functionality of Windows Forms.<span style="mso-spacerun: yes">&#160; </span>For more esoteric customization, start with </font></font><font style="font-size: 11pt"><a style="cursor: auto" href="http://msdn.microsoft.com/en-us/library/system.windows.forms.form.aspx"><font color="#0000ff" face="Calibri"><u>http://msdn.microsoft.com/en-us/library/system.windows.forms.form.aspx</u></font></a></font><font face="Calibri"><font style="font-size: 11pt" color="#000000">. </font></font></p>  <p style="line-height: 13pt; list-style-type: disc; margin: 0in 0in 10pt" class="MsoNormal"><font face="Calibri"><font style="font-size: 11pt" color="#000000">Stay tuned for the next part in this series, which will dive into form controls.</font></font></p>]]></content:encoded>
    </item>
    <item>
      <title>Getting Monitor Hardware Information</title>
      <link>https://docs.microsoft.com/archive/blogs/stephap/getting-monitor-hardware-information</link>
      <pubDate>Tue, 17 Apr 2012 10:14:26 GMT</pubDate>
      <dc:creator><![CDATA[Stephanie Peters]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/stephap/2012/04/17/getting-monitor-hardware-information/</guid>
      <description><![CDATA[Ok, so I forgot how to post to this blog for a couple of years.&#160; I finally had a reason to...]]></description>
      <content:encoded><![CDATA[<p>Ok, so I forgot how to post to this blog for a couple of years.&#160; I finally had a reason to track it down.</p>  <p>First, I’d like to acknowledge an unknown scripter who created this script.&#160; I tried to track down the original&#160; author of the VBScript I started with.&#160; This particular script is posted on a variety of forums with a number of edits along the way—presumably added by multiple people, and I was unable to locate the original source, but to this unknown person, thank you.</p>  <p>Now, I took this quite complex script which collects EDID information from the registry.&#160; I converted it to PowerShell.&#160; Like most VBScript to PowerShell conversions, the new script is greatly less complicated and more readable.</p>  <p>This script utilizes PowerShell Remoting (<a title="http://technet.microsoft.com/en-us/library/dd347744.aspx" href="http://technet.microsoft.com/en-us/library/dd347744.aspx">http://technet.microsoft.com/en-us/library/dd347744.aspx</a>) if a computer list is supplied on the pipeline, so you would need to make sure that you have configured PowerShell for remoting.&#160; If you don’t supply a computer list, the script block will be executed on the local computer.</p>  <p>There is an optional LogPath parameter.&#160; You would run it as follows:</p>  <ul>   <li>.\Get-MonitorInfo.ps1</li>    <li>&quot;computer1&quot;,&quot;computer2&quot;,&quot;computer3&quot; | .\Get-MonitorInfo.ps1 -LogPath     <br />.\monitorlist.csv</li> </ul>  <p>&#160;</p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 10pt">Param</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#000000"> ([</font></span><span style="font-family: ; color: "><font color="#008080">string</font></span><span style="font-family: ; color: "><font color="#000000">] </font></span><span style="font-family: ; color: "><font color="#800080">$LogPath</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">)</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#800080"><font style="font-size: 10pt">$ComputerList</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> @()</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font style="font-size: 10pt" color="#008000"># Computer names should be piped into the script (comma separated)</font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#800080"><font style="font-size: 10pt">$input</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#000000"> | </font></span><b><span style="font-family: ; color: "><font color="#5f9ea0">ForEach-Object</font></span></b><span style="font-family: ; color: "><font color="#000000"> {</font></span><span style="font-family: ; color: "><font color="#800080">$ComputerList</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">+=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$_</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">}</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font style="font-size: 10pt" color="#000000">&#160;</font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#0000ff"><font style="font-size: 10pt">Function</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#5f9ea0">Main</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> {</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#0000ff">If</font></span><span style="font-family: ; color: "><font color="#000000"> (</font></span><span style="font-family: ; color: "><font color="#800080">$ComputerList</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">){</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># If a list of computers was specified on the pipeline, execute </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># the scriptblock remotely against all in a single job</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$Job</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><b><span style="font-family: ; color: "><font color="#5f9ea0">Invoke-Command</font></span></b><span style="font-family: ; color: "><font color="#000000"> </font></span><i><span style="font-family: ; color: "><font color="#5f9ea0">-ScriptBlock</font></span></i><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$ScriptBlock</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><i><span style="font-family: ; color: "><font color="#5f9ea0">-AsJob</font></span></i><span style="font-family: ; color: "><font color="#000000"> </font></span></font><b><span style="font-family: ; color: "><font style="font-size: 10pt" color="#5f9ea0">`</font></span></b></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><i><span style="font-family: ; color: "><font color="#5f9ea0">-JobName</font></span></i><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800000">EDIDInfo</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><i><span style="font-family: ; color: "><font color="#5f9ea0">-ComputerName</font></span></i><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$ComputerList</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># Wait for the job to complete</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><b><span style="font-family: ; color: "><font color="#5f9ea0">Wait-Job</font></span></b><span style="font-family: ; color: "><font color="#000000"> </font></span><i><span style="font-family: ; color: "><font color="#5f9ea0">-Job</font></span></i><span style="font-family: ; color: "><font color="#000000"> </font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#800080">$Job</font></span></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># Receive data from the job</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$Data</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><b><span style="font-family: ; color: "><font color="#5f9ea0">Receive-Job</font></span></b><span style="font-family: ; color: "><font color="#000000"> </font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#800080">$Job</font></span></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># Once we have received the data, we can remove the job</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><b><span style="font-family: ; color: "><font color="#5f9ea0">Remove-Job</font></span></b><span style="font-family: ; color: "><font color="#000000"> </font></span><i><span style="font-family: ; color: "><font color="#5f9ea0">-Job</font></span></i><span style="font-family: ; color: "><font color="#000000"> </font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#800080">$Job</font></span></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">} </font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#0000ff">Else</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> {</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font color="#008000"><font style="font-size: 10pt"># If a computer list was not specified, we don't need a job.</font><span style="mso-spacerun: yes"><font style="font-size: 10pt">&#160; </font></span></font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># We can get the data directly by running the scriptblock</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><b><span style="font-family: ; color: "><font color="#5f9ea0">Write-Warning</font></span></b><span style="font-family: ; color: "><font color="#000000"> (</font></span><span style="font-family: ; color: "><font color="#800000">&quot;A computer list was not specified.<span style="mso-spacerun: yes">&#160; </span>The script &quot;</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span></font><b><span style="font-family: ; color: "><font style="font-size: 10pt" color="#5f9ea0">`</font></span></b></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#ff0000">+</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800000">&quot;will run against the local computer.&quot;</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">)</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$Data</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> (&amp; </font></span><span style="font-family: ; color: "><font color="#800080">$ScriptBlock</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">)</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">}</font></font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#0000ff">If</font></span><span style="font-family: ; color: "><font color="#000000"> (</font></span><span style="font-family: ; color: "><font color="#800080">$LogPath</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">){</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># If a log path was specified (using the -LogPath parameter), </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># export the data to it.</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$Data</font></span><span style="font-family: ; color: "><font color="#000000"> | </font></span><b><span style="font-family: ; color: "><font color="#5f9ea0">Export-Csv</font></span></b><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$LogPath</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span></font><i><span style="font-family: ; color: "><font style="font-size: 10pt" color="#5f9ea0">-NoTypeInformation</font></span></i></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">}</font></font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># Display the collected data in the default host (usually the console)</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$Data</font></span><span style="font-family: ; color: "><font color="#000000"> | </font></span><b><span style="font-family: ; color: "><font color="#5f9ea0">Format-Table</font></span></b><span style="font-family: ; color: "><font color="#000000"> PSComputerName,VendorID,ModelName,DeviceID </font></span></font><b><span style="font-family: ; color: "><font style="font-size: 10pt" color="#5f9ea0">`</font></span></b></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font color="#000000"><span style="mso-tab-count: 2"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">,SerialNumber,ManufactureDate,EDIDVersion</font></font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font style="font-size: 10pt" color="#000000">}</font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font style="font-size: 10pt" color="#000000">&#160;</font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font style="font-size: 10pt" color="#000000">&#160;</font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#800080"><font style="font-size: 10pt">$ScriptBlock</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> {</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># This script block will always run locally on the target</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># $EDIDByteArrays will hold all of the collected EDID values from the </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># registry.</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$EDIDByteArrays</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> @()</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font style="font-size: 10pt" color="#000000">&#160;</font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># $KeysWithControl will contain the path to the key for each display </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># device whose &quot;Control&quot; subkey has an ActiveService value--meaning </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># that the device is currently being used.</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$KeysWithControl</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> (</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><b><span style="font-family: ; color: "><font color="#5f9ea0">dir</font></span></b><span style="font-family: ; color: "><font color="#000000"> HKLM:\</font></span><span style="font-family: ; color: "><font color="#800000">system\currentcontrolset\enum\display</font></span><span style="font-family: ; color: "><font color="#000000">\*\*\control\ </font></span></font><b><span style="font-family: ; color: "><font style="font-size: 10pt" color="#5f9ea0">`</font></span></b></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 2"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">| </font></font></span><font style="font-size: 10pt"><b><span style="font-family: ; color: "><font color="#5f9ea0">ForEach-Object</font></span></b></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">{</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$_</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">.PsParentPath</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font color="#000000"><span style="mso-tab-count: 2"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">}</font></font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">)</font></font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font face="Courier New"><font style="font-size: 10pt" color="#000000">&#160;&#160;&#160;&#160;&#160; </font></font></span></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$KeysWithControl</font></span><span style="font-family: ; color: "><font color="#000000"> | </font></span><b><span style="font-family: ; color: "><font color="#5f9ea0">ForEach-Object</font></span></b></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">{</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># Enumerate the &quot;Device Parameters&quot; subkey for each key </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># identified above</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><b><span style="font-family: ; color: "><font color="#5f9ea0">dir</font></span></b><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800000">&quot;$($_)\device parameters*&quot;</font></span><span style="font-family: ; color: "><font color="#000000"> | </font></span><b><span style="font-family: ; color: "><font color="#5f9ea0">ForEach-Object</font></span></b></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> {</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># The &quot;EDID&quot; value of the &quot;Device Parameters&quot; key contains </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># the EDID data (byte array)</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$EDIDByteArray</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$_</font></span><span style="font-family: ; color: "><font color="#000000">.GetValue(</font></span><span style="font-family: ; color: "><font color="#800000">&quot;EDID&quot;</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">)</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># Add the current value to $EDIDByteArrays</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># Since the value we're adding is a byte array and don't want </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># to append it to the current array, we need to add a new </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># element first and then assign the whole value to the new element</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$EDIDByteArrays</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">+=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#800000">&quot;&quot;</font></span></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$EDIDByteArrays</font></span><span style="font-family: ; color: "><font color="#000000">[(</font></span><span style="font-family: ; color: "><font color="#800080">$EDIDByteArrays</font></span><span style="font-family: ; color: "><font color="#000000">.GetUpperBound(0))] </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$EDIDByteArray</font></span></font><span style="font-family: ; color: "><font color="#000000"><font style="font-size: 10pt"><span style="mso-tab-count: 1">&#160;&#160;&#160; </span></font><span style="mso-tab-count: 3"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span></font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font color="#000000"><span style="mso-tab-count: 2"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">}</font></font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">}</font></font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font face="Courier New"><font style="font-size: 10pt" color="#000000">&#160;&#160;&#160;&#160;&#160; </font></font></span></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># Now we will parse each EDID value.<span style="mso-spacerun: yes">&#160; </span>For information about the data structure, </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># see http://en.wikipedia.org/wiki/Extended_display_identification_data</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font face="Courier New"><font style="font-size: 10pt" color="#000000">&#160;&#160;&#160;&#160;&#160; </font></font></span></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># $Descriptors will contain the four prescribed descriptors</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$Descriptors</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> @(</font></span><span style="font-family: ; color: "><font color="#800000">&quot;&quot;</font></span><span style="font-family: ; color: "><font color="#000000">,</font></span><span style="font-family: ; color: "><font color="#800000">&quot;&quot;</font></span><span style="font-family: ; color: "><font color="#000000">,</font></span><span style="font-family: ; color: "><font color="#800000">&quot;&quot;</font></span><span style="font-family: ; color: "><font color="#000000">,</font></span><span style="font-family: ; color: "><font color="#800000">&quot;&quot;</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">)</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># A serial number descriptor starts with:<span style="mso-tab-count: 1"> </span>00 00 00 ff</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">[</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#008080">Object</font></span><span style="font-family: ; color: "><font color="#000000">[]] </font></span><span style="font-family: ; color: "><font color="#800080">$SerialNumberHeader</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> ([</font></span><span style="font-family: ; color: "><font color="#008080">byte</font></span><span style="font-family: ; color: "><font color="#000000">]0x00,[</font></span><span style="font-family: ; color: "><font color="#008080">byte</font></span><span style="font-family: ; color: "><font color="#000000">]0x00,[</font></span><span style="font-family: ; color: "><font color="#008080">byte</font></span><span style="font-family: ; color: "><font color="#000000">]0x00,[</font></span><span style="font-family: ; color: "><font color="#008080">byte</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">]0xFF)</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># A model name descriptor starts with:<span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>00 00 00 fc</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">[</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#008080">Object</font></span><span style="font-family: ; color: "><font color="#000000">[]] </font></span><span style="font-family: ; color: "><font color="#800080">$ModelNameHeader</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> ([</font></span><span style="font-family: ; color: "><font color="#008080">byte</font></span><span style="font-family: ; color: "><font color="#000000">]0x00,[</font></span><span style="font-family: ; color: "><font color="#008080">byte</font></span><span style="font-family: ; color: "><font color="#000000">]0x00,[</font></span><span style="font-family: ; color: "><font color="#008080">byte</font></span><span style="font-family: ; color: "><font color="#000000">]0x00,[</font></span><span style="font-family: ; color: "><font color="#008080">byte</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">]0xFC)</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font face="Courier New"><font style="font-size: 10pt" color="#000000">&#160;&#160;&#160;&#160;&#160; </font></font></span></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 1"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$EDIDByteArrays</font></span><span style="font-family: ; color: "><font color="#000000"> | </font></span><b><span style="font-family: ; color: "><font color="#5f9ea0">Foreach-Object</font></span></b></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> {</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt"><span style="mso-spacerun: yes">&#160;&#160;&#160; </span></font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$EDIDValue</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#800080">$_</font></span></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 2"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># If this is a valid EDID value...</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt"><span style="mso-spacerun: yes">&#160;&#160;&#160; </span></font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#0000ff">If</font></span><span style="font-family: ; color: "><font color="#000000">(</font></span><span style="font-family: ; color: "><font color="#800080">$EDIDValue</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">){</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># Populate the four descriptors with each subset of bytes</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$Descriptors</font></span><span style="font-family: ; color: "><font color="#000000">[0] </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$EDIDValue</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">[54..71] </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$Descriptors</font></span><span style="font-family: ; color: "><font color="#000000">[1] </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$EDIDValue</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">[72..89] </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$Descriptors</font></span><span style="font-family: ; color: "><font color="#000000">[2] </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$EDIDValue</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">[90..107] </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$Descriptors</font></span><span style="font-family: ; color: "><font color="#000000">[3] </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$EDIDValue</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">[108..125] </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt"><span style="mso-spacerun: yes">&#160;&#160;&#160; </span><span style="mso-tab-count: 1">&#160; </span></font></font></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># Initialize Values to &quot;Not Found&quot;</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$SerialNumber</font></span><span style="font-family: ; color: "><font color="#000000"> <span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#800000">&quot;Not Found&quot;</font></span></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$ModelName</font></span><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#800000">&quot;Not Found&quot;</font></span></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$ManufacturerID</font></span><span style="font-family: ; color: "><font color="#000000"> <span style="mso-tab-count: 1">&#160; </span></font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#800000">&quot;Not Found&quot;</font></span></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$DeviceID</font></span><span style="font-family: ; color: "><font color="#000000"> <span style="mso-tab-count: 3">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#800000">&quot;Not Found&quot;</font></span></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$ManufactureDate</font></span><span style="font-family: ; color: "><font color="#000000"> <span style="mso-tab-count: 1"></span></font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#800000">&quot;Not Found&quot;</font></span></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$EDIDVersion</font></span><span style="font-family: ; color: "><font color="#000000"> <span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#800000">&quot;Not Found&quot;</font></span></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font face="Courier New"><font style="font-size: 10pt" color="#000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$Descriptors</font></span><span style="font-family: ; color: "><font color="#000000"> | </font></span><b><span style="font-family: ; color: "><font color="#5f9ea0">ForEach-Object</font></span></b></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> {</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 4"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># Get the header of the current descriptor to determin if it </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 4"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># is a model name or serial number. These are two of several </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 4"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># types of optional descriptors, and they may be in any order</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 4"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># If the header is a match, the value will be at offset 5</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 4"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$DescriptorHeader</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$_</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">[0..3]</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 4"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#0000ff">If</font></span><span style="font-family: ; color: "><font color="#000000">((</font></span><span style="font-family: ; color: "><font color="#800080">$DescriptorHeader</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">-join</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800000">&quot; &quot;</font></span><span style="font-family: ; color: "><font color="#000000">) </font></span><span style="font-family: ; color: "><font color="#ff0000">-eq</font></span><span style="font-family: ; color: "><font color="#000000"> (</font></span><span style="font-family: ; color: "><font color="#800080">$SerialNumberHeader</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">-join</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800000">&quot; &quot;</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">)){</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 5"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$SerialNumber</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 6"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">[</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#008080">System.Text.Encoding</font></span><span style="font-family: ; color: "><font color="#000000">]::</font></span><span style="font-family: ; color: "><font color="#8b4513">ASCII</font></span><span style="font-family: ; color: "><font color="#000000">.</font></span><span style="font-family: ; color: "><font color="#8b4513">GetString</font></span><span style="font-family: ; color: "><font color="#000000">(</font></span><span style="font-family: ; color: "><font color="#800080">$_</font></span><span style="font-family: ; color: "><font color="#000000">[5..17]).</font></span><span style="font-family: ; color: "><font color="#8b4513">Trim</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">()</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font color="#000000"><span style="mso-tab-count: 4"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">}</font></font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 4"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#0000ff">If</font></span><span style="font-family: ; color: "><font color="#000000">((</font></span><span style="font-family: ; color: "><font color="#800080">$DescriptorHeader</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">-join</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800000">&quot; &quot;</font></span><span style="font-family: ; color: "><font color="#000000">) </font></span><span style="font-family: ; color: "><font color="#ff0000">-eq</font></span><span style="font-family: ; color: "><font color="#000000"> (</font></span><span style="font-family: ; color: "><font color="#800080">$ModelNameHeader</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">-join</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800000">&quot; &quot;</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">)){</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 5"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$ModelName</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 6"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">[</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#008080">System.Text.Encoding</font></span><span style="font-family: ; color: "><font color="#000000">]::</font></span><span style="font-family: ; color: "><font color="#8b4513">ASCII</font></span><span style="font-family: ; color: "><font color="#000000">.</font></span><span style="font-family: ; color: "><font color="#8b4513">GetString</font></span><span style="font-family: ; color: "><font color="#000000">(</font></span><span style="font-family: ; color: "><font color="#800080">$_</font></span><span style="font-family: ; color: "><font color="#000000">[5..17]).</font></span><span style="font-family: ; color: "><font color="#8b4513">Trim</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">()</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font color="#000000"><span style="mso-tab-count: 4"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">}</font></font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font color="#000000"><span style="mso-tab-count: 3"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">}</font></font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font face="Courier New"><font style="font-size: 10pt" color="#000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font color="#008000"><font style="font-size: 10pt"># The manufacture date is stored as follows: Week is byte 16.</font><span style="mso-spacerun: yes"><font style="font-size: 10pt">&#160; </font></span></font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># Year (as offset from 1990) is byte 17.</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$ManufactureWeek</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$EDIDValue</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">[16]</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$ManufactureYear</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> 1990 </font></span><span style="font-family: ; color: "><font color="#ff0000">+</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$EDIDValue</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">[17]</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># Format &quot;MM/yyyy&quot;</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$ManufactureDate</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> (</font></span><b><span style="font-family: ; color: "><font color="#5f9ea0">get-date</font></span></b><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800000">&quot;1/1/$($ManufactureYear)&quot;</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">).AddDays(</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 4"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">7 </font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#ff0000">*</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$ManufactureWeek</font></span><span style="font-family: ; color: "><font color="#000000">).ToString(</font></span><span style="font-family: ; color: "><font color="#800000">&quot;MM/yyyy&quot;</font></span></font><span style="font-family: ; color: "><font color="#000000"><font style="font-size: 10pt">)</font><span style="mso-spacerun: yes"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span></font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><span style="mso-spacerun: yes"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span></font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></font></font></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># EDID version is stored in bytes 18 &amp; 19</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$EDIDMajorVersion</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$EDIDValue</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">[18].ToString()</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$EDIDRevision</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$EDIDValue</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">[19].ToString()</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$EDIDVersion</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#800000">&quot;$($EDIDMajorVersion).$($EDIDRevision)&quot;</font></span></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><span style="mso-spacerun: yes"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span></font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># The manufacturerID is a three character id stored in a two </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># bytes (8 &amp; 9)</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$ManufacturerIDEncoded</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$EDIDValue</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">[8..9]</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># The easiest way to work with it is to convert it to a </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># concatenated binary string</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$ManufacturerIDBinaryString</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> (</font></span><span style="font-family: ; color: "><font color="#800080">$ManufacturerIDEncoded</font></span><span style="font-family: ; color: "><font color="#000000"> | </font></span><b><span style="font-family: ; color: "><font color="#5f9ea0">ForEach-Object</font></span></b></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">{</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 4"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">[</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#008080">System.Convert</font></span><span style="font-family: ; color: "><font color="#000000">]::</font></span><span style="font-family: ; color: "><font color="#8b4513">ToString</font></span><span style="font-family: ; color: "><font color="#000000">(</font></span><span style="font-family: ; color: "><font color="#800080">$_</font></span><span style="font-family: ; color: "><font color="#000000">,2).</font></span><span style="font-family: ; color: "><font color="#8b4513">PadLeft</font></span><span style="font-family: ; color: "><font color="#000000">(8,</font></span><span style="font-family: ; color: "><font color="#800000">&quot;0&quot;</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">)</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 3"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">}) </font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#ff0000">-join</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#800000">&quot;&quot;</font></span></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># Parse out the three five-byte character codes (1=A) and add </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># 64 to get the real character code</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$ManufacturerFirstLetterCode</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 3"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt"><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>[</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#008080">system.convert</font></span><span style="font-family: ; color: "><font color="#000000">]::</font></span><span style="font-family: ; color: "><font color="#8b4513">ToInt32</font></span><span style="font-family: ; color: "><font color="#000000">(</font></span><span style="font-family: ; color: "><font color="#800080">$ManufacturerIDBinaryString</font></span><span style="font-family: ; color: "><font color="#000000">.substring(1,5),2) </font></span><span style="font-family: ; color: "><font color="#ff0000">+</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> 64</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$ManufacturerSecondLetterCode</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 3"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt"><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>[</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#008080">system.convert</font></span><span style="font-family: ; color: "><font color="#000000">]::</font></span><span style="font-family: ; color: "><font color="#8b4513">ToInt32</font></span><span style="font-family: ; color: "><font color="#000000">(</font></span><span style="font-family: ; color: "><font color="#800080">$ManufacturerIDBinaryString</font></span><span style="font-family: ; color: "><font color="#000000">.substring(6,5),2) </font></span><span style="font-family: ; color: "><font color="#ff0000">+</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> 64</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$ManufacturerThirdLetterCode</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 3"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt"><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>[</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#008080">system.convert</font></span><span style="font-family: ; color: "><font color="#000000">]::</font></span><span style="font-family: ; color: "><font color="#8b4513">ToInt32</font></span><span style="font-family: ; color: "><font color="#000000">(</font></span><span style="font-family: ; color: "><font color="#800080">$ManufacturerIDBinaryString</font></span><span style="font-family: ; color: "><font color="#000000">.substring(11,5),2) </font></span><span style="font-family: ; color: "><font color="#ff0000">+</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> 64</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># Concatenate the three character codes into a byte array</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 3"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">[</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#008080">byte</font></span><span style="font-family: ; color: "><font color="#000000">[]] </font></span><span style="font-family: ; color: "><font color="#800080">$ManufacturerIDByteArray</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font color="#000000"><span style="mso-tab-count: 4"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">(</font><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160; </font></span></font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 5"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$ManufacturerFirstLetterCode</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">,</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 5"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$ManufacturerSecondLetterCode</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">,</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 5"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#800080">$ManufacturerThirdLetterCode</font></span></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font color="#000000"><span style="mso-tab-count: 4"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">)</font></font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># Convert the byte array to a string</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$ManufacturerID</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> </font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 4"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">[</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#008080">system.text.encoding</font></span><span style="font-family: ; color: "><font color="#000000">]::</font></span><span style="font-family: ; color: "><font color="#8b4513">Default</font></span><span style="font-family: ; color: "><font color="#000000">.</font></span><span style="font-family: ; color: "><font color="#8b4513">GetString</font></span><span style="font-family: ; color: "><font color="#000000">(</font></span><span style="font-family: ; color: "><font color="#800080">$ManufacturerIDByteArray</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">)</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font style="font-size: 10pt" color="#000000">&#160;</font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># The device id is stored in bytes 10 and 11 (16-bit little endian)</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$DeviceID</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#000000"> (</font></span><span style="font-family: ; color: "><font color="#800000">&quot;{0:X}&quot;</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">-f</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$EDIDValue</font></span><span style="font-family: ; color: "><font color="#000000">[11]).PadLeft(2,</font></span><span style="font-family: ; color: "><font color="#800000">&quot;0&quot;</font></span><span style="font-family: ; color: "><font color="#000000">) </font></span></font><b><span style="font-family: ; color: "><font style="font-size: 10pt" color="#5f9ea0">`</font></span></b></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 4"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#ff0000">+</font></span><span style="font-family: ; color: "><font color="#000000"> (</font></span><span style="font-family: ; color: "><font color="#800000">&quot;{0:X}&quot;</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">-f</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800080">$EDIDValue</font></span><span style="font-family: ; color: "><font color="#000000">[10]).PadLeft(2,</font></span><span style="font-family: ; color: "><font color="#800000">&quot;0&quot;</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">)</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font face="Courier New"><font style="font-size: 10pt" color="#000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><span style="font-family: ; color: "><font style="font-size: 10pt" color="#008000"># Put all of the values into a new custom object on the pipeline</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 2"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt"><span style="mso-spacerun: yes">&#160; </span><span style="mso-tab-count: 1">&#160;&#160;&#160; </span></font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#800080">$Properties</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#ff0000">=</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000"> @{</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 5"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">VendorID</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#800080">$ManufacturerID</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">;</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 5"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">DeviceID</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#800080">$DeviceID</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">;</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 5"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">ManufactureDate</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#800080">$ManufactureDate</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">;</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 5"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">SerialNumber</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#800080">$SerialNumber</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">;</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 5"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">ModelName</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#ff0000">=</font></span><span style="font-family: ; color: "><font color="#800080">$ModelName</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#000000">;</font></span></font></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><font color="#000000"><span style="mso-tab-count: 5"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">EDIDVersion</font></font></span><font style="font-size: 10pt"><span style="font-family: ; color: "><font color="#ff0000">=</font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#800080">$EDIDVersion</font></span></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font color="#000000"><span style="mso-tab-count: 3"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">}</font></font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><font face="Courier New"><span style="font-family: ; color: "><span style="mso-tab-count: 3"><font color="#000000"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></span><font style="font-size: 10pt"><b><span style="font-family: ; color: "><font color="#5f9ea0">New-Object</font></span></b><span style="font-family: ; color: "><font color="#000000"> </font></span><span style="font-family: ; color: "><font color="#800000">psobject</font></span><span style="font-family: ; color: "><font color="#000000"> </font></span><i><span style="font-family: ; color: "><font color="#5f9ea0">-Property</font></span></i><span style="font-family: ; color: "><font color="#000000"> </font></span></font><span style="font-family: ; color: "><font style="font-size: 10pt" color="#800080">$Properties</font></span></font><span style="font-family: ; color: "></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt"><span style="mso-spacerun: yes">&#160;&#160;&#160; </span>}</font></font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font color="#000000"><span style="mso-tab-count: 1"><font style="font-size: 10pt">&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 10pt">}</font></font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font style="font-size: 10pt" color="#008000"># end script block</font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font style="font-size: 10pt" color="#000000">}</font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt; text-autospace: ; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font style="font-size: 10pt" color="#000000">&#160;</font></font></span></p>  <p style="list-style-type: disc; margin: 0in 0in 0pt" class="MsoNormal"><span style="font-family: ; color: "><font face="Courier New"><font style="font-size: 10pt" color="#5f9ea0">Main</font></font></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Pretty as a Picture</title>
      <link>https://docs.microsoft.com/archive/blogs/stephap/pretty-as-a-picture</link>
      <pubDate>Tue, 02 Jun 2009 01:02:29 GMT</pubDate>
      <dc:creator><![CDATA[Stephanie Peters]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/stephap/2009/06/02/pretty-as-a-picture/</guid>
      <description><![CDATA[I Told You So In my last post I promised to try to do something more fun.&nbsp; For me that would...]]></description>
      <content:encoded><![CDATA[<h4>I Told You So</h4> <p><font size="2">In my last post I promised to try to do something more fun.&nbsp; For me that would mean some wicked algorithm, but I realize I’m in the minority on that one.&nbsp; I decided instead to pull out a script I did a while back to resize an image.&nbsp; I actually leveraged some .Net code I found on a blog which I can’t remember, so I acknowledge that some parts of this script I owe in large part to an unnamed donor.&nbsp; Many thanks to whoever you are.&nbsp; It wasn’t exactly what I was looking for, so the final product is mine—after a bit of effort.</font></p> <h4>Extraneous Background Information</h4> <p><font size="2">When I wrote this script, I was working on a larger project where I had to create a boatload of very detailed performance metrics graphs for 100+ servers and make them available from a SharePoint site.&nbsp; Each graph would be displayed on its own page in full resolution, but it also needed to be displayed in lower resolution on a summary page.&nbsp; The images had to be clear enough that a user could spot trends on individual servers and make a decision about whether or not to look at the individual graph for further investigation.&nbsp; It quickly became clear that I needed to generate thumbnail versions of all of my images.&nbsp; So that’s the challenge that motivated me to write this script.</font></p> <h4>The Script</h4> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #002060; font-size: 10pt; mso-bidi-font-family: 'Courier New'">Param</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'">( <span style="color: #215868; mso-themecolor: accent5; mso-themeshade: 128">[System.IO.FileInfo[]]</span> <span style="color: #ff3300">$InputFile</span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">,</span><?xml:namespace prefix = o /><o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Suffix</span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">=</span> <span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"_Resized"</span><span style="mso-spacerun: yes">&nbsp; </span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">,</span><o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$NewWidth</span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">=</span> <span style="color: #5f497a; mso-themecolor: accent4; mso-themeshade: 191">225</span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">,</span><o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$NewHeight</span><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">=</span> <span style="color: #5f497a; mso-themecolor: accent4; mso-themeshade: 191">150</span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>)<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #002060; font-size: 10pt; mso-bidi-font-family: 'Courier New'">If</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"> (<span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">-not</span> <span style="color: #ff3300">$InputFile</span>) { <span style="color: #ff3300">$ScriptInputFile</span> <span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">=</span> <span style="color: #ff3300">$Input</span> }<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #002060; font-size: 10pt; mso-bidi-font-family: 'Courier New'">Else</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"> {<span style="color: #ff3300">$ScriptInputFile</span> <span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">=</span> <span style="color: #ff3300">$InputFile</span>}<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><o:p>&nbsp;</o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #215868; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-themecolor: accent5; mso-themeshade: 128">[Reflection.Assembly]</span><span style="line-height: 115%; font-family: 'Lucida Console'; color: gray; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-themecolor: background1; mso-themeshade: 128">::</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'">LoadWithPartialName(<span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"System.Drawing"</span>) <span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">|</span><span style="color: #0000cc"> Out-Null</span><o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><o:p>&nbsp;</o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'">$ScriptInputFile</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"> <span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">|</span> <span style="color: #0000cc">%</span>{<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$FileImage</span> <span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">=</span> (<span style="color: #215868; mso-themecolor: accent5; mso-themeshade: 128">[System.Drawing.Image]</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">::</span>FromFile(<span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"$($_.FullName)"</span>))<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Bitmap</span> <span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">=</span> <span style="color: #0000cc">New-Object</span> <span style="color: #002060">-TypeName</span> <span style="color: #5f497a; mso-themecolor: accent4; mso-themeshade: 191">System.Drawing.Bitmap</span> `<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: #002060">-ArgumentList</span> <span style="color: #ff3300">$NewWidth</span>,<span style="color: #ff3300">$NewHeight</span>,<span style="color: #ff3300">$FileImage</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">.</span>PixelFormat<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Graphic</span> <span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">=</span> <span style="color: #215868; mso-themecolor: accent5; mso-themeshade: 128">[System.Drawing.Graphics]</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">::</span>FromImage(<span style="color: #ff3300">$Bitmap</span>)<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Graphic</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">.</span>SmoothingMode <span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">= `<o:p></o:p></span></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: #215868; mso-themecolor: accent5; mso-themeshade: 128"><span style="mso-spacerun: yes">&nbsp;</span></span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: #215868; mso-themecolor: accent5; mso-themeshade: 128">[System.Drawing.Drawing2D.SmoothingMode]</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">::</span>HighQuality<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Graphic</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">.</span>InterpolationMode <span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">= `<o:p></o:p></span></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: #215868; mso-themecolor: accent5; mso-themeshade: 128"><span style="mso-spacerun: yes">&nbsp;</span></span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: #215868; mso-themecolor: accent5; mso-themeshade: 128">[System.Drawing.Drawing2D.InterpolationMode]</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">::</span>HighQualityBicubic<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Graphic</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">.</span>DrawImage(<span style="color: #ff3300">$FileImage</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">,</span> <span style="color: #5f497a; mso-themecolor: accent4; mso-themeshade: 191">0</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">,</span> <span style="color: #5f497a; mso-themecolor: accent4; mso-themeshade: 191">0</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">,</span> <span style="color: #ff3300">$Bitmap</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">.</span>Width<span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">,</span> <span style="color: #ff3300">$Bitmap</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">.</span>Height)<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$FileType</span> <span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">=</span> <span style="color: #ff3300">$_</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">.</span>FullName<span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">.</span>Split(<span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"."</span>)<span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">[</span><span style="color: #5f497a; mso-themecolor: accent4; mso-themeshade: 191">-1</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">]</span><o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Bitmap</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">.</span>Save(<span style="color: #ff3300">$_</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">.</span>FullName<span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">.</span>Replace(<span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">".$FileType"</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">,</span><span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"$Suffix.$FileType"</span>)<span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">, `<o:p></o:p></span></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: #215868; mso-themecolor: accent5; mso-themeshade: 128"><span style="mso-spacerun: yes">&nbsp;</span></span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: #215868; mso-themecolor: accent5; mso-themeshade: 128">[System.Drawing.Imaging.ImageFormat]</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">::</span>Jpeg)<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Graphic</span><span style="color: gray; mso-themecolor: background1; mso-themeshade: 128">.</span>Dispose()<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'">}</span></p> <p class="MsoNormal">&nbsp;</p> <h4>Parameters </h4> <h6><font size="2">-InputFile &lt;Image File or files&gt;</font></h6> <p><font size="2">You can run the script specifying a single file or a collection of FileInfo objects.&nbsp; If you specify a string, it will attempt to convert the string to a valid FileInfo object.</font></p> <h6><font size="2">-Suffix &lt;Suffix string&gt;</font></h6> <p class="MsoNormal"><font size="2">This gets appended to your newly resized file name.&nbsp; Default is “_Resized.”</font></p> <h6><font size="2">-NewWidth &lt;New width&gt;</font></h6> <p class="MsoNormal"><font size="2">Specify the new width in pixels.&nbsp; Default is 225.</font></p> <h6><font size="2">-NewHeight &lt;New height&gt;</font></h6> <p class="MsoNormal"><font size="2">Specify the new width in pixels.&nbsp; Default is 150.</font></p> <p class="MsoNormal"><font size="2"></font>&nbsp;</p> <h4>Seeing it in Action</h4> <p class="MsoNormal"><font size="2">Given the following sample image (object in browser are larger than the appear—the original size of this image is 1024x683):</font></p> <p class="MsoNormal"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_technet/stephap/WindowsLiveWriter/PrettyasaPicture_13E18/Tulip_2.jpg" original-url="http://blogs.technet.com/blogfiles/stephap/WindowsLiveWriter/PrettyasaPicture_13E18/Tulip_2.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Tulip" border="0" alt="Tulip" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_technet/stephap/WindowsLiveWriter/PrettyasaPicture_13E18/Tulip_thumb.jpg" original-url="http://blogs.technet.com/blogfiles/stephap/WindowsLiveWriter/PrettyasaPicture_13E18/Tulip_thumb.jpg" width="244" height="164"></a> </p> <p class="MsoNormal"><font size="2">The first line here will resize the file and return the FileInfo object.&nbsp; The second command will actually display the shrunken file in the default application.</font></p> <p class="MsoNormal"><font size="2"></font>&nbsp;</p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><span style="line-height: 115%; font-family: 'Courier New'; color: #ffc000; font-size: 8pt">[PS]</span><span style="line-height: 115%; font-family: 'Courier New'; color: white; font-size: 8pt; mso-themecolor: background1"> &gt; Set-Image.ps1 -InputFile "C:\Users\Public\Pictures\Sample Pictures\tulip.jpg" -Suffix ".Tiny" -NewWidth 25 -NewHeight 16<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><span style="line-height: 115%; color: white; font-size: 8pt; mso-themecolor: background1"><o:p>&nbsp;</o:p></span></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><span style="line-height: 115%; font-family: 'Courier New'; color: white; font-size: 8pt; mso-themecolor: background1"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>Directory: C:\Users\Public\Pictures\Sample Pictures<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><span style="line-height: 115%; font-family: 'Courier New'; color: white; font-size: 8pt; mso-themecolor: background1"><o:p>&nbsp;</o:p></span></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><span style="line-height: 115%; font-family: 'Courier New'; color: white; font-size: 8pt; mso-themecolor: background1">Mode<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>LastWriteTime<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>Length Name<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><span style="line-height: 115%; font-family: 'Courier New'; color: white; font-size: 8pt; mso-themecolor: background1">----<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>-------------<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </span>------ ----<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><span style="line-height: 115%; font-family: 'Courier New'; color: white; font-size: 8pt; mso-themecolor: background1">-a---<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>6/2/2009<span style="mso-spacerun: yes">&nbsp; </span>12:35 AM<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>817 tulip.Tiny.jpg<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><span style="line-height: 115%; font-family: 'Courier New'; color: white; font-size: 8pt; mso-themecolor: background1"><o:p>&nbsp;</o:p></span></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><span style="line-height: 115%; font-family: 'Courier New'; color: #ffc000; font-size: 8pt">[PS]</span><span style="line-height: 115%; font-family: 'Courier New'; color: white; font-size: 8pt; mso-themecolor: background1"> &gt; &amp; (Set-Image.ps1 -InputFile "C:\Users\Public\Pictures\Sample Pictures\tulip.jpg" -Suffix ".Tiny" -NewWidth 25 -NewHeight 16)<o:p></o:p></span></p> <p class="MsoNormal"><font size="2"></font></p> <p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_technet/stephap/WindowsLiveWriter/PrettyasaPicture_13E18/tulip.Tiny_2.jpg" original-url="http://blogs.technet.com/blogfiles/stephap/WindowsLiveWriter/PrettyasaPicture_13E18/tulip.Tiny_2.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="tulip.Tiny" border="0" alt="tulip.Tiny" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_technet/stephap/WindowsLiveWriter/PrettyasaPicture_13E18/tulip.Tiny_thumb.jpg" original-url="http://blogs.technet.com/blogfiles/stephap/WindowsLiveWriter/PrettyasaPicture_13E18/tulip.Tiny_thumb.jpg" width="29" height="20"></a> </p> <h4>Challenge!</h4> <p><font size="2">Note that it will match your NewWidth and NewHeight parameters and skew the image if necessary.&nbsp; I can imagine it wouldn’t be that difficult to modify the script to prevent skewing or to specify a percentage to use, so the new image would be 75% or 200% of the original.&nbsp; The System.Drawing.Image object has Height and Width properties that would give you the dimensions of the original image.&nbsp; Hint, hint!</font></p>]]></content:encoded>
    </item>
    <item>
      <title>Stopping Services in a Specific Order</title>
      <link>https://docs.microsoft.com/archive/blogs/stephap/stopping-services-in-a-specific-order</link>
      <pubDate>Fri, 29 May 2009 21:41:00 GMT</pubDate>
      <dc:creator><![CDATA[Stephanie Peters]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/stephap/2009/05/29/stopping-services-in-a-specific-order/</guid>
      <description><![CDATA[A lot of the work that I do in product support involves setting up labs to try and reproduce a...]]></description>
      <content:encoded><![CDATA[<p><font size="2">A lot of the work that I do in product support involves setting up labs to try and reproduce a problem in order to troubleshoot it.&nbsp; In that arena, one of the most frequent sub tasks is bulk starting and stopping of services.&nbsp; A lot of times the services have to be started in a particular order sequentially—which means you can’t just let them fly.&nbsp; It’s a simple thing really, but what I want to do here is to use the stopping and starting of services to illustrate a really important concept—<strong><em>refreshing the properties of a WMI object.</em></strong></font></p> <p><font size="2">It actually took me quite a while to figure this out—although after the fact I kicked myself… hard.&nbsp; This used to be simple with VBScript.&nbsp; You could just get any old WMI instance object and call the Refresh_ method, which came from the SWbemObjectEx interface.&nbsp; Unfortunately this much needed method isn’t present in System.Management.ManagementObject.&nbsp;&nbsp; Before I get to that, I’ll show you the complicated script I wrote to get this done the long way—this one is an earlier version which just stops services in a particular order, but you’ll see what I mean.</font></p> <h4>The Ugly Way</h4> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #006600; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">#### Stop Services sequentially<?xml:namespace prefix = o /><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><o:p>&nbsp;</o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #006600; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">#### List your servers individually<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">$Servers</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> (<span style="color: maroon">"Localhost"</span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">,</span><span style="color: maroon">"127.0.0.1"</span>)<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #006600; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">#### ...or read them in from a file<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #006600; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"># $Servers = (type c:\serverlist.txt)<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><o:p>&nbsp;</o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #006600; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">#### You must specify a timeout (in seconds) or the script could potentially never end<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">$TimeOut</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #7030a0">10</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><o:p>&nbsp;</o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #006600; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">#### Use this line to get all services matching a pattern.<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #006600; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"># $ServiceFilters = "name like 'msex%'"<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: green; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><o:p>&nbsp;</o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #006600; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">#### This will stop a single service on all servers in sequence<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #006600; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"># $ServiceFilters = "name = 'spooler'"<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: green; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><o:p>&nbsp;</o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #006600; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">#### This is just a more complex filter but the sequence is not guarateed<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #006600; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"># $ServiceFilters = "(name = 'spooler' OR name = 'msdtc')"<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: green; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><o:p>&nbsp;</o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #006600; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">#### Specifying individual filters in sequence will guarantee the order or services to stop<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">$ServiceFilters</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: maroon">"(name = 'spooler')"</span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">,</span><span style="color: maroon">"(name = 'msdtc')"</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><o:p>&nbsp;</o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">$Servers</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">|</span> <span style="color: blue">%</span>{<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Server</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #ff3300">$_</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: yellow; color: #ff3300; mso-highlight: yellow">$Locator</span><span style="background: yellow; mso-highlight: yellow"> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: blue">new-object</span> <span style="color: #002060">-com</span> <span style="color: maroon">"WbemScripting.SWbemLocator"</span></span> <o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: yellow; color: #ff3300; mso-highlight: yellow">$WMI</span><span style="background: yellow; mso-highlight: yellow"> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #ff3300">$Locator</span>.ConnectServer(<span style="color: #ff3300">$Server</span>, <span style="color: maroon">"root\cimv2"</span>)</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$ServiceFilters</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">|</span> <span style="color: blue">%</span>{ <o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$ThisFilter</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #ff3300">$_</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>(<span style="color: blue">Get-WmiObject</span> <span style="color: #002060">-Class</span> <span style="color: #7030a0">Win32_Service</span> <span style="color: #002060">-ComputerName</span> <span style="color: #ff3300">$Server</span> <span style="color: #002060">-filter</span> <span style="color: maroon">"$ThisFilter AND state='running'"</span>) <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">|</span> <span style="color: blue">%</span>{<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Service</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #ff3300">$_<o:p></o:p></span></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: yellow; color: #ff3300; mso-highlight: yellow">$Refresher</span><span style="background: yellow; mso-highlight: yellow"> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: blue">new-object</span> <span style="color: #002060">-comobject</span> <span style="color: maroon">"WbemScripting.SWbemRefresher"</span></span><span style="color: maroon"><o:p></o:p></span></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: yellow; color: #ff3300; mso-highlight: yellow">$FreshObject</span><span style="background: yellow; mso-highlight: yellow"> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #ff3300">$Refresher</span>.Add(<span style="color: #ff3300">$WMI</span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">,</span><span style="color: #ff3300">$Service</span>.__RELPATH)</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: yellow; color: #ff3300; mso-highlight: yellow">$Refresher</span><span style="background: yellow; mso-highlight: yellow">.Refresh()</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Then</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">= </span><span style="color: blue">Get-Date<o:p></o:p></span></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #002060">:Checking Do</span> {<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Service</span>.StopService() <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">|</span> <span style="color: blue">out-null</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: yellow; color: #ff3300; mso-highlight: yellow">$Refresher</span><span style="background: yellow; mso-highlight: yellow">.Refresh()</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: yellow; color: #002060; mso-highlight: yellow">if</span><span style="background: yellow; mso-highlight: yellow"> ((<span style="color: #ff3300">$FreshObject</span>.Object.properties_ <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">|</span> <span style="color: blue">?</span>{<span style="color: #ff3300">$_</span>.name <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-eq</span> <span style="color: maroon">"state"</span>}).value <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-eq</span> <span style="color: maroon">"Stopped"</span>)</span> {<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: maroon">"Stopped $Service on $Server"</span>;<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #002060">break</span> <span style="color: blue">:Checking</span>;<span style="color: blue"><o:p></o:p></span></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>} <span style="color: #002060">Else</span> { <o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #002060">If </span>(((<span style="color: blue">Get-Date</span>) <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-</span> <span style="color: #ff3300">$Then</span>).seconds <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-ge</span> <span style="color: #ff3300">$TimeOut</span>){<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 6">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: maroon">"!!! TIMEOUT - $Service on $Server"</span>;<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 6">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #002060">break</span> <span style="color: blue">:Checking</span>;<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>} <o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>} <span style="color: #002060">While</span> (<span style="color: #ff3300">$True</span>)<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">}<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: maroon; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">"Services are all stopped"<o:p></o:p></span></p> <p><font size="2">I was never really a fan of the SWbemRefresher object.&nbsp; It always seemed a bit counter-intuitive and require me to jump through too many hoops, like using the SWbemLocator object.&nbsp; Ugh.</font></p> <p><font size="2">As it turns out there is a method I can use from System.Management.ManagementObject which refreshes the instance data.&nbsp; <strong><em>I was looking for something named Refresh or similar, but the actual method is called Get().</em></strong>&nbsp; Sure it makes sense now—I can hear the condescension across space/time.&nbsp; And this allows me to make the script a lot friendlier.</font></p> <h4>The Much Nicer Version</h4> <p><font size="2">Aside from removed the dreadful SWbemLocator, I also cleaned the script up a bit and made it more flexible.</font></p> <h5>Arguments</h5> <h5>-Operation &lt;start|stop&gt;</h5> <p><font size="2">This makes the script work for either starting or stopping services.&nbsp; If you don’t provide an operation, the script will just return the current state of all services that match the filter.</font></p> <h5>-ServiceFilters &lt;Filter String(s)&gt;</h5> <p><font size="2">This is where you specify which services and in what order to process.&nbsp; We’re taking one or more filter strings here to make the script more flexible.&nbsp; Some potential ServiceFilters values are:</font></p> <ul> <li><font size="2">"Name = 'spooler'"</font>  <li><font size="2">"Name like 'msex%'"</font>  <li><font size="2">"StartMode = 'Auto'"</font>  <li><font size="2">"Name = 'spooler'","Name = 'msdtc'"</font></li></ul> <p><font size="2">Note that in order to guarantee the order of processing, you should specify each filter string separately, as it the last example.</font></p> <h5>-Servers &lt;ServerList&gt;</h5> <p><font size="2">Specify one or more servers by any name that will resolve—Netbios, DNS, IP.&nbsp; If you don’t specify a server, then the script will assume the local machine.</font></p> <h5>-TimeOutSeconds &lt;NumberOfSeconds&gt;</h5> <p>Specify how many seconds to wait before timing out processing the service.&nbsp; Default is 10 seconds.&nbsp; Once the timeout expires, it will just move on to the next service.</p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #006600; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">#### Stop Services sequentially<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><o:p>&nbsp;</o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #002060; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">Param</span><span style="line-height: 115%; font-family: 'Lucida Console'; color: #006600; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"> </span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">(<span style="color: #006600"> </span><span style="color: #ff3300">$Operation</span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">,</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$ServiceFilters</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: maroon">"(name='')"</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">,</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Servers</span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: maroon">"Localhost"</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">,</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$TimeOutSeconds</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #7030a0">10 </span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>)<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><o:p>&nbsp;</o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #002060; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">Switch </span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">(<span style="color: #ff3300">$Operation</span>) {<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>{<span style="color: #ff3300">$_</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-like</span> <span style="color: maroon">"start*"</span>} {<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Method</span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: maroon">"StartService";<o:p></o:p></span></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$DesiredState</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: maroon">"Running";</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>{<span style="color: #ff3300">$_</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-like</span> <span style="color: maroon">"stop*"</span>}<span style="mso-spacerun: yes">&nbsp; </span>{<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$Method</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: maroon">"StopService";</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$DesiredState</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: maroon">"Stopped";<o:p></o:p></span></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>Default <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$Method</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: maroon">$Null;</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$DesiredState</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: maroon">"*";<o:p></o:p></span></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">}<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><o:p>&nbsp;</o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">$Servers</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">|</span> <span style="color: blue">%</span>{<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Server</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #ff3300">$_</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$ServiceFilters</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">|</span> <span style="color: blue">%</span>{ <o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$ThisFilter</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #ff3300">$_</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>(<span style="color: blue">Get-WmiObject</span> <span style="color: #002060">-Class</span> <span style="color: #7030a0">Win32_Service</span> `<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #002060">-ComputerName</span> <span style="color: #ff3300">$Server</span> `<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #002060">-filter</span> <span style="color: maroon">"$ThisFilter AND state!='$DesiredState'"</span>) <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">|</span> <span style="color: blue">%</span>{<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Service</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #ff3300">$_<o:p></o:p></span></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Then</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">= </span><span style="color: blue">Get-Date<o:p></o:p></span></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #002060">:Checking Do</span> {<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #002060">If</span> (<span style="color: #ff3300">$Method</span>) {<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$ErrorCode </span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #ff3300">$Service</span>.PSBase.InvokeMethod(<span style="color: #ff3300">$Method</span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">,</span><span style="color: #ff3300">$Null</span>)<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: yellow; color: #ff3300; mso-highlight: yellow">$Service</span><span style="background: yellow; mso-highlight: yellow">.Get()</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: yellow; color: #002060; mso-highlight: yellow">if</span><span style="background: yellow; mso-highlight: yellow"> (<span style="color: #ff3300">$Service</span>.State <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-like</span> <span style="color: maroon">"$DesiredState"</span>)</span> {<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: maroon">"$($Service.State) on $Server - $($Service.caption) ($($Service.name))"</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">|</span> <span style="color: blue">out-host</span>;<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #002060">break</span> <span style="color: blue">:Checking</span>;<span style="color: blue"><o:p></o:p></span></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>} <span style="color: #002060">Else</span> { <o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #002060">If </span>(((<span style="color: blue">Get-Date</span>) <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-</span> <span style="color: #ff3300">$Then</span>).seconds <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-ge</span> <span style="color: #ff3300">$TimeOutSeconds</span>){<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 6">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: maroon">"!!! TIMEOUT - $Service on $Server" </span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">|</span> <span style="color: blue">out-host</span>;<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 6">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #002060">break</span> <span style="color: blue">:Checking</span>;<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>} <o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>} <span style="color: #002060">While</span> (<span style="color: #ff3300">$True</span>)<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">}<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: maroon; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p><font size="2"></font></p> <p><font size="2">Here’s the code in action.&nbsp; Notice what happens if I set the timeout too short.</font></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: yellow; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">[PS]</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><font color="#ffffff"> .\Set-BulkService.ps1 -operation start -servicefilters "(name = 'spooler')","(name = 'msdtc')" -servers 127.0.0.1 -timeout 2<o:p></o:p></font></span></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><font color="#ffffff">Running on 127.0.0.1 - Print Spooler (Spooler)<o:p></o:p></font></span></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><font color="#ffffff">Running on 127.0.0.1 - Distributed Transaction Coordinator (MSDTC)<o:p></o:p></font></span></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: yellow; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">[PS]<font color="#ffffff"> </font></span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><font color="#ffffff">.\Set-BulkService.ps1 -operation start -servicefilters "(name = 'spooler')","(name = 'msdtc')" -servers 127.0.0.1 -timeout 0<o:p></o:p></font></span></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><font color="#ffffff">!!! TIMEOUT - \\STEPHAP1\root\cimv2:Win32_Service.Name="Spooler" on 127.0.0.1<o:p></o:p></font></span></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><font color="#ffffff">!!! TIMEOUT - \\STEPHAP1\root\cimv2:Win32_Service.Name="MSDTC" on 127.0.0.1<o:p></o:p></font></span></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: yellow; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">[PS]<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: yellow; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p><font size="2">So that’s that.&nbsp; My greatest hope for this post is that someone is searching for the Refresh_ method and PowerShell, and they happen upon this code and save themselves some time.</font></p> <h4>Unfortunately…</h4> <p>I wrote the previous scripts on Windows 7 using PowerShell v2 where it worked like a champ, but when I tried the latter script on my Windows 2003 Exchange 2007 server, it wasn’t so happy.&nbsp; I’m not sure whether it’s Windows or PowerShell, but the Get() method was not available there.&nbsp; I had to go back and use reflection to get at it as well as make a couple of other changes that for whatever reason were necessary to make it work.&nbsp; Here is the safer version of the script that worked in both locations:</p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #006600; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">#### Stop Services sequentially</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">&nbsp;</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #002060; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">Param</span><span style="line-height: 115%; font-family: 'Lucida Console'; color: #006600; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"> </span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">(<span style="color: #006600"> </span><span style="color: #ff3300">$Operation</span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">,</span></span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$ServiceFilters</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: maroon">"(name='')"</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">,</span></span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Servers</span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: maroon">"Localhost"</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">,</span></span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$TimeOutSeconds</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #7030a0">10 </span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>)</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">&nbsp;</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #002060; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">Switch </span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">(<span style="color: #ff3300">$Operation</span>) {</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>{<span style="color: #ff3300">$_</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-like</span> <span style="color: maroon">"start*"</span>} {</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Method</span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: maroon">"StartService";</span></span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$DesiredState</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: maroon">"Running";</span></span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>}</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>{<span style="color: #ff3300">$_</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-like</span> <span style="color: maroon">"stop*"</span>}<span style="mso-spacerun: yes">&nbsp; </span>{</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$Method</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: maroon">"StopService";</span></span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$DesiredState</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: maroon">"Stopped";</span></span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>}</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>Default<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$Method</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: maroon">$Null;</span></span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$DesiredState</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: maroon">"*";</span></span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>}</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">}</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">$Servers</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">|</span> <span style="color: blue">%</span>{</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Server</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #ff3300">$_</span></span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$ServiceFilters</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">|</span> <span style="color: blue">%</span>{ </span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$ThisFilter</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #ff3300">$_</span></span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'">&nbsp;</span><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="background: yellow; color: #ff3300; mso-highlight: yellow">$Services</span><span style="background: yellow; mso-highlight: yellow"> = `</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (<span style="color: blue">Get-WmiObject</span> <span style="color: #002060">-Class</span> <span style="color: #7030a0">Win32_Service</span> `<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #002060">-ComputerName</span> <span style="color: #ff3300">$Server</span> `<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #002060">-filter</span> <span style="color: maroon">"$ThisFilter AND state!='$DesiredState'"</span>) <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="background: yellow; color: #ff3300; mso-highlight: yellow">$Services</span> | %{<o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Service</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #ff3300">$_</span></span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$Then</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">= </span><span style="color: blue">Get-Date</span></span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #002060">:Checking Do</span> {</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: yellow; color: #002060; mso-highlight: yellow">If</span><span style="background: yellow; mso-highlight: yellow"> (<span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-not</span> <span style="color: #ff3300">$Service</span>) { <span style="color: #002060">Break</span> <span style="color: blue">:Checking</span>; }</span><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #002060">If</span> (<span style="color: #ff3300">$Method</span>) {</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$ErrorCode </span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #ff3300">$Service</span>.PSBase.InvokeMethod(<span style="color: #ff3300">$Method</span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">,</span><span style="color: #ff3300">$Null</span>)</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: yellow; color: #ff3300; mso-highlight: yellow">$ObjectType</span><span style="background: yellow; mso-highlight: yellow"> = <span style="color: #ff3300">$Service</span>.GetType()<br></span><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: yellow; color: #ff3300; mso-highlight: yellow">$GetProperty</span><span style="background: yellow; mso-highlight: yellow"> = <span style="color: teal">[reflection.bindingflags]</span>::InvokeMethod</span><br><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="background: yellow; color: #ff3300; mso-highlight: yellow">$ObjectType</span><span style="background: yellow; mso-highlight: yellow">.InvokeMember(<span style="color: maroon">"Get"</span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">,</span><span style="color: #ff3300"> $GetProperty</span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">,</span><span style="color: #ff3300">$Null</span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">,</span><span style="color: #ff3300">$Service</span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">,</span><span style="color: #ff3300">$Null</span>)</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #002060">if</span> (<span style="color: #ff3300">$Service</span>.State <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-like</span> <span style="color: maroon">"$DesiredState"</span>) {</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: maroon">"$($Service.State) on $Server - $($Service.caption) ($($Service.name))"</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">|</span> <span style="color: blue">out-host</span>;</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #002060">break</span> <span style="color: blue">:Checking</span>;</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>} <span style="color: #002060">Else</span> { </span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #002060">If </span>(((<span style="color: blue">Get-Date</span>) <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-</span> <span style="color: #ff3300">$Then</span>).seconds <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-ge</span> <span style="color: #ff3300">$TimeOutSeconds</span>){</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 6">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: maroon">"!!! TIMEOUT - $Service on $Server" </span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">|</span> <span style="color: blue">out-host</span>;</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 6">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #002060">break</span> <span style="color: blue">:Checking</span>;</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>} </span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>} <span style="color: #002060">While</span> (<span style="color: #ff3300">$True</span>)</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'">}</span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt" class="MsoNormal"><o:p>&nbsp;</o:p></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"></span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt" class="MsoNormal"><o:p>&nbsp;</o:p></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"></span><span style="line-height: 115%; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p> <p style="margin-bottom: 0pt" class="MsoNormal"><o:p><font size="2">That was quite a journey you took with me.&nbsp; Thanks for sticking around all the way to the end.&nbsp; You must be really into scripting.&nbsp; I hope you weren’t too disappointed.&nbsp; Next time I’ll do something fun—I promise.</font></o:p></p> <p style="margin-bottom: 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242" class="MsoNormal"><span style="line-height: 115%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman'"><o:p></o:p></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Identifying Defunct Organizations (Empty OUs)</title>
      <link>https://docs.microsoft.com/archive/blogs/stephap/identifying-defunct-organizations-empty-ous</link>
      <pubDate>Wed, 27 May 2009 14:20:00 GMT</pubDate>
      <dc:creator><![CDATA[Stephanie Peters]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/stephap/2009/05/27/identifying-defunct-organizations-empty-ous/</guid>
      <description><![CDATA[I have quite a nice little script for you today.&nbsp; A customer asked me yesterday how he might...]]></description>
      <content:encoded><![CDATA[<p>I have quite a nice little script for you today.&nbsp; A customer asked me yesterday how he might identify hosted business organizations which contain no subscribed users so he can remove the empty organizations from HMC.&nbsp; If you’re not familiar with HMC, that involves locating OUs that don’t contain any users other than a couple of default admin accounts.&nbsp; Once I finished licking my chops I dove right in and whipped this one up.&nbsp; <p>The reason I was so stoked about writing this is that it involves one of my favorite things.&nbsp; Forget raindrops on roses—I love writing a recursive script.&nbsp; For those not educated in the ways of the geek, a recursive script calls itself.&nbsp; It’s like a video of a person in standing in front of a TV playing the live video of that person—or parallel mirrors where you see 50 reflections of yourself.&nbsp; (Oh, I’m getting excited just explaining the concept!)&nbsp; Generally you use recursion when working with a hierarchy of some sort.&nbsp; So you inspect a root object and get a list of it’s children, then you would call the same procedure (script, function, whatever) again, this time a child node becomes the root.  <h4>A Word of Warning</h4> <p>As you might guess, recursion can be somewhat dangerous.&nbsp; They can lead to stack overflows or memory exhaustion.&nbsp; For this reason, PowerShell limits the call depth to 1000.&nbsp; So once your script is 1001 levels deep into itself you’ll get an error:  <p><font color="#ff0000" face="Courier New">The script failed due to call depth overflow.&nbsp; The call depth reached 1001 and the maximum is 1000.<br>At line:0 char:0</font>  <p>Still you should be careful because if your script consumes enough memory, you just might run out of resources well before you get 1001 levels deep.&nbsp; <h4>Arguments</h4> <h6>-RootNode &lt;LDAP Path of Root Node&gt;</h6> <p>Specifies the container object where you want to begin your search.&nbsp; If you don’t specify a RootNode, the script returns False, and that’s that.</p> <h6>-OutputFile &lt;Path to file&gt;</h6> <p>If you specify an output file, the DNs of the effectively empty OUs will be written to this file.&nbsp; Should probably be a txt file, but it doesn't really matter.</p> <h6>-Verbose</h6> <p>This switch if specified will have the script echo to the console every OU that it’s currently checking so you can monitor the progress.</p> <h6>-Quiet</h6> <p>Using this switch means that when the script finds an empty OU, it will still write the DN to the file (if specified) but will not echo it to the console. </p> <p>* You may use –Verbose and –Quiet together if you feel you must.</p> <p>** If you’re only interested in a single OU, but you want to know whether it contains any nested users, you can specify only the -RootNode and use the –Quiet switch with no –OutputFile.&nbsp; This will return only a True or False value indicating whether that single OU is effectively empty.</p> <h4>The Script</h4> <p style="line-height: 110%; margin: 0in 0in 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242"><span style="line-height: 110%; font-family: 'Lucida Console'; color: #000066; font-size: 10pt; mso-bidi-font-family: 'Courier New'">Param</span><span style="line-height: 110%; font-family: 'Lucida Console'; color: #00004a; font-size: 10pt; mso-bidi-font-family: 'Courier New'"> </span><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'">( <span style="color: #006666">[ADSI]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #ff3300">$RootNode</span>&nbsp;&nbsp; <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006666">[system.io.fileinfo]</span> <span style="color: #ff3300">$OutputFile</span><span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166"> ,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006666">[switch]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #ff3300">$Verbose</span>&nbsp;&nbsp;&nbsp; <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006666">[switch]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #ff3300">$Quiet</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ) <?xml:namespace prefix = o /><o:p></o:p></span></p> <p style="line-height: 110%; margin: 0in 0in 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242"><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><o:p>&nbsp;</o:p></span></p> <p style="line-height: 110%; margin: 0in 0in 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242"><span style="line-height: 110%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'">$UsersExist</span><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"> = <span style="color: #ff3300">$False</span>; </span><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt"><o:p></o:p></span></p> <p style="line-height: 110%; margin: 0in 0in 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242"><span style="line-height: 110%; font-family: 'Lucida Console'; color: #000066; font-size: 10pt; mso-bidi-font-family: 'Courier New'">If</span><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"> (<span style="color: #ff3300">$Verbose</span>) { <span style="color: blue">write-host</span> <span style="color: maroon">"CHECKING:&nbsp; $($RootNode.distinguishedName)"</span> } </span><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt"><o:p></o:p></span></p> <p style="line-height: 110%; margin: 0in 0in 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242"><span style="line-height: 110%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'">$UserObjects</span><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"> = (<br>&nbsp;&nbsp;&nbsp; <span style="color: #ff3300">$RootNode</span>.PSBase.Children <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">|</span> <span style="color: blue">?</span>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #ff3300">$_</span>.objectCategory <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-like</span> <span style="color: maroon">"CN=Person,*"</span> `<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-and</span> <span style="color: #ff3300">$_</span>.distinguishedName <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-notlike</span> <span style="color: maroon">"CN=Admin@*"</span> `<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-and</span> <span style="color: #ff3300">$_</span>.distinguishedName <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-notlike</span> <span style="color: maroon">"CN=CSRAdmin@*"</span>;<br>&nbsp;&nbsp;&nbsp; }<br>) </span><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt"><o:p></o:p></span></p> <p style="line-height: 110%; margin: 0in 0in 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242"><span style="line-height: 110%; font-family: 'Lucida Console'; color: #000066; font-size: 10pt; mso-bidi-font-family: 'Courier New'">If</span><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"> (<span style="color: #ff3300">$UserObjects</span>) {<br>&nbsp;&nbsp;&nbsp; <span style="color: #ff3300">$UsersExist</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #ff3300">$True</span>;<br>} </span><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt"><o:p></o:p></span></p> <p style="line-height: 110%; margin: 0in 0in 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242"><span style="line-height: 110%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'">$ChildNodes</span><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> (<span style="color: #ff3300">$RootNode</span>.PSBase.Children <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">|</span><span style="color: blue"> ?</span>{<o:p></o:p></span></p> <p style="line-height: 110%; margin: 0in 0in 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242"><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="color: #ff3300">$_</span>.objectCategory <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-like</span> <span style="color: maroon">"CN=Organizational-Unit,*"<o:p></o:p></span></span></p> <p style="line-height: 110%; margin: 0in 0in 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242"><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'">});<br><span style="color: #ff3300">$ChildNodes</span> | <span style="color: blue">%</span>{<br>&nbsp;&nbsp;&nbsp; <span style="color: #ff3300">$ChildNode</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #ff3300">$_</span>;<br>&nbsp;&nbsp; <span style="color: #0f243e; mso-themecolor: text2; mso-themeshade: 128"> </span><span style="color: #000066">If</span> (<span style="color: #ff3300">$ChildNode</span>){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp; <span style="color: #ff3300">$MyInvocation</span>.InvocationName <span style="color: #000066">-RootNode</span> <span style="color: #ff3300">$ChildNode</span> `<o:p></o:p></span></p> <p style="line-height: 110%; margin: 0in 0in 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242"><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #000066">-out</span> <span style="color: #ff3300">$OutputFile</span> <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>`<o:p></o:p></span></p> <p style="line-height: 110%; margin: 0in 0in 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242"><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #000066">-verbose:</span><span style="color: #ff3300">$Verbose</span> <span style="mso-spacerun: yes">&nbsp;&nbsp; </span>`<o:p></o:p></span></p> <p style="line-height: 110%; margin: 0in 0in 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242"><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #000066">-Quiet:</span><span style="color: #ff3300">$Quiet</span> <span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>| <span style="color: blue">%</span>{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0f243e; mso-themecolor: text2; mso-themeshade: 128"> </span><span style="color: #000066">If</span> (<span style="color: #ff3300">$_</span>) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #ff3300">$UsersExist</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #ff3300">$True</span>;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <span style="color: #000066">Else</span> {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #000066">If</span><span style="color: #0f243e; mso-themecolor: text2; mso-themeshade: 128"> </span>(<span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-not</span> <span style="color: #ff3300">$Quiet</span>) { <o:p></o:p></span></p> <p style="line-height: 110%; margin: 0in 0in 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242"><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue">write-host</span> <span style="color: maroon">"*** $($ChildNode.distinguishedName) HAS NO USERS"</span>; <o:p></o:p></span></p> <p style="line-height: 110%; margin: 0in 0in 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242"><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #000066">If </span>(<span style="color: #ff3300">$OutputFile</span>) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #ff3300">$ChildNode</span>.distinguishedName | `<o:p></o:p></span></p> <p style="line-height: 110%; margin: 0in 0in 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242"><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: blue">out-file</span> <span style="color: #ff3300">$Outputfile</span> <span style="color: #000066">-append -encoding </span><span style="color: #7030a0">ascii</span>;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>} </span><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt"><o:p></o:p></span></p> <p style="line-height: 110%; margin: 0in 0in 0pt; background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242"><span style="line-height: 110%; font-family: 'Lucida Console'; color: #ff3300; font-size: 10pt; mso-bidi-font-family: 'Courier New'">$UsersExist</span><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'">;</span><span style="line-height: 110%; font-family: 'Lucida Console'; font-size: 10pt"><o:p></o:p></span></p><br> <p style="background: #f2f2f2; mso-background-themecolor: background1; mso-background-themeshade: 242"><span style="font-family: 'Lucida Console'; font-size: 10pt; mso-bidi-font-family: 'Courier New'"></span><span style="font-family: 'Lucida Console'; font-size: 10pt"></span></p> <p><font face="Courier New"></font> <h4>Other Uses</h4> <p>For my non-hosting folks out there, this script has a host of other uses.&nbsp; For instance you want to Find all the OUs that have computer objects in them.&nbsp; You can change this script up a bit to accomodate that.&nbsp; You’ll want to change the filter a bit and reverse the logic, but you can do it.&nbsp; Have fun!</p>]]></content:encoded>
    </item>
    <item>
      <title>Choking on (Very Large) XML Files</title>
      <link>https://docs.microsoft.com/archive/blogs/stephap/choking-on-very-large-xml-files</link>
      <pubDate>Wed, 27 May 2009 01:20:42 GMT</pubDate>
      <dc:creator><![CDATA[Stephanie Peters]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/stephap/2009/05/27/choking-on-very-large-xml-files/</guid>
      <description><![CDATA[You probably don't know much about what I actually do at Microsoft (yet), so now would be a good...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: 'Arial','sans-serif'; font-size: 10pt">You probably don't know much about what I actually do at Microsoft (<em><span style="font-family: 'Arial','sans-serif'">yet</span></em>), so now would be a good time to mention that I typically support e-mail hosters who use Microsoft Hosted Messaging and Collaboration (HMC).&nbsp; These type of customer tend to have a lot (and I mean <strong><i><span style="font-family: 'Arial','sans-serif'">a lot</span></i></strong>) of Exchange configuration objects. They tend to have several thousand each of address lists, GALs, OABs and accepted domains for instance.<?xml:namespace prefix = o /><o:p></o:p></span></p> <p><span style="font-family: 'Arial','sans-serif'; font-size: 10pt">A typical XML file created by ExchDump (</span><a href="http://www.microsoft.com/downloads/details.aspx?familyid=d88b807d-964e-4bf8-9344-754892e9f637&amp;displaylang=en"><span style="font-family: 'Arial','sans-serif'; font-size: 10pt">http://www.microsoft.com/downloads/details.aspx?familyid=d88b807d-964e-4bf8-9344-754892e9f637&amp;displaylang=en</span></a><span style="font-family: 'Arial','sans-serif'; font-size: 10pt">) for one of these hosters might be 500MB+, while the HTML file will be almost as large and completely indigestible--if somehow you have enough system resources to open it in Internet Explorer.<o:p></o:p></span></p> <p><span style="font-family: 'Arial','sans-serif'; font-size: 10pt">I set about to break the XML into sections that I could actually use to gain some useful information.&nbsp; Naturally I turned to PowerShell.&nbsp; The first thing I tried was to load the file by foolishly casting the contents of the file to System.XML.XMLDocument.&nbsp; After waiting several minutes I realized what a dumb move that was.&nbsp; Thank you CTRL+C.&nbsp;&nbsp; From that point the task became all about text parsing.</span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Courier New'; color: #002060; font-size: 10pt">Param</span><span style="line-height: 115%; font-family: 'Courier New'; font-size: 10pt"> ( <span style="color: red">$FilePath</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"C:\Data"</span> )<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Courier New'; color: red; font-size: 10pt">$SubPath</span><span style="line-height: 115%; font-family: 'Courier New'; color: #0000cc; font-size: 10pt"> </span><span style="line-height: 115%; font-family: 'Courier New'; color: #a6a6a6; font-size: 10pt; mso-themecolor: background1; mso-themeshade: 166">=</span><span style="line-height: 115%; font-family: 'Courier New'; color: #0000cc; font-size: 10pt"> </span><span style="line-height: 115%; font-family: 'Courier New'; color: #632423; font-size: 10pt; mso-themecolor: accent2; mso-themeshade: 128">"$FilePath\ExchDumpObjects"</span><span style="line-height: 115%; font-family: 'Courier New'; color: #0000cc; font-size: 10pt"><o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Courier New'; color: #002060; font-size: 10pt">If</span><span style="line-height: 115%; font-family: 'Courier New'; font-size: 10pt">(<span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-not</span> (<span style="color: #0000cc">Test-Path</span> <span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"$SubPath"</span>)){<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Courier New'; color: #0000cc; font-size: 10pt"><span style="mso-spacerun: yes">&nbsp;&nbsp; </span>mkdir</span><span style="line-height: 115%; font-family: 'Courier New'; font-size: 10pt"> <span style="color: red">$SubPath<o:p></o:p></span></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Courier New'; font-size: 10pt">}<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Courier New'; color: red; font-size: 10pt">$ObjectString</span><span style="line-height: 115%; font-family: 'Courier New'; font-size: 10pt"> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> @()<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Courier New'; color: #0000cc; font-size: 10pt">type </span><span style="line-height: 115%; font-family: 'Courier New'; color: #632423; font-size: 10pt; mso-themecolor: accent2; mso-themeshade: 128">"$FilePath\ExchDump_*.xml"</span><span style="line-height: 115%; font-family: 'Courier New'; font-size: 10pt"> |<br><span style="mso-spacerun: yes">&nbsp; </span><span style="mso-spacerun: yes">&nbsp;</span><span style="color: #0000cc">%</span>{&nbsp; <br>&nbsp;&nbsp; <span style="mso-spacerun: yes">&nbsp;</span><span style="mso-spacerun: yes">&nbsp;</span><span style="mso-spacerun: yes">&nbsp;</span><span style="color: #002060">if</span>(<span style="color: red">$_</span>.trim() <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-eq</span> <span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"&lt;ADSI-Object&gt;"</span>) {<br><span style="color: green">#### "Start new Object!!!"</span><br><span style="mso-spacerun: yes">&nbsp;</span><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><span style="color: red">$ObjectString</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> @()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: red">$ObjectClass</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">""</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: red">$ObjectName</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">""</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: red">$ObjectString</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">+=</span> <span style="color: red">$_</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #002060">elseif</span>(<span style="color: red">$_</span>.trim() <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-eq</span> <span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"&lt;/ADSI-Object&gt;"</span>){<br><span style="color: green">#### "End object"<br></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: red">$ObjectString</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">+=</span> <span style="color: red">$_</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: red">$TickCount</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">= </span>(<span style="color: #0000cc">get-date</span>).ticks<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If(<span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-not</span> (<span style="color: #0000cc">Test-Path</span> (<span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"$SubPath\"</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">+</span> <span style="color: red">$ObjectClass</span>))){<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Courier New'; font-size: 10pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000cc">mkdir</span> (<span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"$SubPath\"</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">+</span> <span style="color: red">$ObjectClass</span>)<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Courier New'; font-size: 10pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: red">$ObjectString</span> | <span style="color: #0000cc">out-file </span>`<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Courier New'; font-size: 10pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"$SubPath\$ObjectClass\$($ObjectClass)_$ObjectName.$TickCount.xml"</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <span style="color: #002060">else </span>{<br><span style="color: green">#### "Continue object"<br></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: red">$ObjectString</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">+=</span> <span style="color: red">$_</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #002060">If</span>(<span style="color: red">$_</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-match</span> <span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"ADSI_Obj_Class"</span>){<br><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: red">$ObjectClass</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">=</span> <span style="color: red">$_</span>.Trim().Replace(<span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"&lt;ADSI_Obj_Class&gt;"</span>,<span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">""</span>)<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Courier New'; font-size: 10pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: red">$ObjectClass</span> = <span style="color: red">$ObjectClass</span>.Replace(<span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"&lt;/ADSI_Obj_Class&gt;"</span>,<span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">""</span>)<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Courier New'; font-size: 10pt"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: red">$ObjectClass</span> = <span style="color: red">$ObjectClass</span>.Trim()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #002060">ElseIf</span>(<span style="color: red">$_</span> <span style="color: #a6a6a6; mso-themecolor: background1; mso-themeshade: 166">-match</span> <span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"ADSI_Obj_Name"</span>){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: red">$ObjectName</span> = <span style="color: red">$_</span>.Trim().Replace(<span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"&lt;ADSI_Obj_Name&gt;"</span>,<span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">""</span>)<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Courier New'; font-size: 10pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: red">$ObjectName</span> = <span style="color: red">$ObjectName</span>.Replace(<span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"&lt;/ADSI_Obj_Name&gt;"</span>,<span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">""</span>)<o:p></o:p></span></p> <p style="line-height: 115%; margin: 0in 0in 0pt; background: #d9d9d9; mso-background-themecolor: background1; mso-background-themeshade: 217"><span style="line-height: 115%; font-family: 'Courier New'; font-size: 10pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: red">$ObjectName</span> = <span style="color: red">$ObjectName</span>.Replace(<span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">"CN="</span>,<span style="color: #632423; mso-themecolor: accent2; mso-themeshade: 128">""</span>).Trim()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><span style="mso-spacerun: yes">&nbsp;</span>&nbsp; }<o:p></o:p></span></p> <p class="MsoNormal">&nbsp;</p> <p class="MsoNormal"><font size="2">So to run the script, you can do one of two things—either place your xml file in the folder C:\Data which is the default directory where the script will look for it, or pass in the file folder as an argument.</font></p> <p class="MsoNormal"><font size="2">When you’re done, you’ll have a subfolder in the same folder with the ExchDump output named ExchDumpObjects.<span style="mso-spacerun: yes">&nbsp; </span>Inside that folder will be subfolders for each type of AD object that ExchDump gathered.<span style="mso-spacerun: yes">&nbsp; </span>Inside those folders, there will be a single XML file for each object collected by ExchDump.<span style="mso-spacerun: yes">&nbsp; </span>For instance if I wanted to find a particular OAB Object named “Demo OAL”, I would look for a file like “C:\Data\ExchDumpObjects\msExchOAB\msExchOAB_Demo OAL.*.xml”.<span style="mso-spacerun: yes">&nbsp; </span>You might find that ExchDump outputs the object multiple times.<span style="mso-spacerun: yes">&nbsp; </span>I’m not sure why that is, but the objects tend to be for the most part identical when that happens</font>.</p> <p class="MsoNormal">&nbsp;</p> <p class="MsoNormal"><font size="2">Once you’ve found the object you’re looking for, you may want to use PowerShell to parse it as well.<span style="mso-spacerun: yes">&nbsp; </span>This is sort of tricky because the XML which ExchDump uses isn’t the absolute best of formats.<span style="mso-spacerun: yes">&nbsp; </span>Here’s a snippet you can use for getting attributes out of those files:</font></p> <p class="MsoNormal"><font size="2"></font>&nbsp;</p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><font color="#ffffff"><b style="mso-bidi-font-weight: normal"><span style="font-family: 'Courier New'; color: yellow; font-size: 9pt">[PS]</span></b><b style="mso-bidi-font-weight: normal"><span style="font-family: 'Courier New'; font-size: 9pt"> $FP = "C:\Data\ExchDumpObjects\msExchOAB\msExchOAB_Demo OAL.*.xml"<o:p></o:p></span></b></font></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><font color="#ffffff"><b style="mso-bidi-font-weight: normal"><span style="font-family: 'Courier New'; color: yellow; font-size: 9pt">[PS]</span></b><b style="mso-bidi-font-weight: normal"><span style="font-family: 'Courier New'; font-size: 9pt"> $OAB = [xml] (type $FP)<o:p></o:p></span></b></font></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><font color="#ffffff"><b style="mso-bidi-font-weight: normal"><span style="font-family: 'Courier New'; color: yellow; font-size: 9pt">[PS]</span></b><b style="mso-bidi-font-weight: normal"><span style="font-family: 'Courier New'; font-size: 9pt"> $Atr = $oab."ADSI-Object".attribute | ?{$_.innertext -like "*offlineABContainers*"}<o:p></o:p></span></b></font></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><font color="#ffffff"><b style="mso-bidi-font-weight: normal"><span style="font-family: 'Courier New'; color: yellow; font-size: 9pt">[PS]</span></b><b style="mso-bidi-font-weight: normal"><span style="font-family: 'Courier New'; font-size: 9pt"> $Atr.attrib_val<o:p></o:p></span></b></font></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><b style="mso-bidi-font-weight: normal"><span style="font-family: 'Courier New'; font-size: 9pt"><font color="#ffffff"><span style="mso-spacerun: yes">&nbsp;</span>"CN=Demo AL,CN=All Address Lists,CN=Address Lists Container,CN=hmc,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=fabrikam,DC=net" <o:p></o:p></font></span></b></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><font color="#ffffff"><b style="mso-bidi-font-weight: normal"><span style="font-family: 'Courier New'; color: yellow; font-size: 9pt">[PS]</span></b><b style="mso-bidi-font-weight: normal"><span style="font-family: 'Courier New'; font-size: 9pt"> $Atr = $oab."ADSI-Object".attribute | ?{$_.innertext -like "*offlineABServer*"}<o:p></o:p></span></b></font></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><font color="#ffffff"><b style="mso-bidi-font-weight: normal"><span style="font-family: 'Courier New'; color: yellow; font-size: 9pt">[PS]</span></b><b style="mso-bidi-font-weight: normal"><span style="font-family: 'Courier New'; font-size: 9pt"> $Atr.attrib_val<o:p></o:p></span></b></font></p> <p style="margin-bottom: 0pt; background: black; mso-background-themecolor: text1" class="MsoNormal"><b style="mso-bidi-font-weight: normal"><span style="font-family: 'Courier New'; font-size: 9pt"><font color="#ffffff"><span style="mso-spacerun: yes">&nbsp;</span>"CN=OAB01,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=hmc,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=fabrikam,DC=net "<o:p></o:p></font></span></b></p> <p class="MsoNormal"><o:p>&nbsp;</o:p></p> <p><span style="font-family: 'Arial','sans-serif'; font-size: 10pt">(As a side note, yes, a lot of my scripts will be just as esoteric as this one.<span style="mso-spacerun: yes">&nbsp; </span>It’s super fantastic if you find yourself in the same exact predicament as me, but that’s not very likely unless you are supporting a very large e-mail hoster.<span style="mso-spacerun: yes">&nbsp; </span>The same sort of technique may apply to other scenarios where you have very large XML files, but for the most part this is a niche script.)<o:p></o:p></span></p> <p class="MsoNormal"><span style="mso-bidi-font-size: 11.0pt"><o:p>&nbsp;</o:p></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Is this thing on?</title>
      <link>https://docs.microsoft.com/archive/blogs/stephap/is-this-thing-on</link>
      <pubDate>Tue, 19 May 2009 17:21:00 GMT</pubDate>
      <dc:creator><![CDATA[Stephanie Peters]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/stephap/2009/05/19/is-this-thing-on/</guid>
      <description><![CDATA[I was under the impression that blogging was for people who kept diaries as children and always send...]]></description>
      <content:encoded><![CDATA[<P>I was under the impression that blogging was for people who kept diaries as children and always send out&nbsp;holiday cards and Thank You notes.&nbsp; (Unfortunately despite my best intention, I'm not a member of that well bred club.)&nbsp; Recently though I've had several ideas kicking around that I want to share with the IT community, so I bit the bullet and started the blog.</P>
<P>My objective for the tentatively named "Something About Scripting" is to share some of my experiences and scripts with whomever might be interested in them.&nbsp; I've spent almost my whole career in Product Support, so my scripts are generally of a certain flavor--building labs for reproducing proplems, diagnosing problems, collecting wide swaths of information to understand problems, etc.&nbsp; You get the picture.&nbsp; Every now and again I might have something a little more fun and a little less practical in the IT space.</P>
<P>Hope this helps someone.</P>
<P mce_keep="true">&nbsp;</P>]]></content:encoded>
    </item>
  </channel>
</rss>