New-FsrmScheduledTask
New-FsrmScheduledTask
Creates a scheduled task object.
Sintaxis
Parameter Set: CreateScheduledTask0
New-FsrmScheduledTask [-Time] <DateTime> [-AsJob] [-CimSession <CimSession[]> ] [-Monthly <Int32[]> ] [-RunDuration <Int32> ] [-ThrottleLimit <Int32> ] [-Weekly <FsrmScheduledTaskDaysEnum[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Descripción detallada
The New-FsrmScheduledTask cmdlet creates a scheduled task object that defines scheduling for reports, classification, and file management jobs.
Parámetros
-AsJob
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-CimSession<CimSession[]>
Ejecuta el cmdlet en una sesión remota o en un equipo remoto. Escriba un nombre de equipo o un objeto de sesión, como la salida de un cmdlet New-CimSession o Get-CimSession. El valor predeterminado es la sesión actual en el equipo local.
Alias |
Session |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-Monthly<Int32[]>
Specifies an array of days on which to run the task. Specify a value of -1 to run the task on the last day of the month. If you specify this parameter, do not specify the Weekly parameter.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-RunDuration<Int32>
Specifies the number of hours that the server runs the task before canceling it. The value 0 indicates that the server runs the task to completion.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
0 |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-ThrottleLimit<Int32>
Especifica el número máximo de operaciones simultáneas que se pueden establecer para ejecutar el cmdlet. Si se omite este parámetro o es especifica un valor de 0
, Windows PowerShell ® calcula un límite óptimo para el cmdlet en función del número de cmdlets de CIM que se estén ejecutando en el equipo. El límite solo se aplica al cmdlet actual, no a la sesión ni al equipo.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-Time<DateTime>
Specifies a date and time value, in standard Coordinated Universal Time (UTC) format, to run the task.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
2 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-Weekly<FsrmScheduledTaskDaysEnum[]>
Specifies an array of weekdays on which to run the task. If you specify this parameter, do not specify the Monthly parameter.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-Confirm
Solicita confirmación antes de ejecutar el cmdlet.
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
falso |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-WhatIf
Muestra lo que sucedería si se ejecutara el cmdlet. El cmdlet no se ejecuta.
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
falso |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
<CommonParameters>
Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Entradas
El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.
Salidas
El tipo de resultado es el tipo de objetos que emite el cmdlet.
Ejemplos
Example 1: Create a weekly scheduled task
The first command gets a DateTime object and stores it in the variable $d.
The second command returns a FsrmScheduledTask object that defines a schedule that runs the task at midnight every day, Monday through Friday.
PS C:\> $d = get-date "12:00am"
PS C:\> New-FsrmScheduledTask -Time $d -Weekly @(Monday, Tuesday, Wednesday, Thursday, Friday)
Example 2: Create a monthly scheduled task
The first command gets a DateTime object and stores it in the variable $d.
This second command returns a FsrmScheduledTask object that describes a schedule that runs the task at midnight on the 15th and the last day of every month. The RunDuration parameter specifies that the server terminates the process after 4 hours if the process has not ended.
PS C:\> $d = get-date "12:00am"
PS C:\> New-FsrmScheduledTask -Time $d -Monthly @(-1,15) -RunDuration 4