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?
Everyday a folder will be created with date, and in that we have few csv files
I think it would have been helpful if you told us the format of the date in the folder. You can list all folders with Get-ChildItem.
To check all CSV files in that folder you would use Get-Child-Item again and parse them with a Foreach-Object.
Before you start sending emails I would recommend to test your logic if it works at all. ;-)
And last but not leat: When you post code please format it as code here in the forum. It's easier to read, to copy, to debug and to understand.