I have generated a script that is about 800 lines long. The script asks the user a few questions intially and then goes off and does it's stuff.
In a perfect world the script always works but if it spits an error out it usually disappears off the screen before the user gets a chance to make a note of it.
I would like the script to be able to output everything it displays on the screen to a log file as well, this way we can review it later if need be.
Currently I call the script the following way:
C:\WINDOWS\system32\WindowsPowerShell\v1.0\PowerShell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1" -command ". 'C:\PowerShellScripts\Test.ps1'"
Thanks
Troy |