Powershell: schedule job in Powershell

NO IMAGE
1 Star2 Stars3 Stars4 Stars5 Stars 給文章打分!
Loading...

http://blogs.technet.com/b/heyscriptingguy/archive/2012/09/18/create-a-powershell-scheduled-job.aspx

$dailyTrigger = New-JobTrigger -Daily -At "2:00 PM"
$option = New-ScheduledJobOption -StartIfOnBattery -StartIfIdle
Register-ScheduledJob -Name UpdateHelp -ScriptBlock {Update-Help -Module * -Force} -Trigger $dailyTrigger -ScheduledJobOption $option
To look at the scheduled job, open the Task Scheduler MMC by typing the following command.
Taskschd.msc

Need note that Powershell schedule job is actually create task in Windows task scheduler, if you have no permission to task scheudler (e.g. on your company PC), you are unable to do this in Powershell as well. 

相關文章

程式語言 最新文章