📜  register-scheduledjob 与 register-scheduledtask - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:50.828000             🧑  作者: Mango

代码示例1
So, an activity run as a Scheduled Task is anything you can run from 
command prompt (eg. .EXE, .BAT, .COM, .CMD etc. - nothing PowerShell-ish,
unless you decide to start powershell.exe and give it some 
script name to execute. 
Yet, you can control all of that from PowerShell.

On the other hand, Scheduled Job is exclusively PowerShell code 
(be it script block or script file) that PowerShell registers with 
Windows Task Scheduler, and Windows Task Scheduler knows how to 
activate it. Method of repetitive activation is in both cases the same 
("triggers").