This article has not been completed yet. However, it may already contain helpful information and therefore it has been published at this stage.

# Define the interval to repeat the job

# Example 1 (daily at 09:00 AM without any limit)
# Var1:
$trigger = New-JobTrigger -Once -At 9:00AM -RepetitionInterval (New-TimeSpan -Hours 12) -RepeatIndefinitely
# Var2:
$trigger = New-JobTrigger-Daily -At 9:00AM

# Example 2 (every 5 minutes from 10:00 AM without any limit)
$trigger = New-JobTrigger -Once -At 10:00AM -RepetitionInterval (New-TimeSpan -Minutes 5) -RepeatIndefinitely

# Example 3 (every Monday, Wednesday, and Friday at 12:00 AM)
$trigger = New-JobTrigger -Weekly -DaysOfWeek 1,3,5 -At 12:00AM

# Get user credential so that the job has access to the network
$cred = Get-Credential -UserName <domain>\<someuser>

# Set job options
$opt = New-ScheduledJobOption -RunElevated -RequireNetwork

# Register Job
Register-ScheduledJob -Name <Name> -Trigger $trigger -Credential $cred `
 -FilePath <scriptpath> -MaxResultCount 10  -ScheduledJobOption $opt
# Displaying scheduled jobs
get-scheduledjob | ft -auto
Starting the Task Scheduler
Scheduled Jobs in the Task Scheduler GUI
Create PowerShell scheduled jobs
Today I’m going to walk you through one of the most underrated functions available in PowerShell: scheduled jobs. Microsoft introduced scheduled jobs in PowerShell v3, but they haven’t received a whole bunch of attention from admins over the years. Let’s change that!

Using Scheduled Tasks and Scheduled Jobs in PowerShell

New-JobTrigger (PSScheduledJob) - PowerShell
The New-JobTrigger cmdlet creates a job trigger that starts a scheduled job on a one-time or recurring schedule, or when an event occurs. You can use the ScheduledJobTrigger object that New-JobTrigger returns to set a job trigger for a new or existing scheduled job. You can also create a job trigger…