0

I started a few powershell jobs and I want to stop them at a scheduled time. I know the command to stop them is Stop-Job -Name $someName but I don't know how I can schedule this.

I mean I realize there is task scheduler, but how do I get to the jobs that are started inside my powershell window, since there seems to be some sort of scoping problem here.

Also, can I create the scheduled task from Powershell? That would solve my issue with leaving the Window and it not showing up in the powershell scope of the script that I run.

leeand00
  • 4,869
  • 15
  • 69
  • 110

1 Answers1

-1

You can create scheduled task in PowerShell with either schtasks.exe or the New-ScheduledTask cmdlet

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks

https://docs.microsoft.com/en-us/powershell/module/scheduledtasks/new-scheduledtask?view=win10-ps