Created
October 25, 2017 15:50
-
-
Save pezhore/f7175fe490ce351749ac1898c56e2cad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import CSVs | |
$csv1 = Import-CSV -Path c:\temp\csv1.csv | |
$csv2 = Import-CSV -Path c:\temp\csv2.csv | |
# Loop through each item in csv1 | |
foreach ($item in $csv1) { | |
$thisDataType = $item.DataType | |
# find the entry in csv2 where csv2's column name matches this column name | |
$csv2DataType = ($csv2 |Where-Object {$_."Column Name" -match $item."Column Name"}).DataType | |
# If the two don't match, say so | |
if (! $thisDataType -eq $csv2DataType){ | |
Write-Output "CSV2 datatype does not match CSV1 datatype for Column Name $($item.'Column Name')" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment