Powershell script does not get executed by Task Scheduler
That is happening because of Window's Execution policy, Which does not allow an unsigned script to be run by default. You need to change this policy for your script to work.
- Open an elevated Powershell prompt.
- Type
Set-ExecutionPolicy Unrestricted
to set the policy to Unrestricted. - Type
Get-ExecutionPolicy
to verify the current settings for the execution policy.
Please note that changing this setting is a security threat as malicious scripts can also be run by other programs. Instead you can try to write a Batch script spinoff of the same script, and then use that instead of this. Windows exeution policy don't block Batch script.