PowerShell Genie

Why can a PowerShell script work interactively but fail as a scheduled task?

Question 1 min read Windows PowerShell 5.1 and PowerShell 7

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.

Primary documentation

Windows services and processes documentation

Continue
Genie guideWhy can a PowerShell script work interactively but fail as a scheduled task?

The task may run under a different identity, engine, working directory, profile, environment, network context or permission scope.