Having TaskScheduler in Windows run PowerShell scritps is like rolling dice depending on the context in which you are running the script...
So when in doubt:
I always have guaranteed success when starting the PS script from a batch file first from a scheduled task.
Create a scheduled tasked using these lines in an elevated powershell window:
Creates a scheduled task:
$action = New-ScheduledTaskAction -Execute 'C:\ProgramData\scripts\PSKickoff.bat'
$trigger = New-ScheduledTaskTrigger -AtStartup
$principal = New-ScheduledTaskPrincipal -GroupId "BUILTIN\Administrators" -RunLevel Highest
$settings = New-ScheduledTaskSettingsSet
$task = New-ScheduledTask -Action $action -Trigger $trigger -Principal $principal -Settings $settings
Register-ScheduledTask -TaskName "Scheduled Task Friendly but Meaningful Name" -InputObject $task
Note: Change above New-ScheduledTaskTrigger -AtStartup to match your schedule. Here's the info for it.
The batch file that the scheduled task runs:
Powershell.exe -executionpolicy bypass -File "C:\ProgramData\scripts\yourScript.ps1"