When i try to run the following script in a scheduled task the zipping part does not work. If i run it outside of the schedule task it works great. Is it because the script is running an EXE? Ideas to make it work?
I assume you are running the script under the same credentials both times? What Attributes are you using in the scheduled task when calling PowerShell as well as the start-in in directory? I just did a simple test, with just calling the 7zip and it created a files for me. Unless there is something I am missing in your code, others can comment, I don't have the time to test that right now.
by habs3 at 2012-12-18 10:27:51
I am using the directory that all the files are in and i tried using my domain admin account as well as the local admin account.
by robertskinner at 2012-12-18 13:12:16
Why not do a transcript dump to capture everything to see where problems may exist.
Start-Transcript "c:\temp\test.txt" YOUR CODE HERE stop-transcript