To schedule a SharePoint PowerShell script to run in Task Scheduler, ensure you have the necessary modules, such as "Microsoft.SharePoint.PowerShell" or PnP.PowerShell is installed on the machine first. Then proceed with the below steps to create a scheduled task for the SharePoint PowerShell script: Open Task Scheduler >> Create a Basic Task >> Provide a Name to your Task >> Set the trigger to run the task daily or at a specific time. Set the action to "Start a program". In the "Program/script" field, enter the path to PowerShell.exe: "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe". In the "Add arguments" field, enter the path to your PowerShell script: "-File C:\\Path\\To\\Your\\Script.ps1". Click "OK" to save the task.