问题
I started coding in Powershell today and noticed that when I ran scheduled tasks via powershell, it wouldn't register as running in the Task Scheduler(Run "Taskschd.msc"
). The code I'm using is here:
Get-ScheduledTask -TaskPath "\TaskPathHere\" | Start-ScheduledTask
When I run a task manually(right-mouse click>Run
), the status changes from Ready
to Running
. This isn't the case when ran from Powershell.
Question: Is there some additional parameter I need to pass to change the Status, or is this intentional behavior? If it is intentional, why?
来源:https://stackoverflow.com/questions/31480877/running-scheduled-tasks-with-powershell