I have two CSV files one yesterday's and the other one is today's, I need to compare the VM name object and get only the newly report VM name in the report. Can you help me with this? I was trying a lot but not working.
I have two CSV files one yesterday's and the other one is today's, I need to compare the VM name object and get only the newly report VM name in the report. Can you help me with this? I was trying a lot but not working.
Hi,
Suppose there's a column with the header "name" in your csv files, you can get the newly added VMs like below.
$yesterday = "C:\temp\yesterday.csv"
$today = "C:\temp\today.csv"
$vmyesterday = Import-Csv -Path $yesterday
$vmtoday = Import-Csv -Path $today
$vmtoday | Where-Object{$_.name -notin $vmyesterday.name} | Select-Object name
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
10 people are following this question.