PowerShell script doesn't run when using Start in (Optional) field.
I have simple PowerShell Script to create a task scheduler which schedule the task and job will run the bat file. I was able to create the task but I have to add the path @ Start in (optional) field. I was able to add the path in Add arguments but not finding the details how can I add the file path to Start in.
$Trigger= New-ScheduledTaskTrigger -At 10:00am -Once
$User= "username"
$Action= New-ScheduledTaskAction -Execute "full BAT file location\123.bat" -Argument "bat file location"
Register-ScheduledTask -TaskName "BAT Task" -Trigger $Trigger -User $User -Action $Action -RunLevel Highest –Force
When I run the PS script it should add the details in Start in field.