CmdID

CmdID / PowerShell / Cmdlets / Get

Get-ScheduledJobOption

Gets the job options of scheduled jobs. PowerShell reference

From the PowerShell reference 3 parameters

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

Gets the job options of scheduled jobs. The Get-ScheduledJobOption cmdlet gets the job options of scheduled jobs. You can use this command to examine the job options or to pipe the job options to other cmdlets. Job options are not saved to disk independently; they are part of a scheduled job. To get the job options of a scheduled job, specify the scheduled job. Use the parameters of the Get-ScheduledJobOption cmdlet to identify the scheduled job. You can identify scheduled jobs by their names or identification numbers, or by entering or piping ScheduledJob objects, such as those that are returned by the Get-ScheduledJob cmdlet, to Get-ScheduledJobOption. Get-ScheduledJobOption is one of a collection of job scheduling cmdlets in the PSScheduledJob module that is included in Windows PowerShell. For more information about Scheduled Jobs, see the About topics in the PSScheduledJob module. Import the PSScheduledJob module and then type: Get-Help about_Scheduled* or see about_Scheduled_Jobs. This cmdlet was introduced in Windows PowerShell 3.0.

Get-ScheduledJobOption [-InputObject] <ScheduledJobDefinition> [<CommonParameters>]
Get-ScheduledJobOption [-Id] <Int32> [<CommonParameters>]
Get-ScheduledJobOption [-Name] <String> [<CommonParameters>]

Get job options

Get-ScheduledJobOption -Name "Backup"Identify

Get all job options

Get-ScheduledJob | Get-ScheduledJobOptionIdentify

Get selected job options

Get-ScheduledJob | Get-ScheduledJobOption | Where-Object {$_.RunElevated -and !$_.WakeToRun} Get-ScheduledJob | Get-ScheduledJobOption | Where-Object {$_.RunElevated -and !$_.WakeToRun} | ForEach-Object {$_.JobDefinition}Identify

Use job options to create a new job

$registerScheduledJobSplat = @{ Name = "Archive-Scripts" FilePath = "\\Srv01\Scripts\ArchiveScripts.ps1" ScheduledJobOption = Get-ScheduledJobOption -Name "BackupTestLogs" } Register-ScheduledJob @registerScheduledJobSplatIdentify

Get job options from a remote computer

$O = Invoke-Command -ComputerName "Srv01" -ScriptBlock {Get-ScheduledJob -Name "DataDemon" }Identify

Its page in the reference: Get-ScheduledJobOption.

Parameters

3 in the PowerShell reference
-IdSpecifies the identification number of a scheduled job. Get-ScheduledJobOption gets the job options of the specified scheduled job. To get the identification numbers of scheduled jobs on the local computer or a remote computer, use the Get-ScheduledJob cmdlet.
-InputObjectSpecifies a scheduled job. Enter a variable that contains a ScheduledJob object or type a command or expression that gets a ScheduledJob object, such as a Get-ScheduledJob command. You can also pipe a ScheduledJob object to Get-ScheduledJobOption.
-NameSpecifies the names of scheduled jobs. Get-ScheduledJobOption gets the job options of the specified scheduled job. Wildcards are supported. To get the names of scheduled jobs on the local computer or a remote computer, use the Get-ScheduledJob cmdlet.