If you want to schedule any task using Task scheduler in the Windows system, we need to make sure that all the configuration has been setup properly.

If we are running backup tasks for SharePoint content database with PowerShell scripts, we need to make sure that the script is correct and has passed all parameters successfully. Also, we should have appropriate permissions to run backup on SharePoint Server. We need to see the path also, which you have assigned in order to ensure whether it exists or not.

Once everything given above is done, create a simple task in task scheduler and attach the PS1 file and save the same.

Now, we need to run this and later we will receive an error called Backup –SPFarm: A positional parameter cannot be found that accepts an argument. See the screenshot given below.

Once everything is done, save the same and rerun again. Now, we will we get an expected result without any issue.