Repository navigation
Change task settings.
$Settings = New-ScheduledTaskSettingsSet `
-AllowStartIfOnBatteries `
-DontStopIfGoingOnBatteries `
-DontStopOnIdleEnd `
-StartWhenAvailable `
-DisallowDemandStart `
-DisallowHardTerminate `
-MultipleInstances IgnoreNew `
-ExecutionTimeLimit (New-TimeSpan -Seconds 0)