Error: No matching MSFT_ScheduledTask objects found by CIM query for instances of ‥
When I tried to execute
unregister-ScheduledTask -taskName renesTask -taskPath '\Foo\Bar'
I got the error message
unregister-ScheduledTask : No matching MSFT_ScheduledTask objects found by CIM query for instances of the Root/Microsoft/Windows/TaskScheduler/MSFT_ScheduledTask class on the CIM server:
SELECT * FROM MSFT_ScheduledTask WHERE ((TaskName LIKE 'renesTask')) AND ((TaskPath LIKE '\\Foo\\Bar')). Verify query parameters and retry.
I was able to delete the task by appending a final backslash to the task path:
unregister-ScheduledTask -taskName renesTask -taskPath '\Foo\Bar\'