Powershell /Task scheduler arguments

HI guys,

Anyone would know if it possible to add arguments/parameters to my script so my script read/checks only the newest file of AAA_NN_KI_timestamp.log ? the problem I have is that they have time stamp and there is a lot of these files, my script reads/check this log file every day and I need it to check only the newest one.

“D:\Powershell\Services\AAA_NN_KI_20220421_111457.log”

Janusz,
Welcome to the forum. :wave:t4:

This forum is for scripting questions about self written code rather than script requests. We do not write customized and ready to use scripts or solutions on request.

What have you tried so far? We expect you to make an own attempt to get your task done or to solve your problem. If you have done so already please document here what exactly you have done and show your code. Then we probably might be able to help you step further.

Regardless of that - your question has been asked several times and has been answered already several times - even here in this forum. :wink: You may find a solution using either the forum search or your favorite internet search engine.

Besides - when your files have consistent names liek the one you posted you can simply sort them by name and they are already sorted by date as well. :wink: