Create a scheduled task in Windows 7 using Powershell 4

Do I understand correctly that some of the new Powershell commands related to managing scheduled tasks (for example New-ScheduledTaskAction) are not available in Windows 7 or Server 2008 R2, even if Powershell 4 is installed?

+4
source share
2 answers

Yes, you're right, some PowerShell cmdlets are dependent on the Windows kernel.

The team New-ScheduledTaskActionsupports Windows 8 / server 2012 and newer. you can read about id at https://technet.microsoft.com/en-us/library/jj649817.aspx .

In Windows 7 / server 2008 R2, you can use the new-ScheduledJobOptionand cmdlet Register-ScheduledJob.

https://msdn.microsoft.com/en-us/powershell/reference/5.1/psscheduledjob/psscheduledjob

:

New-ScheduledJobOption -RunElevated -ContinueIfGoingOnBattery
Register-ScheduledJob -FilePath C:\Users\User\Desktop\CreateFolderTest.ps1 -Name TestJob -RunNow

Task Scheduler, " → Microsoft → Windows → PowerShell → ScheduledJobs

"Task Schduler" Get-ScheduledJobOption.

Get-ScheduledJob , Register-ScheduledJob!

, .

+3

( Server 2008 R2 Powershell 4), (, New-ScheduledTaskAction) 2008 R2. system32\WindowsPowerShell\v1.0\Modules, .

, , , 2012 Windows 8 .

+2

Source: https://habr.com/ru/post/1610341/


All Articles