Scheduled Task for Powershell does not observe the Tasks "start in" directory - by Craig S Williams

Status : 

 


1
0
Sign in
to vote
ID 771860 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 11/21/2012 9:25:18 AM
Access Restriction Public

Description

Not sure if this is defect of the Task Scheduler or Powershell.
Using psv2 on 2008R2.
When the task "program" is "powershell" the "Start in" path is observed and the $pwd of the script execution is the "start in" dir
However, when the task "program" is "powershell.exe" the "Start in" path is NOT observed and the $pwd of the script execution is C:\windows\system32
So when the script writes to a file, and you expect the current dir to be the "start in" dir, it is not unless you remember to make the tasks "program" = "powershell" without .exe
Sign in to post a comment.