![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | scheduled task output is truncated I have a powershell script run as a scheduled task - as such CMD.EXE is used to launch psh. The script attaches a table of data to Send-SmtpMail - but when it does this running under cmd.exe the table output is truncated to the size of the command window. I don't seem to be able to use a modified shortcut to CMD.EXE in order to change the layout to a suitable size and I can't find reference on how to change this setting at runtime. Any ideas? Cheers, Neil |
| | #2 (permalink) |
| Guest | Re: scheduled task output is truncated "Neil Chambers" <n3llyb0y@aol.com> wrote in message news:2007071115305143658-n3llyb0y@aolcom... >I have a powershell script run as a scheduled task - as such CMD.EXE is >used to launch psh. Why not launch Powershell.exe directly from the scheduled task? I have several scheduled tasks that do just this: C:\windows\system32\WindowsPowershell\v1.0\powershell.exe -command c:\bin\CatalogFileSystem.ps1 C: D: When generating the table can you use format-table's -width parameter to force the output to be wider? -- Keith |
| | #3 (permalink) |
| Guest | Re: scheduled task output is truncated On 2007-07-11 16:17:24 +0100, "Keith Hill" <r_keith_hill@mailhot.moc.no_spam_I> said: > "Neil Chambers" <n3llyb0y@aol.com> wrote in message > news:2007071115305143658-n3llyb0y@aolcom... >> I have a powershell script run as a scheduled task - as such CMD.EXE is >> used to launch psh. > > Why not launch Powershell.exe directly from the scheduled task? I have > several scheduled tasks that do just this: > > C:\windows\system32\WindowsPowershell\v1.0\powershell.exe -command > c:\bin\CatalogFileSystem.ps1 C: D: > > When generating the table can you use format-table's -width parameter > to force the output to be wider? my bad. What I meant to say was that I am calling powershell directly from the scheduler and I thought it was cmd.exe that actually launched powershell but I see now that it is svchost.exe responsible for calling powershell but it still looks like a cmd.exe command window (same default height, width) when the task first kicks off? AFAICT there is no -width parameter. There is a -wrap parameter which does give me all of the output but, as you can probably guess, as wrapped text (which is just not cricket). Is there any way at all I can just specify the default size of the command window? (and now I'm really confused - does powershell launch directly or is it being called via cmd/svchost?) argh! Cheers, neil |
| | #4 (permalink) |
| Guest | Re: scheduled task output is truncated "Neil Chambers" <n3llyb0y@aol.com> wrote in message news:200707111648318930-n3llyb0y@aolcom... > AFAICT there is no -width parameter. There is a -wrap parameter which does > give me all of the output but, as you can probably guess, as wrapped text > (which is just not cricket). > > Is there any way at all I can just specify the default size of the command > window? (and now I'm really confused - does powershell launch directly or > is it being called via cmd/svchost?) argh! You can modify the width properties of the console window that appears but that is a bit brittle. You can try sending your output through Out-String. That is the cmdlet that has a -width parameter not format-table (sorry for sending you down the wrong path). I've attached a logging function library that I use that works pretty good although it doesn't capture output written directly to the host. -- Keith |
| | #5 (permalink) |
| Guest | Re: scheduled task output is truncated On 2007-07-11 21:43:59 +0100, "Keith Hill [MVP]" <r_keith_hill@mailhot.moc_no_spam_I> said: > > > "Neil Chambers" <n3llyb0y@aol.com> wrote in message > news:200707111648318930-n3llyb0y@aolcom... >> AFAICT there is no -width parameter. There is a -wrap parameter which >> does give me all of the output but, as you can probably guess, as >> wrapped text (which is just not cricket). >> >> Is there any way at all I can just specify the default size of the >> command window? (and now I'm really confused - does powershell launch >> directly or is it being called via cmd/svchost?) argh! > You can modify the width properties of the console window that appears > but that is a bit brittle. You can try sending your output through > Out-String. That is the cmdlet that has a -width parameter not > format-table (sorry for sending you down the wrong path). I've > attached a logging function library that I use that works pretty good > although it doesn't capture output written directly to the host. Thanks again, Keith. It appears this issue is just going to plague me, though. Out-String is neat but when the console window is less that the output string, the line wraps. I'm just going to modify the table output to be 80 char friendly :-) Cheers, Neil |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Missing scheduled task? | SonicJoe | Vista performance & maintenance | 6 | 11-07-2007 01:48 PM |
| Scheduled task from standby---help! | ksipp01 | Vista General | 12 | 11-04-2007 12:29 PM |
| Scheduled task failed | njem | Vista General | 0 | 08-20-2007 04:53 PM |
| How do you rename a scheduled task | Keith Hill [MVP] | Vista account administration | 3 | 07-26-2007 12:32 PM |
| Can a Scheduled Task be renamed? | Fred B. | Vista General | 4 | 05-03-2007 05:05 AM |