New-ScheduledTaskSettingsSet
New-ScheduledTaskSettingsSet
Creates a new scheduled task settings object.
구문
Parameter Set: NewSettings1
New-ScheduledTaskSettingsSet [-AllowStartIfOnBatteries] [-AsJob] [-CimSession <CimSession[]> ] [-Compatibility <CompatibilityEnum> ] [-DeleteExpiredTaskAfter <TimeSpan> ] [-Disable] [-DisallowDemandStart] [-DisallowHardTerminate] [-DisallowStartOnRemoteAppSession] [-DontStopIfGoingOnBatteries] [-DontStopOnIdleEnd] [-ExecutionTimeLimit <TimeSpan> ] [-Hidden] [-IdleDuration <TimeSpan> ] [-IdleWaitTimeout <TimeSpan> ] [-MaintenanceDeadline <TimeSpan> ] [-MaintenanceExclusive] [-MaintenancePeriod <TimeSpan> ] [-MultipleInstances <MultipleInstancesEnum> ] [-NetworkId <String> ] [-NetworkName <String> ] [-Priority <Int32> ] [-RestartCount <Int32> ] [-RestartInterval <TimeSpan> ] [-RestartOnIdle] [-RunOnlyIfIdle] [-RunOnlyIfNetworkAvailable] [-StartWhenAvailable] [-ThrottleLimit <Int32> ] [-WakeToRun] [ <CommonParameters>]
자세한 설명
The New-ScheduledTaskSettingsSet cmdlet creates an object that contains scheduled task settings. Each scheduled task has one set of task settings. Use this cmdlet to configure options to manage the behavior of the task upon completion, to manage the behavior of the task if a problem occurs, or to manage the behavior of the task if an instance of the task is already running.
You can use the scheduled task settings to register a new scheduled task or update an existing task registration.
매개 변수
-AllowStartIfOnBatteries
Indicates that Task Scheduler starts if the computer is running on battery power.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-AsJob
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-CimSession<CimSession[]>
원격 세션에서 또는 원격 컴퓨터에서 cmdlet을 실행합니다. New-CimSession 또는 Get-CimSession cmdlet의 출력과 같은 컴퓨터 이름이나 세션 개체를 입력합니다. 기본값은 로컬 컴퓨터의 현재 세션입니다.
별칭 |
Session |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-Compatibility<CompatibilityEnum>
Indicates which version of Task Scheduler with which a task is compatible. 이 매개 변수에 허용되는 값은 다음과 같습니다.
-- V1
-- Vista
-- Win7
-- Win8
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-DeleteExpiredTaskAfter<TimeSpan>
Specifies the amount of time that Task Scheduler waits before deleting the task after it expires.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-Disable
Indicates that the task is disabled.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-DisallowDemandStart
Indicates that the task cannot be started by using either the Run command or the Context menu.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-DisallowHardTerminate
Indicates that the task cannot be terminated by using TerminateProcess.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-DisallowStartOnRemoteAppSession
Indicates that the task does not start if the task is triggered to run in a Remote Applications Integrated Locally (RAIL) session.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-DontStopIfGoingOnBatteries
Indicates that the task does not stop if the computer switches to battery power.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-DontStopOnIdleEnd
Indicates that Task Scheduler does not terminate the task if the idle condition ends before the task is completed.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-ExecutionTimeLimit<TimeSpan>
Specifies the amount of time that Task Scheduler is allowed to complete the task.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-Hidden
Indicates that the task is hidden in the Task Scheduler UI.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-IdleDuration<TimeSpan>
Specifies the amount of time that the computer must be in an idle state before Task Scheduler runs the task.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-IdleWaitTimeout<TimeSpan>
Specifies the amount of time that Task Scheduler waits for an idle condition to occur.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-MaintenanceDeadline<TimeSpan>
Specifies the amount of time after which Task Scheduler attempts to run the task during emergency Automatic maintenance, if the task failed to complete during regular Automatic maintenance.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-MaintenanceExclusive
Indicates that the task needs to run alone when it is started in maintenance mode.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-MaintenancePeriod<TimeSpan>
Specifies the amount of time that the task needs to run once during regular Automatic maintenance.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-MultipleInstances<MultipleInstancesEnum>
Specifies the policy that defines how Task Scheduler handles multiple instances of the task.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-NetworkId<String>
Specifies the ID of a network profile that Task Scheduler uses to determine if the task can run. You must specify the ID of a network if you specify the RunOnlyIfNetworkAvailable paramater.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-NetworkName<String>
Specifies the name of a network profile that Task Scheduler uses to determine if the task can run. The Task Scheduler UI uses this setting for display purposes. Specify a network name if you specify the RunOnlyIfNetworkAvailable paramater.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-Priority<Int32>
Specifies the priority level of the task. Priority must be an integer from 1 (lowest priority) to 10 (highest priority). The default value is 7.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-RestartCount<Int32>
Specifies the number of times that Task Scheduler attempts to restart the task.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-RestartInterval<TimeSpan>
Specifies the amount of time that Task Scheduler attempts to restart the task.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-RestartOnIdle
Indicates that Task Scheduler restarts the task when the computer cycles into an idle condition more than once.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-RunOnlyIfIdle
Indicates that Task Scheduler runs the task only when the computer is idle.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-RunOnlyIfNetworkAvailable
Indicates that Task Scheduler runs the task only when a network is available. Task Scheduler uses the NetworkID paramater and NetworkName parameter that you specify in this cmdlet to determine if the network is available.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-StartWhenAvailable
Indicates that Task Scheduler can start the task at any time after its scheduled time has passed.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-ThrottleLimit<Int32>
이 cmdlet을 실행하도록 설정할 수 있는 최대 동시 작업 수를 지정합니다. 이 매개 변수가 생략되거나 값 0
이 입력되면 Windows PowerShell®은 컴퓨터에서 실행 중인 CIM cmdlet의 수에 따라 cmdlet에 대한 최적의 제한 한도를 계산합니다. 제한 한도는 현재 cmdlet에만 적용되며 세션이나 컴퓨터에는 적용되지 않습니다.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-WakeToRun
Indicates that Task Scheduler wakes the computer before it runs the task.
별칭 |
없음 |
필수 여부 |
false |
위치 |
named |
기본값 |
없음 |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
<CommonParameters>
이 cmdlet은 일반 매개 변수 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer 및 -OutVariable을 지원합니다. 자세한 내용은 다음을 참조하세요. about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216).
입력
입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다.
출력
출력 유형은 cmdlet이 내보내는 개체의 유형입니다.
- Microsoft.Management.Infrastructure.CimInstance#MSFT_TaskSettings
예제
Example 1: Register a scheduled task that uses default task settings
This example registers a scheduled task that uses default task settings.
The first command creates a scheduled task action named Cmd and assigns the ScheduledTaskAction object to the Sta variable.
PS C:\> $Sta = New-ScheduledTaskAction -Execute "Cmd"
The second command creates scheduled task settings that use the default settings and assigns the ScheduledTaskSettings object to the Stset variable.
PS C:\> $STSet = New-ScheduledTaskSettingsSet
The third command registers the scheduled task Task01 to run the task action named Cmd and to use the default task settings.
PS C:\> Register-ScheduledTask Task01 -Action $Sta -Settings $STSet
Example 2: Set the priority of a scheduled task
This example sets the priority of a scheduled task.
The first command creates a scheduled task action named Cmd and assigns the ScheduledTaskAction object to the Sta variable.
PS C:\> $Sta = New-ScheduledTaskAction -Execute "Cmd"
The second command creates scheduled task settings that sets a higher priority for the scheduled task, and assigns the ScheduledTaskSettings object to the Stset variable.
PS C:\> $STSet = New-ScheduledTaskSettingsSet -Priority 5
The third command registers the scheduled task Task01 to run the task action named Cmd and to use the task settings that have a priority setting of 9.
PS C:\> Register-ScheduledTask Task01 -Action $Sta -Settings $Stset
Example 3: Set restart settings for a scheduled task
This example sets restart settings for a scheduled task.
The first command creates a scheduled task action named Cmd and assigns the ScheduledTaskAction object to the Sta variable.
PS C:\> $Sta = New-ScheduledTaskAction -Execute "Cmd"
The second command creates scheduled task settings that specify that Task Scheduler attempts three restarts of the task at sixty minute intervals. This command assigns the ScheduledTaskSettings object to the Stset variable.
PS C:\> $Stset = New-ScheduledTaskSettingsSet -RestartCount 3 -RestartInterval 60
The third command registers the scheduled task Task01 to run the task action named Cmd and to use the task settings that the ScheduledTaskSettings object defines.
PS C:\> Register-ScheduledTask Task01 -Action $Sta -Settings $Stset
Example 4: Set idle settings for a scheduled task
This example sets idle settings for a scheduled task.
The first command creates a scheduled task action named Cmd and assigns the ScheduledTaskAction object to the Sta variable.
PS C:\> $Sta = New-ScheduledTaskAction -Execute "Cmd"
The second command creates scheduled task settings that specify that Task Scheduler runs the task only when the computer is idle for 2 minutes and waits for 2 hours and 30 minutes for an idle condition. This command assigns the ScheduledTaskSettings object to the Stset variable.
PS C:\> $Stset = New-ScheduledTaskSettingsSet -RunOnlyIfIdle -IdleDuration 00:02:00 -IdleWaitTimeout 02:30:00
The third command registers the scheduled task Task01 to run the task action named Cmd and to use the task settings that the ScheduledTaskSettings object defines.
PS C:\> Register-ScheduledTask Task01 -Action $Sta -Settings $Stset
Example 5: Register a scheduled task that runs only when a network is available
This example registers a scheduled task that runs only when a network is available.
The first command creates a scheduled task action named Cmd and assigns the ScheduledTaskAction object to the Sta variable.
PS C:\> $Sta = New-ScheduledTaskAction -Execute "Cmd"
The second command creates scheduled task settings that specify that Task Scheduler runs the task only when a network is available. This command assigns the ScheduledTaskSettings object to the Stset variable.
PS C:\> $Stset = New-ScheduledTaskSettingsSet -RunOnlyIfNetworkAvailable
The third command registers the scheduled task Task01 to run the task action named Cmd only when a network is available.
PS C:\> Register-ScheduledTask Task01 -Action $Sta -Settings $Stset