Most of the management tasks for desktops and server systems can be done by using PowerShell. However, some of these tasks have to be scheduled on certain events or times. This isn't as straight forward as you might think because you can't just call the script directly. The way described below works for me all the time.

Start Task Scheduler

Select Task Scheduler Library and right-click it

Select Create Task

Define your security options and triggers

On the Actions tab click the New button

You can leave the Action as it is. In the Program/script field enter: powershell.exe
In the Add arguments field enter: -command "&"{<full path to script }""
In the Start in field you can enter anything you would like or leave it empty

You can test run the task by right-clicking it and selecting Run. The column Last Run Result will show the outcome.