<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>What the Heck is an ENUM?</title><link>http://blogs.msdn.com/powershell/archive/2008/12/14/what-the-heck-is-an-enum.aspx</link><description>In my latest post Explore your [Environment] I said the following: PS&amp;gt; [System.Environment+SpecialFolder] IsPublic IsSerial Name&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: What the Heck is an ENUM?</title><link>http://blogs.msdn.com/powershell/archive/2008/12/14/what-the-heck-is-an-enum.aspx#9218324</link><pubDate>Mon, 15 Dec 2008 08:48:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9218324</guid><dc:creator>applepwc</dc:creator><description>&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;I konw what is ENUM type(just a set of constants).I just wonder why the name is [System.Environment+SpecialFolder] (in PS)but not [System.Environment.SpecialFolder](in C#).&lt;/p&gt;
&lt;p&gt;again,look this:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/powershell/archive/2007/01/23/how-to-create-enum-in-powershell.aspx"&gt;http://blogs.msdn.com/powershell/archive/2007/01/23/how-to-create-enum-in-powershell.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;PS &amp;gt; New-Enum my.color blue red yellow&lt;/p&gt;
&lt;p&gt;PS &amp;gt; [my.color]::blue&lt;/p&gt;
&lt;p&gt;PS &amp;gt; [my+color]::blue&lt;/p&gt;
&lt;p&gt;Unable to find type [my+color].....&lt;/p&gt;
&lt;p&gt;#==========================&lt;/p&gt;
&lt;p&gt;All .net ENUM type need &amp;quot;+&amp;quot; instead of &amp;quot;.&amp;quot; in PS&lt;/p&gt;
&lt;p&gt;PS C:\test&amp;gt; [ActivationContext.ContextForm]&lt;/p&gt;
&lt;p&gt;Unable to find type [ActivationContext.ContextForm]: make sure that the assembl&lt;/p&gt;
&lt;p&gt;y containing this type is loaded.&lt;/p&gt;
&lt;p&gt;At line:1 char:31&lt;/p&gt;
&lt;p&gt;+ [ActivationContext.ContextForm] &amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/p&gt;
&lt;p&gt;PS C:\test&amp;gt; [ActivationContext+ContextForm]&lt;/p&gt;
&lt;p&gt;IsPublic IsSerial Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BaseType&lt;/p&gt;
&lt;p&gt;-------- -------- ---- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; --------&lt;/p&gt;
&lt;p&gt;False &amp;nbsp; &amp;nbsp;True &amp;nbsp; &amp;nbsp; ContextForm &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.Enum&lt;/p&gt;</description></item><item><title>re: What the Heck is an ENUM?</title><link>http://blogs.msdn.com/powershell/archive/2008/12/14/what-the-heck-is-an-enum.aspx#9220418</link><pubDate>Mon, 15 Dec 2008 15:34:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9220418</guid><dc:creator>tfl</dc:creator><description>&lt;p&gt;There are a bunch of PowerShell script samples up on MSDN that demonstrate some of the many hundreds of ENUMs available inside .NET.&lt;/p&gt;
&lt;p&gt;To view samples, take a look at &lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/library/tags-cloud.aspx?tag=powershell+enum"&gt;http://msdn.microsoft.com/en-us/library/tags-cloud.aspx?tag=powershell+enum&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Getting valid values for a enum</title><link>http://blogs.msdn.com/powershell/archive/2008/12/14/what-the-heck-is-an-enum.aspx#9222714</link><pubDate>Tue, 16 Dec 2008 02:19:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9222714</guid><dc:creator>Ronald S Woan</dc:creator><description>&lt;p&gt;This is probably better than throwing an error to list valid values for an enum:&lt;/p&gt;
&lt;p&gt;[system.enum]::getnames([System.Environment+SpecialFolder])&lt;/p&gt;</description></item><item><title>re: What the Heck is an ENUM?</title><link>http://blogs.msdn.com/powershell/archive/2008/12/14/what-the-heck-is-an-enum.aspx#9230491</link><pubDate>Wed, 17 Dec 2008 11:52:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9230491</guid><dc:creator>Stranger</dc:creator><description>&lt;p&gt;@applepwc In short the &amp;quot;+&amp;quot; in [System.Environment+SpecialFolder] distinguishes a namespace from a nested type. [System.Environment] is the typename of the Environment class. System is the namespace, Environment the class name. The +SpecialFolder means that SpecialFolder is a type defined _within_ the Environment class.&lt;/p&gt;
&lt;p&gt;Compare this with c#:&lt;/p&gt;
&lt;p&gt;namespace System&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; class Environment&lt;/p&gt;
&lt;p&gt; &amp;nbsp; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;// enum defined within Environment class!&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;enum SpecialFolder {...} &lt;/p&gt;
&lt;p&gt; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;// =&amp;gt; Type in PS: [System.Environment+SpecialFolder]&lt;/p&gt;
&lt;p&gt;Now compare this with a SpecialFolder enum defined in a System.Environment namespace:&lt;/p&gt;
&lt;p&gt;namespace System.Environment &lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; // enum defined within System.Environment namespace!&lt;/p&gt;
&lt;p&gt; &amp;nbsp; enum SpecialFolder {...} &lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;// =&amp;gt; Type in PS: [System.Environment.SpecialFolder]&lt;/p&gt;
&lt;p&gt;hth&lt;/p&gt;</description></item><item><title>re: What the Heck is an ENUM?</title><link>http://blogs.msdn.com/powershell/archive/2008/12/14/what-the-heck-is-an-enum.aspx#9233269</link><pubDate>Thu, 18 Dec 2008 04:16:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9233269</guid><dc:creator>applepwc</dc:creator><description>&lt;p&gt;@Stranger:&lt;/p&gt;
&lt;p&gt;thanks for your clarification.&lt;/p&gt;</description></item><item><title>re: What the Heck is an ENUM?</title><link>http://blogs.msdn.com/powershell/archive/2008/12/14/what-the-heck-is-an-enum.aspx#9242796</link><pubDate>Fri, 19 Dec 2008 23:18:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9242796</guid><dc:creator>Luke Breuer</dc:creator><description>&lt;p&gt;It would be nice if Get-Help were to specifically list enum values. &amp;nbsp;Or is there a way to reflect upon a cmdlet and find the types of its parameters, and then use the static method on System.Enum to pull the values? &amp;nbsp;I would rather not have to inject strings into Get-Help contents, but you PowerShell folks haven't seem to have thought of this (or if you have, it is not clear to the public).&lt;/p&gt;</description></item></channel></rss>