<?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>Got-PowerShell 2.0?</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/judith_herman/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/judith_herman/feed.xml</link>
    <description>Collecting PowerShell tips and tricks one line at a time</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:36:20 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Reading in the Help File with Get-Content (Part 2 of 2)</title>
      <link>https://docs.microsoft.com/archive/blogs/judith_herman/reading-in-the-help-file-with-get-content-part-2-of-2</link>
      <pubDate>Wed, 02 Jun 2010 05:22:00 GMT</pubDate>
      <dc:creator><![CDATA[JudithH [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/judith_herman/2010/06/02/reading-in-the-help-file-with-get-content-part-2-of-2/</guid>
      <description><![CDATA[What I did in the previous blog post was create a glorified way to read in the content from an XML...]]></description>
      <content:encoded><![CDATA[<p>What I did in the <a href="http://blogs.technet.com/b/judith_herman/archive/2010/06/01/reading-a-powershell-help-file-with-get-content-part-1-of-2.aspx" title="previous blog post">previous blog post</a> was create a glorified way to read in the content from an XML file, specifically, one of the PowerShell help files, and turn it into plain text. Wow! Not all the useful since I&rsquo;d have to figure out a way to search for text in the file. Instead, what I now want to talk about is how to read in the contents of an XML file while telling PowerShell to treat the object as XML. This will change how&nbsp;I navigate through the file.</p>
<p>Let&rsquo;s start with creating a new object, I&rsquo;ll call <strong>$help_xml</strong>, and this time we&rsquo;ll cast the object as XML. And there I go again with that word, cast. At it's most basic, all this means is that I will tell PowerShell to specifically interpret the file contents as XML and make the object an XML object. And as we saw from part 1, if I didn't do this, Get-Content would read in the XML file as plain text by default.</p>
<p>And here&rsquo;s how I make sure Get-Content reads in the help file as XML.&nbsp;In&nbsp;an opened,&nbsp;PowerShell console, I type:</p>
<blockquote>
<p><strong>$help_xml =<span style="color: #ff0000;"> [xml]</span> (Get-Content $pshome\en-us\System.Management.Automation.dll-Help.xml)</strong></p>
<p style="text-align: left;">(Notice that the only difference between this object creation and the $help_plain from the part 1 is the<strong> [xml]</strong> type specification, which I've highlighted in red to make it perfectly clear.)</p>
<p>I get a different result from displaying the contents of this object:</p>
</blockquote>
<blockquote>
<p>PS C:\&gt; <strong>$help_xml</strong> </p>
<p>xml&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;&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;&nbsp;&nbsp; helpItems <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;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --------- <br />version="1.0" encoding="utf-8"&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; helpItems</p>
</blockquote>
<p>Much different from a listing of the file. That&rsquo;s because my new object, <strong>$help_xml</strong>, has the properties and methods of an xml object. I know from various books and web tutorials that an xml file is structured so that the information is contained in elements with attributes. Knowing the structure of an XML file, i.e. what the elements inside a file are,&nbsp;will let you pull out the information by referencing the elements by name. And when you create a PowerShell object that represents XML information, then the elements and attributes in XML show up as properties of the PowerShell object. Quite a mouthful, but it translates into being able to use the PowerShell object dotted notation to find things in the object that represents an XML file read in by Get-Content.</p>
<p>Going back to our example, in the help file, we displayed the $help_xml file&nbsp;as a&nbsp;list of two properties called: xml and helpItems. How do I know this? Well, I can use the <strong>Get-Member</strong> cmdlet to see just the properties for the $help_xml object.</p>
<blockquote>
<p>PS C:\&gt; $help_xml | gm -MemberType properties </p>
<p>&nbsp;&nbsp; TypeName: System.Xml.XmlDocument </p>
<p>Name&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MemberType Definition <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;&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; ---------- ---------- <br />helpItems&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;System.Xml.<strong>XmlElement</strong> helpItems {get;} <br />xml&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.String xml {get;set;}</p>
</blockquote>
<p>In the above definition the property, helpItems, is defined as an XML element. The way XML documents work is that they always start with a single top or root node and have child nodes inside that root node. (If you aren&rsquo;t very familiar with XML, there are lots of tutorials on the web. A book I&rsquo;ve used to learn about XML is the XML Pocket Consultant by William R. Stanek. And feel free to add other book references for XML in the comments section.) </p>
<p>Knowing that helpItems is the root node, I can &ldquo;walk the tree&rdquo; using PowerShell dotted notation. </p>
<blockquote>
<p>PS C:\&gt; $help_xml<strong><span style="color: #ff0000;"><span style="font-size: large;">.</span></span>helpItems</strong> </p>
<p>schema&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #comment&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;command&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;providerHelp <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;&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;&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; ------------ <br />maml&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { v 1.1.0.9 ,&nbsp; v 1.1.0.9 ,...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{command:command, :...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{...</p>
</blockquote>
<p>Now, I see there are 4 properties of the <strong>helpItems</strong> node. I can also look at the properties using Get-Member again.</p>
<blockquote>
<p>PS C:\&gt; $help_xml.helpItems | gm -MemberType properties </p>
<p>&nbsp;&nbsp; TypeName: System.Xml.XmlElement </p>
<p>Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MemberType Definition <br />----&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---------- ---------- <br />#comment&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.Object[] #comment {get;} <br />command&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.Object[] command {get;} <br />providerHelp&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp;&nbsp;System.Object[] providerHelp {get;} <br />schema&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Property&nbsp;&nbsp; System.String schema {get;set;}</p>
</blockquote>
<p>I could keep walking down through these properties. And I plan to. </p>
<p>Specifically, the next blog posts will be about rifling through the command and providerHelp properties to ferret out the help information from the file. Once I see where the information is located I can start figuring out how to create some simple scripts to pull out the information. And then I should be able to run the script for any PowerShell help file. </p>
<p>In the meantime, feel free to roam around the files yourself to discover what&rsquo;s there. As long as you don't write content back to the file&nbsp;(for example don't&nbsp;do a Set-Content), you should not have any effect to the help file itself.&nbsp;</p>
<p>And if this sparks questions or comments, please do post them in the comments section of this blog.</p>]]></content:encoded>
    </item>
    <item>
      <title>Navigating XML Files with PowerShell (Using the Help File as an example)</title>
      <link>https://docs.microsoft.com/archive/blogs/judith_herman/navigating-xml-files-with-powershell-using-the-help-file-as-an-example</link>
      <pubDate>Tue, 01 Jun 2010 17:39:00 GMT</pubDate>
      <dc:creator><![CDATA[JudithH [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/judith_herman/2010/06/01/navigating-xml-files-with-powershell-using-the-help-file-as-an-example/</guid>
      <description><![CDATA[In the blog post called, Reading in the Help File with Get-Content (Part 2 of 2), I started the...]]></description>
      <content:encoded><![CDATA[<p>In the blog post called, <a href="http://blogs.technet.com/b/judith_herman/archive/2010/06/03/reading-in-the-help-file-with-get-content-part-2-of-2.aspx" title="Reading in the Help File with Get-Content (Part 2 of 2)">Reading in the Help File with Get-Content (Part 2 of 2)</a>, I started the process of roaming around the PowerShell help file. </p>
<p>I followed the process I'm going to talk through when I needed to build some quick scripts that checked all of our Windows Server help files to make sure we had completely filled out the required fields.&nbsp;But before I could&nbsp;write scripts to automate the&nbsp;file verification, I first needed to know what I was looking to verify. &nbsp;So, in a sense, I&rsquo;m more crawling through the file, than walking.</p>
<h1></h1>
<h2>What Am I Looking For?</h2>
<p>I can see the skeleton of the information I want from the help file when I run, <strong>get-help get-help &ndash;full </strong>and distill the titles of the sections. (I could have used any cmdlet to see the section headers, so generalized it would be get-help &lt;cmdlet name&gt; -full</p>
<blockquote>
<p><strong>NAME</strong></p>
<p><strong>SYNOPSIS</strong></p>
<p><strong>SYNTAX</strong>&nbsp;&nbsp;&nbsp; </p>
<p><strong>DESCRIPTION</strong>&nbsp;&nbsp;&nbsp; </p>
<p><strong>PARAMETERS</strong></p>
<p><strong>INPUTS</strong></p>
</blockquote>
<blockquote>
<p><strong>OUTPUTS</strong>&nbsp;</p>
</blockquote>
<blockquote>
<p><strong>NOTES</strong> </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; --------------------------<strong> EXAMPLE 1</strong> --------------------------&nbsp; </p>
</blockquote>
<blockquote>
<p>&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 style="font-size: medium;"><strong>&hellip;</strong></span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -------------------------- <strong>EXAMPLE 15</strong> -------------------------- </p>
</blockquote>
<blockquote>
<p><strong>RELATED LINKS</strong></p>
</blockquote>
<h2>Rereading the PowerShell Help File (recap from last blog post)</h2>
<p><span style="color: #888888;"><span style="font-size: x-small;"><span style="color: #000000;"><span style="font-size: small;">In the past blog post, I had made it down to the level where I could see an element known as command. I've repeated the two sets of commands here so we can get started together (I&rsquo;ve highlighted the two lines of commands I typed in):</span></span></span></span></p>
<blockquote>
<p>PS C:\&gt;<strong> $help_xml = [xml] (Get-Content $pshome\en-us\System.Management.Automation.dll-Help.xml)</strong></p>
<p>PS C:\&gt; <strong>$help_xml.helpItems | gm -MemberType properties</strong> </p>
<p>&nbsp;&nbsp; TypeName: System.Xml.XmlElement </p>
<p>Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MemberType Definition <br />----&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---------- ---------- <br />#comment&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.Object[] #comment {get;} <br />command&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.Object[] command {get;} <br />providerHelp Property&nbsp;&nbsp; System.Object[] providerHelp {get;} <br />schema&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.String schema {get;set;}</p>
</blockquote>
<p><span style="font-size: small;">Let&rsquo;s go down one level to see what child nodes are inside the command XML node: (How did I know to look at the command node? Well, I want to see information for cmdlet help. This pretty much rules out the other three nodes based on their names.)</span></p>
<blockquote>
<p>PS C:\&gt; <strong>$help_xml.helpItems.command | gm -MemberType properties</strong> </p>
<p>&nbsp;&nbsp; TypeName: System.Xml.XmlElement#<a href="http://schemas.microsoft.com/maml/dev/command/2004/10#command">http://schemas.microsoft.com/maml/dev/command/2004/10#command</a></p>
<p>Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MemberType Definition <br />----&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---------- ---------- <br />#comment&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.Object[] #comment {get;} <br />alertSet&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.Xml.XmlElement alertSet {get;} <br />command&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.String command {get;set;} <br />description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.Xml.XmlElement description {get;} <br />details&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.Xml.XmlElement details {get;} <br />dev&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.String dev {get;set;} <br />examples&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.Xml.XmlElement examples {get;} <br />inputTypes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.Xml.XmlElement inputTypes {get;} <br />maml&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.String maml {get;set;} <br />nonTerminatingErrors Property&nbsp;&nbsp; System.String nonTerminatingErrors {get;set;} <br />parameters&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.Xml.XmlElement parameters {get;} <br />relatedLinks&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.Xml.XmlElement relatedLinks {get;} <br />returnValues&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.Xml.XmlElement returnValues {get;} <br />syntax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.Xml.XmlElement syntax {get;} <br />terminatingErrors&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp; System.String terminatingErrors {get;set;}</p>
</blockquote>
<p><span style="font-size: small;">So, it looks like <strong>$help_xml.helpItems.command</strong> contains the cmdlet help topics I'm interested in. Some of the element/property names correspond to the section titles I&rsquo;m looking for: description, examples, syntax, parameters, relatedLinks. Others seem close: inputTypes and returnValues. I don&rsquo;t see notes, but there is an element called details, which might have more information. </span></p>
<p><span style="font-size: small;">Instead of looking at the properties of the $help_xml.helpItems.command members, let&rsquo;s look at what happens when I just type $help_xml.helpItems.command&nbsp; and press enter from the PowerShell command line:</span></p>
<blockquote>
<p>PS C:\&gt; <strong>$help_xml.helpItems.command</strong> </p>
<p>maml&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : <a href="http://schemas.microsoft.com/maml/2004/10">http://schemas.microsoft.com/maml/2004/10</a> <br />command&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : <a href="http://schemas.microsoft.com/maml/dev/command/2004/10">http://schemas.microsoft.com/maml/dev/command/2004/10</a> <br />dev&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : <a href="http://schemas.microsoft.com/maml/dev/2004/10">http://schemas.microsoft.com/maml/dev/2004/10</a> <br />details&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : details <br />description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : description <br />#comment&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : { Cmdlet syntax section,&nbsp; Cmdlet parameter section&nbsp; ,&nbsp; Input - Output section,&nbsp; Error section... <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br />syntax&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : syntax <br />parameters&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : parameters <br />inputTypes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : inputTypes <br />returnValues&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : returnValues <br />terminatingErrors&nbsp;&nbsp;&nbsp; : <br />nonTerminatingErrors : <br />alertSet&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : alertSet <br />examples&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : examples <br />relatedLinks&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : relatedLinks</p>
<p><strong><span style="font-size: medium;">&hellip;</span></strong></p>
</blockquote>
<p><span style="font-size: small;">I&rsquo;ve only displayed the first command that is spewed when you type <strong>$help_xml.helpItems.command</strong>. What you&rsquo;ll see if you try this for yourself is a spew of listings that all appear the same &ndash; no actual information, though. Because we&rsquo;re seeing multiple copies, I suspect that command is actually an array. Let&rsquo;s look at the first element of command details.</span></p>
<blockquote>
<p><span style="font-size: small;">PS C:\&gt; <strong>$help_xml.helpItems.command[0].details</strong> </span></p>
<p>name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : <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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Add-History </p>
<p>description : description <br />copyright&nbsp;&nbsp; : copyright <br />verb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Add <br />noun&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : History <br />version&nbsp;&nbsp;&nbsp;&nbsp; :</p>
</blockquote>
<p><span style="font-size: small;">Woo hoo! OK, we&rsquo;ve hit pay dirt here. Here is the name (Add-History) along with&nbsp;more elements&nbsp;providing verb (Add) and noun (History). And if we want to display just the name of the cmdlet we can run:</span></p>
<blockquote>
<p>PS C:\&gt; <strong>$help_xml.helpItems.command[0].details.name</strong> </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Add-History</p>
</blockquote>
<p><span style="font-size: small;">But maybe we want to look at a different command, maybe the 100th command in the file. If we do this here&rsquo;s what we see:</span></p>
<blockquote>
<p>PS C:\&gt; $help_xml.helpItems.command[100].details <br />PS C:\&gt;</p>
</blockquote>
<p><span style="font-size: small;">Not very enlightening, but unless we specifically setup to trap an error, we might not see one. I&rsquo;m guessing we might have put in too large an index for the array of $help_xml.helpItems.command We can find length of the array (number of cmdlets that have help specified in this file) by running:</span></p>
<blockquote>
<p>PS C:\&gt; <strong>$help_xml.helpItems.command.length</strong> <br />42</p>
</blockquote>
<p><span style="font-size: small;">Because PowerShell arrays are zero indexed,&nbsp;the maximum&nbsp;index is length - 1.&nbsp;In this case, if we keep the index to ((length=42) - 1) = 41 and under, we&rsquo;ll get a result. For the index 41,</span></p>
<blockquote>
<p>PS C:\&gt; <strong>$help_xml.helpItems.command[41].details</strong> </p>
<p>name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : <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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Where-Object </p>
<p>description : description <br />copyright&nbsp;&nbsp; : copyright <br />verb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Where <br />noun&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Object <br />version&nbsp;&nbsp;&nbsp;&nbsp; :</p>
</blockquote>
<p><span style="font-size: small;">Let&rsquo;s go a little further and see what&rsquo;s under description:</span></p>
<blockquote>
<p><span style="font-size: x-small;">PS C:\&gt; </span><strong><span style="font-size: x-small;">$help_xml.helpItems.command</span>[41].details.description </strong></p>
<p>para <br />---- <br />Creates a filter that controls which objects will be passed along a command pipeline.</p>
</blockquote>
<p><span style="font-size: small;">Comparing to the results from <strong>Get-Help Where-Object &ndash;full</strong>, this looks like what we&rsquo;ve been seeing as the synopsis. That means we can get the short description or synopsis&nbsp; text directly with the dotted notation with para at the end:</span></p>
<blockquote>
<p>PS C:\&gt; <strong>$help_xml.helpItems.command[41].details.description.para</strong> <br />Creates a filter that controls which objects will be passed along a command pipeline.</p>
</blockquote>
<h2>To Recap What We&rsquo;ve Found in the PowerShell Help File So Far</h2>
<table cellpadding="2" cellspacing="0" border="1" style="width: 486px;">
<tbody>
<tr>
<td width="200" valign="top"><span style="font-size: small;">Steps</span></td>
<td width="284" valign="top"><span style="font-size: small;">Command</span></td>
</tr>
<tr>
<td width="200" valign="top"><span style="font-size: small;">Read in XML file as XML</span></td>
<td width="284" valign="top"><span style="font-size: small;">$help_xml = [xml] (Get-Content $pshome\en-us\System.Management.Automation.dll-Help.xml)</span></td>
</tr>
<tr>
<td width="200" valign="top"><span style="font-size: small;">Find out how many cmdlets we have help for in file</span></td>
<td width="284" valign="top"><span style="font-size: small;">$help_xml.helpItems.command.length <br /></span></td>
</tr>
<tr>
<td width="200" valign="top"><span style="font-size: small;">Print out name of cmdlet N, where N is the index into the command array</span></td>
<td width="284" valign="top"><span style="font-size: small;">$help_xml.helpItems.command[N].details.name</span></td>
</tr>
<tr>
<td width="200" valign="top"><span style="font-size: small;">Print out short description or synopsis of cmdlet N, where N is the index into command array</span></td>
<td width="284" valign="top"><span style="font-size: small;">$help_xml.helpItems.command[N].details.description.para <br /></span></td>
</tr>
</tbody>
</table>
<p><span style="font-size: small;">We&rsquo;re still looking for syntax, full description, parameters with description, inputs,&nbsp;outputs, notes, examples, and related links. Feel free to look around for these on your own. I will be continuing to hunt down more information within the PowerShell help file in the next blog post.</span></p>
<p><span style="font-size: small;">And again, let me know what other XML files you think we should walk through as an exercise when we&rsquo;re done with this file. Feel free to post suggestions in the comment sections of this post. Looking to hear from you soon. -- Judith</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Reading a PowerShell Help File with Get-Content (Part 1 of 2)</title>
      <link>https://docs.microsoft.com/archive/blogs/judith_herman/reading-a-powershell-help-file-with-get-content-part-1-of-2</link>
      <pubDate>Tue, 01 Jun 2010 15:21:00 GMT</pubDate>
      <dc:creator><![CDATA[JudithH [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/judith_herman/2010/06/01/reading-a-powershell-help-file-with-get-content-part-1-of-2/</guid>
      <description><![CDATA[I know the location, $PShome\en-us\ or&nbsp; C:\Windows\System32\WindowsPowerShell\v1.0\en-us, and...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: x-small;">I know the location, <strong>$PShome\en-us\</strong> or&nbsp; <strong>C:\Windows\System32\WindowsPowerShell\v1.0\en-us</strong>, and name of the help file, <strong>System.Management.Automation.dll-Help.xml</strong>, that&nbsp;&nbsp;I&rsquo;m going to read. We found that in the <a href="http://blogs.technet.com/b/judith_herman/archive/2010/05/31/playing-around-with-xml-files-without-screwing-them-up.aspx" title="previous blog post">previous blog post</a>.&nbsp; Ultimately, I want to show you the difference between reading in the file with <strong>Get-Content</strong> and reading in the file with <strong>Get-Content</strong> and casting it as XML.</span></p>
<p><strong><span style="font-size: medium;">Reading a PowerShell Help File with Get-Content as Plain Text</span></strong></p>
<p><span style="font-size: x-small;">I&rsquo;m going to define an object called, $help_plain, that represents the contents of the help file when read using Get-Content:</span></p>
<blockquote>
<p><span style="font-size: x-small;">$help_plain=Get-Content $pshome\en-us\System.Management.Automation.dll-Help.xml</span></p>
</blockquote>
<p><span style="font-size: x-small;">And when I type the name of the object and press enter, </span></p>
<blockquote>
<p><span style="font-size: x-small;">$help_plain</span></p>
</blockquote>
<p><span style="font-size: x-small;">the whole contents of the help file will be spewed. The listing for several of the lines look something like this:</span></p>
<blockquote>
<p><span style="font-family: System; font-size: xx-small;">PS C:\&gt; $help_plain <br />&lt;?xml version="1.0" encoding="utf-8" ?&gt; </span></p>
<p><span style="font-family: System; font-size: xx-small;">&lt;helpItems schema="maml"&gt; </span></p>
<p><span style="font-family: System; font-size: xx-small;">&lt;!-- v 1.1.0.9 --&gt; <br />&lt;command:command xmlns:maml="</span><a href="http://schemas.microsoft.com/maml/2004/10&quot;"><span style="font-family: System; font-size: xx-small;">http://schemas.microsoft.com/maml/2004/10"</span></a><span style="font-family: System; font-size: xx-small;"> xmlns:command="</span><a href="http://schemas.microsoft.com/mam"><span style="font-family: System; font-size: xx-small;">http://schemas.microsoft.com/mam</span></a> <br /><span style="font-family: System; font-size: xx-small;">l/dev/command/2004/10" xmlns:dev="</span><a href="http://schemas.microsoft.com/maml/dev/2004/10&quot;"><span style="font-family: System; font-size: xx-small;">http://schemas.microsoft.com/maml/dev/2004/10"</span></a><span style="font-family: System; font-size: xx-small;">&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;command:details&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;command:name&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Add-History <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/command:name&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;maml:description&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;maml:para&gt;Appends entries to the session history.&lt;/maml:para&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/maml:description&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;maml:copyright&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;maml:para&gt;&lt;/maml:para&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/maml:copyright&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;command:verb&gt;Add&lt;/command:verb&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;command:noun&gt;History&lt;/command:noun&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dev:version&gt;&lt;/dev:version&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/command:details&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;maml:description&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;maml:para&gt;The Add-History cmdlet adds entries to the end of the session history, that is, the list of commands entered during the current session.</span></p>
<p style="padding-left: 120px;"><span style="font-family: System;"><span style="font-size: small;"><strong>...</strong></span></span></p>
</blockquote>
<p>Now, this looks suspiciously like a listing of the file, if I were to just type it or open the file in notepad. Except, what I have is the contents of the file in an object that has read in each line separately. So, this object can be thought of as an array of lines of text.</p>
<p>If I want to see only the first line of the file, then I can add the index position to the object:</p>
<blockquote>
<p><span style="font-family: System;">$help_plain[0]</span></p>
</blockquote>
<p>Displays the first line of the file:</p>
<blockquote>
<p><span style="font-family: System;">&lt;?xml version="1.0" encoding="utf-8" ?&gt;</span></p>
</blockquote>
<p>As a side note, the book &ldquo;Windows PowerShell 2.0 Administrator&rsquo;s Pocket Consultant&rdquo; by William R. Stanek, has a nice chapter on working with arrays. On page 161, he shows how you can use the range operator (..) with an array. In my case, I might want to display say the first ten lines of the help file that was read into the $help_plain object. </p>
<blockquote>
<p><span style="font-family: System;">PS C:\&gt;<strong><span style="font-size: small;"> $help_plain[0..9]</span></strong> <br />&lt;?xml version="1.0" encoding="utf-8" ?&gt; </span></p>
<p><span style="font-family: System;">&lt;helpItems schema="maml"&gt; </span></p>
<p><span style="font-family: System;">&lt;!-- v 1.1.0.9 --&gt; <br />&lt;command:command xmlns:maml="</span><a href="http://schemas.microsoft.com/maml/2004/10&quot; xmlns:command=&quot;http://schemas.microsoft.com/mam"><span style="font-family: System;">http://schemas.microsoft.com/maml/2004/10" xmlns:command="</span></a><a href="http://schemas.microsoft.com/mam"><span style="font-family: System;">http://schemas.microsoft.com/mam</span></a><a></a><span style="font-family: System;"> <br />l/dev/command/2004/10" xmlns:dev="</span><a href="http://schemas.microsoft.com/maml/dev/2004/10&quot;"><span style="font-family: System;">http://schemas.microsoft.com/maml/dev/2004/10"</span></a><span style="font-family: System;">&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;command:details&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;command:name&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Add-History <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/command:name&gt;</span></p>
</blockquote>
<p><span style="font-size: x-small;">In the above, I'm already seeing an element from the help file called, name. And the element contains a name of a cmdlet called, Add-History. Go figure. So, it looks like if we grovel through the file, we should be able to figure out which elements contain the information I want to pull out of the file. And if I could search by elements that would be helpful. But in the current form that I've read in, I'm stuck with having to parse out the text because that's how I've read in the file as plain text.</span></p>
<p><span style="font-size: x-small;">So, to recap, I was able to read in the help file, but it came in as plain text, which doesn&rsquo;t help me with parsing the information in the file. On the upside, I learned that the file was read in one line per array element and I can display separate lines from the file using the element notation [] and range operator [..]</span></p>
<p><span style="font-size: x-small;">To get what I want out of the help file, I&rsquo;ll have to try a different way. That&rsquo;s what I&rsquo;ll do in the next blog post.</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Playing Around with XML Files Using PowerShell Without Screwing them Up</title>
      <link>https://docs.microsoft.com/archive/blogs/judith_herman/playing-around-with-xml-files-using-powershell-without-screwing-them-up</link>
      <pubDate>Mon, 31 May 2010 15:20:00 GMT</pubDate>
      <dc:creator><![CDATA[JudithH [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/judith_herman/2010/05/31/playing-around-with-xml-files-using-powershell-without-screwing-them-up/</guid>
      <description><![CDATA[For example, let&rsquo;s use a file we can all play with because it comes with PowerShell....]]></description>
      <content:encoded><![CDATA[<p>For example, let&rsquo;s use a file we can all play with because it comes with PowerShell. Let&rsquo;s use a help file from which cmdlet help is generated when you use the <strong>Get-Help</strong> cmdlet. The basic help files are located in the language dependent directory under the PowerShell home directory. In my case, I am using the US English system, so I&rsquo;ll find the help files when I run the following command in my PowerShell session:</p>
<blockquote>
<p>dir $PShome\en-us\*.xml</p>
</blockquote>
<p>Which returns the following list of files for my system:</p>
<p>&nbsp;&nbsp;&nbsp; Directory: C:\Windows\System32\WindowsPowerShell\v1.0\en-us </p>
<p>Mode&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LastWriteTime&nbsp;&nbsp;&nbsp;&nbsp; Length Name <br />----&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -------------&nbsp;&nbsp;&nbsp;&nbsp; ------ ---- <br />-a---&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6/10/2009&nbsp;&nbsp; 3:37 PM&nbsp;&nbsp;&nbsp;&nbsp; 160510 Microsoft.PowerShell.Commands.Diagnostics.dll-Help.xml <br />-a---&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6/10/2009&nbsp;&nbsp; 3:22 PM&nbsp;&nbsp;&nbsp; 1957661 Microsoft.PowerShell.Commands.Management.dll-Help.xml <br />-a---&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6/10/2009&nbsp;&nbsp; 3:22 PM&nbsp;&nbsp;&nbsp; 1602040 Microsoft.PowerShell.Commands.Utility.dll-Help.xml <br />-a---&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6/10/2009&nbsp;&nbsp; 3:22 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 15869 Microsoft.PowerShell.ConsoleHost.dll-Help.xml <br />-a---&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6/10/2009&nbsp;&nbsp; 3:22 PM&nbsp;&nbsp;&nbsp;&nbsp; 154493 Microsoft.PowerShell.Security.dll-Help.xml <br />-a---&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6/10/2009&nbsp;&nbsp; 3:37 PM&nbsp;&nbsp;&nbsp;&nbsp; 538884 Microsoft.Wsman.Management.dll-Help.xml <br />-a---&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6/10/2009&nbsp;&nbsp; 3:22 PM&nbsp;&nbsp;&nbsp; 1268150 System.Management.Automation.dll-Help.xml</p>
<p>Now, I&rsquo;m going to pick the last file in the list, <strong>System.Management.Automation.dll-Help.xml </strong></p>
<p>Why that one? Well, I cheated. I already know this is the help file that contains the help text for the basic PowerShell commands, like <strong>Get-Help</strong>. But all the files are structured the same way. Once I show you how to walk through one help file, you can do the same thing for any of the help files. Even for modules or snap-ins. That&rsquo;s the beauty of XML files. They're all structured the same way.</p>
<p>We&rsquo;ve found some files that we can look at together because these files come with PowerShell 2.0. And now that I know you can follow along in the coming blog entries here&rsquo;s what I&rsquo;m going to do:</p>
<ol>
<li>Read a PowerShell help file using Get-Content as Plain Text (Reading the file part 1 of 2)</li>
<li>Read a PowerShell help file using Get-Content as XML (Reading the file part 2 of 2)</li>
<li>Navigate through the Lower Depths of the PowerShell Help File </li>
<li>Now, let&rsquo;s start automating parsing the PowerShell help file </li>
</ol>]]></content:encoded>
    </item>
    <item>
      <title>Reading or Importing or Parsing XML files with PowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/judith_herman/reading-or-importing-or-parsing-xml-files-with-powershell</link>
      <pubDate>Thu, 27 May 2010 14:33:00 GMT</pubDate>
      <dc:creator><![CDATA[JudithH [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/judith_herman/2010/05/27/reading-or-importing-or-parsing-xml-files-with-powershell/</guid>
      <description><![CDATA[Unfortunately, a lot of the books that talk about XML files were written by and for programmers. So,...]]></description>
      <content:encoded><![CDATA[<p>Unfortunately, a lot of the books that talk about XML files were written by and for programmers. So, you&rsquo;ll see all sorts of frightening and confusing terms like XMLreader, streamreader, schema, XPath and other foreign terms. (I know they always give me pause -- way too complicated.) And a lot of the PowerShell books continue in this vein. This is truly unfortunate because, if you&rsquo;re looking for a lightweight way to grovel through XML files, PowerShell will be your best friend. I know it became my best friend when I needed a quick way to view the contents of the help files and make sure all the fields were filled in for the help we generated for Windows Server 2008 R2.</p>
<p>So, I&rsquo;m going to share a secret that I learned from reading chapter 8 of the &ldquo;Windows PowerShell Cookbook&rdquo; by Lee Holmes. </p>
<table cellpadding="2" cellspacing="0" border="3" style="width: 450px;">
<tbody>
<tr>
<td width="445" valign="top"><span style="background-color: #ffff99;">When reading an XML file into a PowerShell object using the <strong>Get-Content</strong> make sure you cast it as XML.</span> </td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>Yikes! What is this cast business and why can&rsquo;t I speak English anymore? Is what I&rsquo;m sure you&rsquo;re asking. And how is this making anything easier. </p>
<p>Let&rsquo;s take this one step at a time. Most PowerShell books will teach you to read in a file using the <strong>Get-Content</strong> cmdlet. The description of what Get-Content does is:&nbsp; </p>
<blockquote>
<p><span style="background-color: #ffffff;">The Get-Content cmdlet gets the content of the item at the location specified by the path, such as the<span style="color: #ff0000;"><strong> text in a file</strong></span>. It reads the content one line at a time and returns an object for each line.</span></p>
</blockquote>
<p>This definition tells me that<strong> Get-Content</strong> will read in the contents from a file as plain text.</p>
<p>Plenty of PowerShell books show you how to do this. However, if you read in the file as plain text, you are back to parsing through the text. And for XML files, I will be using my above secret to show you a much, much easier way. But before I can do that I have to find a file that all of us can look at together. That way you can follow along with me. And that&rsquo;s what I&rsquo;m going to do in the next blog post.</p>
<p>Stay tuned&hellip;</p>
<p>(Oh, and while you&rsquo;re waiting, if you have suggestions of XML files from Windows Server that you&rsquo;re wondering how to take them apart with PowerShell, please list the files in the comments section. Once I get going we&rsquo;ll look at a number of suggestions.)</p>]]></content:encoded>
    </item>
    <item>
      <title>Yes, I’m lame. Now, let’s talk import all modules</title>
      <link>https://docs.microsoft.com/archive/blogs/judith_herman/yes-im-lame-now-lets-talk-import-all-modules</link>
      <pubDate>Wed, 26 May 2010 14:49:00 GMT</pubDate>
      <dc:creator><![CDATA[JudithH [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/judith_herman/2010/05/26/yes-im-lame-now-lets-talk-import-all-modules/</guid>
      <description><![CDATA[Major apologies for letting this blog get stale.
But I&rsquo;m back now and ready to go with...]]></description>
      <content:encoded><![CDATA[<p>Major apologies for letting this blog get stale.</p>
<p>But I&rsquo;m back now and ready to go with talking about easy tips and tricks for PowerShell 2.0. </p>
<p>If there are things you have been trying to do with PowerShell, especially with administrating Windows, feel free to list those tasks in the comments section.</p>
<p>Or if you have tricks you&rsquo;d like to share, feel free to list those tips and tricks in the comments section.</p>
<p>Sorry to be gone so long. Glad to be back.</p>
<p>------------------------------------------------------</p>
<p>If you've played around with PowerShell on Windows Server 2008 R2 then you already know that you can add cmdlets for different roles and features. And these cmdlets are contained in different modules or snap-ins that must be imported or added each time you open a new PowerShell window. Pretty lame, but wait, there's actually a way to add all modules and snap-ins at one time.</p>
<p>And you can read about it here: <a href="http://go.microsoft.com/fwlink/?Linkid=148916">Getting Started PowerShell on Windows Server 2008 R2</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>Out-GridView: One more column header example looking at DC information</title>
      <link>https://docs.microsoft.com/archive/blogs/judith_herman/out-gridview-one-more-column-header-example-looking-at-dc-information</link>
      <pubDate>Tue, 20 Jan 2009 20:38:00 GMT</pubDate>
      <dc:creator><![CDATA[JudithH [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/judith_herman/2009/01/20/out-gridview-one-more-column-header-example-looking-at-dc-information/</guid>
      <description><![CDATA[I wanted to include one more example that I found interesting. In the past, when I wanted to get a...]]></description>
      <content:encoded><![CDATA[<P>I wanted to include one more example that I found interesting. In the past, when I wanted to get a list of the DC's in my domain, I would run the command '<STRONG>nltest.exe /dclist</STRONG>'. The command is still around. It still works.</P>
<P>However, getting the list and moving that list into a spreadsheet where I could use it for reports, etc. required extra processing. For example, in my little one DC test domain, I can run nltest even in Windows PowerShell.</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com//judithherman/3187262.aspx" original-url="http://blogs.technet.com/photos/judith_herman/picture3187262.aspx" target=_blank><IMG src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/13/7133/00/00/03/18/72/62/nltest_output.jpg" original-url="http://blogs.technet.com/photos/judith_herman/images/3187262/640x115.aspx" border=0></A></P>
<P>The output looks sort of like it's in columns. I have PDC information, DC information and a site name. It also displays the name of the domain. It's just not in the labeled columns I had in the previous examples. Since this topic is still about the Out-GridView cmdlet, I wondered what would happen if I ran the output of nltest into the input of Out-GridView. And here's what happened:</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com//judithherman/3187264.aspx" original-url="http://blogs.technet.com/photos/judith_herman/picture3187264.aspx" target=_blank><IMG src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/13/7133/00/00/03/18/72/64/Out-GridView_nltest.jpg" original-url="http://blogs.technet.com/photos/judith_herman/images/3187264/640x151.aspx" border=0></A></P>
<P mce_keep="true">Everything was smooshed into one column. The heading for this column is interesting, although, expected once I thought about it. The executables were written to output a string of text. In Windows PowerShell the variables, output from cmdlets, and essentially any output is an object. And it makes sense that a string of text would be a String object. So, it all makes sense, but is not all that useful for creating a report for a large number of DC's.</P>
<P mce_keep="true">Now, thinking back to the AD PowerShell Cookbook, that I sent a link to several posts back, I bet I can find a new cmdlet that will output some type of DC object that would be useful with the Out-GridView cmdlet. Sure enough, there's a topic called, "<A class="" title="Finding the Domain Controllers for a Domain" href="http://technet.microsoft.com/en-us/library/dd378810.aspx" mce_href="http://technet.microsoft.com/en-us/library/dd378810.aspx">Finding the Domain Controllers for a Domain</A>" which should give me the information I need. In my case, I&nbsp;can run the following in Windows PowerShell on my Windows Server 2008 R2 machine where my domain name is Corp1.contoso.com.</P>
<BLOCKQUOTE>
<P mce_keep="true"><STRONG>Get-ADDomainController -Discover -DomainName Corp1.contoso.com</STRONG></P></BLOCKQUOTE>
<P mce_keep="true">And the output&nbsp;looks like:</P>
<P mce_keep="true"><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com//judithherman/3187266.aspx" original-url="http://blogs.technet.com/photos/judith_herman/picture3187266.aspx" target=_blank><IMG src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/13/7133/00/00/03/18/72/66/Get-ADDomainController.jpg" original-url="http://blogs.technet.com/photos/judith_herman/images/3187266/640x183.aspx" border=0></A></P>
<P mce_keep="true">This looks like columns turned into rows, differently arranged than get-help or get-process output, but still potentially useful. The best thing I have found with Windows PowerShell is that when in doubt, it's better to just try it out. So, I next reran the same cmdlet and then piped the output to the Out-GridView cmdlet to get the following result:</P>
<P mce_keep="true"><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com//judithherman/3187267.aspx" original-url="http://blogs.technet.com/photos/judith_herman/picture3187267.aspx" target=_blank><IMG src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/13/7133/00/00/03/18/72/67/Out-GridView_Get-ADDomainController.jpg" original-url="http://blogs.technet.com/photos/judith_herman/images/3187267/614x145.aspx" border=0></A></P>
<P mce_keep="true">And yes, this is absolutely in the format that I can use to create a nice display with all the headers that appeared in the output from the Get-ADDomainController cmdlet.</P>
<P mce_keep="true">Okay, so with only one DC, it is sort of lame, but think what a nice report you can generate if you had a larger number of DC's. And the best part is you can generate this display on the fly.</P>
<P mce_keep="true">Next post, I'll look at one more example with Out-GridView and then probably move on to a new cmdlet. (Gasp, finally.) Stay tuned. :-)</P>]]></content:encoded>
    </item>
    <item>
      <title>More New on Technet: Where to Find More Information on New Cmdlets in Windows Server 2008 R2</title>
      <link>https://docs.microsoft.com/archive/blogs/judith_herman/more-new-on-technet-where-to-find-more-information-on-new-cmdlets-in-windows-server-2008-r2</link>
      <pubDate>Thu, 15 Jan 2009 13:33:00 GMT</pubDate>
      <dc:creator><![CDATA[JudithH [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/judith_herman/2009/01/15/more-new-on-technet-where-to-find-more-information-on-new-cmdlets-in-windows-server-2008-r2/</guid>
      <description><![CDATA[Since I've gone off-topic and gotten myself thrilled with information starting to be published about...]]></description>
      <content:encoded><![CDATA[<P>Since I've gone off-topic and gotten myself thrilled with information starting to be published about what's new in Windows Server 2008 R2, especially as it relates to Windows PowerShell, I'm going to just push the whole list of topics to look at in one shot.</P>
<UL>
<LI><A class="" title="Where to find what's new with Windows Server 2008 R2" href="http://go.microsoft.com/fwlink/?LinkID=139049" mce_href="http://go.microsoft.com/fwlink/?LinkID=139049">Where to find what's new with Windows Server 2008 R2</A></LI>
<LI><A class="" title="Where to find what's new with Windows 7 client" href="http://go.microsoft.com/fwlink/?LinkID=132711" mce_href="http://go.microsoft.com/fwlink/?LinkID=132711">Where to find what's new with Windows 7 client</A></LI>
<LI><A class="" title="AD PowerShell Cookbook" href="http://go.microsoft.com/fwlink/?LinkID=139658" mce_href="http://go.microsoft.com/fwlink/?LinkID=139658">AD PowerShell Cookbook</A> </LI>
<LI><A class="" title="Group Policy's new Windows PowerShell cmdlets" href="http://technet.microsoft.com/en-us/library/dd367856.aspx" mce_href="http://technet.microsoft.com/en-us/library/dd367856.aspx">Group Policy's new Windows PowerShell cmdlets</A></LI>
<LI><A class="" title="Server Manager's new Windows PowerShell cmdlets" href="http://technet.microsoft.com/en-us/library/dd378896.aspx" mce_href="http://technet.microsoft.com/en-us/library/dd378896.aspx">Server Manager's new Windows PowerShell cmdlets</A></LI>
<LI><A class="" title="Installing and running Windows Server Migration tools using Windows PowerShell" href="http://go.microsoft.com/fwlink/?LinkID=134763" mce_href="http://go.microsoft.com/fwlink/?LinkID=134763">Installing and running Windows Server Migration tools using Windows PowerShell</A></LI>
<LI><A class="" title="What's new in Windows PowerShell" href="http://technet.microsoft.com/en-us/library/dd378784.aspx" mce_href="http://technet.microsoft.com/en-us/library/dd378784.aspx">What's new in Windows PowerShell</A></LI>
<LI><A class="" title="What roles and features in Windows Server 2008 R2 provide cmdlets for scripting administration tasks" href="http://technet.microsoft.com/en-us/library/dd378843.aspx" mce_href="http://technet.microsoft.com/en-us/library/dd378843.aspx">What roles and features in Windows Server 2008 R2&nbsp;provide cmdlets for scripting administration tasks</A></LI></UL>]]></content:encoded>
    </item>
    <item>
      <title>Out-GridView: Where does Out-GridView get the column headers?</title>
      <link>https://docs.microsoft.com/archive/blogs/judith_herman/out-gridview-where-does-out-gridview-get-the-column-headers</link>
      <pubDate>Thu, 15 Jan 2009 01:18:00 GMT</pubDate>
      <dc:creator><![CDATA[JudithH [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/judith_herman/2009/01/15/out-gridview-where-does-out-gridview-get-the-column-headers/</guid>
      <description><![CDATA[While I was reading the help for the Out-GridView cmdlet, I started wondering where the column...]]></description>
      <content:encoded><![CDATA[<P>While I was reading the help for the Out-GridView cmdlet, I started wondering where the column titles came from. And as happens with Windows PowerShell, asking myself one question leads to another and another. I find that my mind goes down the question habit trail that leads to the hamster wheel and I cycle through a number of questions over and over again in an endless manner. I cycle until I realize there's many levels of answers and the easiest way to think about some things in Windows PowerShell is to first take the simplest answer and then decide if I want to go any further with the explanations.</P>
<P>So, I went back to the help for the Out-GridView cmdlet. I ran:</P>
<BLOCKQUOTE>
<P><STRONG>Get-Help Out-GridView</STRONG></P></BLOCKQUOTE>
<P mce_keep="true">The first line of the detailed description gave me the best clue to the simplest answer to my question of how does Out-GridView figure out what column headings to use. The line I'm referring to states, "The Out-GridView cmdlet sends the output from a command to a grid view window..." (Obviously, there's more to the help for Out-GridView. While it's all worthwhile reading, my goal is just to highlight this specific nugget of information.)</P>
<P mce_keep="true">What does sending the output from a command to a grid view window mean with regards to the column headings?</P>
<P mce_keep="true">I picked two examples that everyone uses to illustrate the meaning for myself. At it's simplest level, I ran the <STRONG>Get-Help * </STRONG>and the Get-Process cmdlets in the Windows PowerShell directly and then with the output piped to the Out-GridView cmdlet. And here's what I found.</P>
<P mce_keep="true"><STRONG>Example 1: Get-Help *</STRONG></P>
<P mce_keep="true">Running Get-Help * cmdlet directly in Windows PowerShell displays three columns with headings called: Name, Category, and Synopsis. In the below picture, I've scrolled back to the beginning of the output so I can see the headings.</P>
<P mce_keep="true"><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com//judithherman/3185918.aspx" original-url="http://blogs.technet.com/photos/judith_herman/picture3185918.aspx" target=_blank><IMG src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/13/7133/00/00/03/18/59/18/Get-Help_output.jpg" original-url="http://blogs.technet.com/photos/judith_herman/images/3185918/640x195.aspx" border=0></A><A href="http://blogs.technet.com/photos/judith_herman/picture3185909.aspx" target=_blank></A></P>
<P mce_keep="true"><A href="http://blogs.technet.com/photos/judith_herman/picture3185909.aspx" target=_blank></A></P>
<P mce_keep="true"><A href="http://blogs.technet.com/photos/judith_herman/picture3184727.aspx" target=_blank mce_href="http://blogs.technet.com/photos/judith_herman/picture3184727.aspx"></A></P>
<P>And now compare this to the separate window created when I pipe the output from <STRONG>Get-Help *</STRONG> into the <STRONG>Out-GridView</STRONG> cmdlet (<STRONG>Get-Help * | Out-GridView</STRONG>).</P>
<P mce_keep="true"><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com//judithherman/3185919.aspx" original-url="http://blogs.technet.com/photos/judith_herman/picture3185919.aspx" target=_blank><IMG src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/13/7133/00/00/03/18/59/19/Out-GridView_get-help.jpg" original-url="http://blogs.technet.com/photos/judith_herman/images/3185919/450x217.aspx" border=0></A></P>
<P>Notice the column headers are the same as the ones printed in Windows PowerShell when I ran <STRONG>Get-Help *</STRONG> as in the first picture.</P>
<P><STRONG>Example 2: Get-Process</STRONG></P>
<P>It sometimes helps me to repeat the experiment with a different cmdlet just to make sure the first try wasn't a fluke. I'm going to compare the output of the Get-Process cmdlet with the column headings in the grid view window when I pipe the output from the Get-Process cmdlet to the Out-GridView cmdlet.</P>
<P>And to save space in this blog post, this time I'll just show the column headings this time.</P>
<P>Here's the headings I see when I run Get-Process in Windows PowerShell:</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com//judithherman/3185921.aspx" original-url="http://blogs.technet.com/photos/judith_herman/picture3185921.aspx" target=_blank><IMG src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/13/7133/00/00/03/18/59/21/ps_output.jpg" original-url="http://blogs.technet.com/photos/judith_herman/images/3185921/640x88.aspx" border=0></A></P>
<P>And here's the headings for the grid view window when I've piped the output from Get-Process to Out-GridView, in other words, <STRONG>Get-Process | Out-GridView</STRONG>.</P>
<P mce_keep="true"><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com//judithherman/3185922.aspx" original-url="http://blogs.technet.com/photos/judith_herman/picture3185922.aspx" target=_blank><IMG src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/13/7133/00/00/03/18/59/22/Out-GridView_ps.jpg" original-url="http://blogs.technet.com/photos/judith_herman/images/3185922/640x68.aspx" border=0></A></P>
<P>With the pictures scoped down to just so the headings, it is pretty obvious they are the same.</P>
<P>An off the topic, BTW here... Notice, that for Get-Process I ran <STRONG>ps</STRONG>. This is known as an alias. An alias lets you use a shorthand instead of always typing out the full cmdlet name. For more information take a look at the <A class="" title="about_Aliases topic on Technet" href="http://technet.microsoft.com/en-us/library/dd347645.aspx" mce_href="http://technet.microsoft.com/en-us/library/dd347645.aspx">about_Aliases topic on Technet</A> or type the following in Windows PowerShell.</P>
<BLOCKQUOTE>
<P>&nbsp;<STRONG>get-help about_Aliases</STRONG></P></BLOCKQUOTE>
<P>Now, the next question I have is still where do these column headings come from, in other words, they represent something about the output of the cmdlet. But what is that? </P>
<P>Do I need to know this in order to use the <STRONG>Out-GridView </STRONG>cmdlet to analyze information I'm getting from other cmdlets? I would say, no, I can use these cmdlets with what I now know.</P>
<P>Next post I plan to walk&nbsp;through more examples showing different aspects of the Out-GridView cmdlet and how it comes in handy for things like analyzing event logs.&nbsp;A pretty nice feature of using Out-GridView.</P>
<P>Or, I can follow down the question habit trail of what these column headers represent. In other words, I would ask, "Tell me about Windows PowerShell objects and how understanding this will help me do more with the output of cmdlets?"</P>
<P>If you prefer one topic over the other, let me know and I can shift to following down the trail of thought to look at objects. Just want to avoid that squeaky old hamster wheel....</P>
<P>So, till next post, try out some of your own cmdlets with Out-GridView. Post comments on things you've tried and what you want to talk about next. And thanks for listening.&nbsp; --- Judith Herman</P>
<P mce_keep="true">&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>New on Technet:  Active Directory PowerShell Cookbook</title>
      <link>https://docs.microsoft.com/archive/blogs/judith_herman/new-on-technet-active-directory-powershell-cookbook</link>
      <pubDate>Thu, 15 Jan 2009 00:02:00 GMT</pubDate>
      <dc:creator><![CDATA[JudithH [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/judith_herman/2009/01/15/new-on-technet-active-directory-powershell-cookbook/</guid>
      <description><![CDATA[I'm so excited to find the Active Directory PowerShell Cookbook has been published to Technet. You...]]></description>
      <content:encoded><![CDATA[<P>I'm so excited to find the Active Directory PowerShell Cookbook has been published to Technet. You can find the start of this document at <A class="" href="http://go.microsoft.com/fwlink/?LinkID=139658" mce_href="http://go.microsoft.com/fwlink/?LinkID=139658">http://go.microsoft.com/fwlink/?LinkID=139658</A>. </P>
<P>This is a huge document, both in number of pages and accomplishment. I've played around with the Active Directory since Windows 2000. I found the Active Directory PowerShell Cookbook covers tasks that I hadn't even thought of doing. And it presents all these tasks through the new Active Directory PowerShell cmdlets available in Windows Server 2008 R2 beta. </P>
<P>Why take a diversion from the Out-GridView cmdlet to mention this? </P>
<P>First, I think this is the best kept secret of the Windows Server 2008 R2 content releases. </P>
<P>Second, now that this information is publically available, I plan on using these cmdlets in some of my examples. So, take a look at the cookbook and stay tuned. </P>
<P>Oh, and please send in comments or questions on what you'd like to see in examples as we slowly work our way through some of the new awesome cmdlets for Windows PowerShell 2.0.</P>]]></content:encoded>
    </item>
  </channel>
</rss>