I've two CSV File
File1 :
Server HotfixID CommanName
apdk778 kb3333 apdk778 kb3333
apdk778 yn2919 apdk778 yn2919
apdk778 lk4898 apdk778 lk4898
iijka211 kb3333 iijka211 kb3333
iijka211 yn2919 iijka211 yn2919
iijka211 lk4898 iijka211 lk4898
File2 :
Server HotfixID CommanName
apdk778 kb3333 apdk778 kb3333
apdk778 yn2919 apdk778 yn2919
apdk778 lk4898 apdk778 lk4898
iijka211 yn2919 iijka211 yn2919
iijka211 lk4898 iijka211 lk4898
mmmm23 ram9999 mmmm23 ram9999
nnn30292 ram9999 nnn30292 ram9999
iijka211 xxx9999 iijka211 xxx9999
iijka211 xxx9999 iijka211 xxx9999
iijka211 xxx9999 iijka211 xxx9999
apdk778 xxx9999 apdk778 xxx9999
apdk778 ram9999 apdk778 ram9999
apdk778 ram9999 apdk778 ram9999
Wanted-Output : "Patched_Success" added in File1 and compared with File2, if CommanName present in file2 then Patched Success = "yes" else "no"
Server HotfixID CommanName Patched Success
apdk778 kb3333 apdk778 kb3333 Yes
apdk778 yn2919 apdk778 yn2919 Yes
apdk778 lk4898 apdk778 lk4898 Yes
iijka211 kb3333 iijka211 kb3333 No
iijka211 yn2919 iijka211 yn2919 Yes
iijka211 lk4898 iijka211 lk4898 Yes
I've tried below code : But didn't get success, please help.
foreach ($f1 in $file1) {foreach($f2 in $file2) {if ($f1.CommanName -eq $f2.CommanName) New-Object psobject -pro
perty @{Patched="Success"}}}