A scheduled task that never seems to do anything is a classic. Before digging into its actions, check whether it runs at all. Task Scheduler shows this in a tab. PowerShell shows it in one line.
Get-ScheduledTaskInfo -TaskName "\Sample\SchedTask01"
The cmdlet gets the last run-time information for a task. That is a separate object from the task definition, which is why Get-ScheduledTask alone does not tell you whether it ran. The documented pipeline form covers a whole folder of tasks:
Get-ScheduledTask -TaskPath "\Sample\" | Get-ScheduledTaskInfo
The documentation does not list the properties of the returned object, so look at them yourself once, with | Format-List *. Check there for the fields about the last run and its result, since the page does not name them.
Task names matter here. -TaskPath needs the leading and trailing backslash for a full path, and \ alone is the root folder. If you leave the path out, the cmdlet uses the root folder, so a task in a subfolder is not found by name alone. The documentation also notes that -TaskPath accepts * as a wildcard.
Pair it with Start-ScheduledTask, which is linked from the same page, to run a task by hand and then check the info again.
None of this was run on a live Windows machine here. It follows the Microsoft documentation.
Further reading: Get-ScheduledTaskInfo