Hi,
Everyday a folder will be created with date, and in that we have few csv files. I need to verify all the CSV files and find, if any csv file contains only one row (it should email).
I wrote a script, which can look for a particular file, but finding current folder & looping through all csv files are not working. Can someone guide me on this?
Below is the code, which I am having:
$b=Import-Csv C:\Users\venkatak\Desktop\Scripts\CSV_Verification\Snap_SalesbyMonth-013120180220.csv | Measure-Object | select count
if($b.Count-eq 1)
{
Send-MailMessage -To “Manager 1 " -From “Reports Admin " -SMTPServer test.com -Subject “Daily report” -Body "Error"
}