I have got 2 hashtable definitions, did some research and saw this helpful post
This highlights the differences within the hashtables as per the code below.
[hashtable] $template = @{
"ID" = "1"
"Firstname" = "2"
"Surname" = "3"
"Grade Score" = "4"
"City" = "5"
"School Name" = "6"
}
[hashtable] $data = @{
"1" = "ID"
"2" = "Firstname"
"3" = "Surname"
"4" = "Grade"
"5" = "City"
"6" = "School"
"7" = "Comments"
"8" = "UpdateDate"
}
#$data.GetEnumerator() | sort -Property Key
#$data | Get-Member
#$data
$template_count = $template.Count
$data_count = $data.count
if ($template_count -ne $data_count)
{
write-output "Template count of $template_count columns does not match data column count of $data_count "
}
$template.GetEnumerator() | select key,@{ n='Value'; e={$data[$_.value]}}
I can see the output as in
ID | ID
------------|-----------
School Name | School
Surname | Surname
Grade Score | Grade
City | City
Firstname | Firstname
In this case, the values School Name and School are different, so is Grade Score and Grade. How can i highlight the differences ?