I am new to powershell and am working with a script to dump data from a MSSQL table. CodePlex mssqldump.ps1 is the script location.
The table has columns that return datatype of System.String, System.DateTime and System.Int32. I created an array that contains System.String and System.DateTime.
when I use -contains to check for existence of those two values I only find System.DateTime. using $column.DataType. When I display the value it shows as System.String. If I hardcode System.String into the check it is found but not when using the DataType property.
Below is a snippet of the code, any help would be appreciated.
$typeArray = "System.Boolean" ,"System.Datetime" ,"System.Char", "System.Guid", "System.String"
if ($typeArray -contains $column.Datatype)
{ $quote = "'"}
else
{$quote = ""}