Why can a PowerShell script work interactively but fail as a scheduled task?
Documentation: Microsoft Learn
The task may run under a different identity, engine, working directory, profile, environment, network context or permission scope.
Interview · Question 34 of 34
Answer before reveal
Your draft
Write the answer you would give in an interview. The model answer stays hidden until you have drafted at least a short response.
A strong answer
The task may run under a different identity, engine, working directory, profile, environment, network context or permission scope. Capture those facts from the task itself before changing the script.
Show it concretely
Expect this follow-up
How would you capture useful diagnostics without writing secrets to the task log?