I am having a problem with portions of powershell scripts not executing when the script runs from a scheduled task. When manually executed, it operates just fine.
For example, I have the following in a script:
add-content c:\some_folder\output.txt "howdy" c:\windows\system32\notepad.exe
When I manually run the script, both commands execute. When the scheudled task runs, the first command executes, but the second does not. This is an over-simplified example, but I have more complex scripts where I get similar behavior...the script does what it is supposed to when run manually but parts do not run when run from a scheduled task.
The scheduled task is set to run as local administrator with the "Run with highest privileges" option selected.