-TaskPath
Get-ScheduledTask -TaskPath \Microsoft\Windows\*update*
Required trailing slash
It seems that a trailing slash is required in the following case.
The following command produces
PS D:\exports> Get-ScheduledTask -TaskPath '\x\syn' Get-ScheduledTask : No MSFT_ScheduledTask objects found with property 'TaskPath' equal to '\x\syn'. Verify the value of the property and retry. get-scheduledTask -taskPath '\x\syn'
However, this works:
get-scheduledTask -taskPath '\x\syn\'
Forward slashes don't work
Apparently, when specifying a task path, backward slashed are required. Forward slashed cause an error:
PS C:\> get-scheduledTask -taskPath /tq84/ -taskname *
Get-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 '%')) AND ((TaskPath LIKE '/tq84/')).