<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://powershell.com/cs/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>Search results for 'sectionid:201' matching tag '-contains'</title><link>http://powershell.com/cs/search/SearchResults.aspx?q=sectionid%3A201&amp;tag=-contains&amp;orTags=0&amp;o=DateDescending</link><description>Search results for 'sectionid:201' matching tag '-contains'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><item><title>Value Not Found in Array</title><link>http://powershell.com/cs/forums/thread/9959.aspx</link><pubDate>Tue, 12 Apr 2011 05:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:9959</guid><dc:creator>ntxdba</dc:creator><description>&lt;p&gt;I am new to powershell and am working with a script to dump data from a MSSQL table.&amp;nbsp; CodePlex mssqldump.ps1 is the script location.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The table has columns that return datatype of System.String, System.DateTime and System.Int32.&amp;nbsp; I created an array that contains System.String and System.DateTime.&lt;/p&gt;
&lt;p&gt;when I use -contains to check for existence of those two values I only find System.DateTime. using $column.DataType.&amp;nbsp; When I display the value it shows as System.String.&amp;nbsp; If I hardcode System.String into the check it is found but not when using the DataType property.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Below is a snippet of the code, any help would be appreciated.&lt;/p&gt;
&lt;p&gt;$typeArray = &amp;quot;System.Boolean&amp;quot; ,&amp;quot;System.Datetime&amp;quot; ,&amp;quot;System.Char&amp;quot;, &amp;quot;System.Guid&amp;quot;, &amp;quot;System.String&amp;quot;&lt;br /&gt;&amp;nbsp;if ($typeArray -contains $column.Datatype)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { $quote = &amp;quot;&amp;#39;&amp;quot;}&lt;br /&gt;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {$quote = &amp;quot;&amp;quot;}&lt;/p&gt;</description></item></channel></rss>