New Scheduled Job

Spent quite a bit of time on this, but coming up short. Basically, I'm trying to create a scheduled job to start a powershell script. The action that is "start a program" and the details are "Powershell.exe -ExecutionPolicy Bypass c:\scripts\misc\5-17\survey.ps1 -RunType $true -Path c:\scripts\misc\5-17". When I create the job manually via the gui and input these values it works fine when I run it, but I can get the powershell command below to create the task that will run properly.

So, for clarity, are you trying to create a scheduled task, or a scheduled job? The latter is a powershell only thing, and while it uses Task Scheduler, it is not the same as a scheduled task. There's also no GUI for creating a scheduled job, which is why I'm checking.

A job is created, but nothing takes place when I run it. Now, the script is interactive (loads a menu for the user), so it may have something to do with setting it to interactive (looking at that now) as I see -Noninteractive set as detail.

Jobs are very different than a scheduled task. They definitely can't do interactive. And, any results they produce are stored on disk and must be retrieved by using Receive-Job. Scheduled jobs aren't a substitute for Scheduled Tasks – they have a unique purpose and way of executing.

It seems like you're kind of hoping they'll work like a normal scheduled task and just run your script – but they won't :).

Thanks Don. I've yet to find a way to create scheduled tasks with Powershell (New-ScheduledTaskAction not available in Windows 7). I can manually create a "Task" in the ScheduledJobs folder that correctly launches the script I'm working with and I can also edit a task/job I create with the Register-ScheduledJob cmdlt, so the job I am creating (after being edited) does launch the script properly. I would love to use scheduled tasks, but that isn't available as far as I can tell for Windows 7. Per your earlier comment around not being able to edit jobs, when I create a job via Register-ScheduledJob it appears in the task scheduler GUI and is able to be edited via the GUI. Not sure if we are talking about different things?

A scheduled JOB does in fact create a scheduled TASK, but the TASK merely launches the PowerShell job subsystem. If you don't want to be using the job subsystem, you should not be using the ScheduledJob commands – they aren't interchangeable with simpler tasks.

The reason the details of the task look weird to you is because that's what the task has to look like in order to invoke the job subsystem.