@AQUEEL SULEMAN
Please follow these steps:
1.Write and run a PowerShell script. If the script can run successfully, please save it.
Ps:The script can list the file information in the “Lib” Document library over 5 days.
This is a test script.
2.Schedule PowerShell Script using Task Scheduler
a) Open Task scheduler >> select Task Scheduler Library >> click Create Task
b) On the General tab, you can set scheduler name.
c) On the Trigger tab and click New button. In the New Trigger dialog, you can set conditions.
d) On the Actions tab and click New button to set task actions. Once configured, you can specify conditions to determine whether the task should run. The task will not run if any condition specified here is not true.
e) On the Settings tab, you can set additional advanced settings to control the task execution
f) You can Run by right-clicking task name to test this task.
You could refer to this article How to Schedule PowerShell Script using Task Scheduler.
Thanks,
Echo Du
===============
If an 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.