Here’s the syntax to use a PowerShell command in Task Schedule action, rather than a script:
Program/script:
powershell.exe
Add Arguments:
-noninteractive -executionpolicy bypass -command &{Checkpoint-VM -Name pxetest -SnapshotName 2018-06-23-PreMaintenance}
The key here is the ampersand before the command – when I was missing that it would not run.