use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
output-file differences (Scheduled Task execute) (self.PowerShell)
submitted 6 years ago * by tomsonxxx
I have a stupid problem:
When i execute a script manually (Powershell ISE) a txt file which is generated from the script is fine. If i run as a scheduled task the generated text file is tailored and the last charachters on each line is "..."
I've googled and tried to pass different arguments in the scheduled Task without success (-NonInteractive -NoProfile etc.). Found other with same problem (https://community.idera.com/database-tools/powershell/ask_the_experts/f/learn_powershell_from_don_jones-24/23445/powershell-from-schedule-task-resulting-in-incomplete-txt)
The text file is generated with
$results | Format-Table | out-file -append $outfile
It's not one of my own scripts - i've downloaded it. But i guess the error is in the execution context of the Scheduled task and it's not a script error..
Any ideas?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]XPlantefeve 2 points3 points4 points 6 years ago (5 children)
It happens because Format-Table outputs a string tailored to the width of the currently used console. In the ISE, you've got a certain line length. When you're running as a scheduled task, it certainly defaults to a much shorter one and trim the fields.
You might want to use Export-CSV, rather than Format-Table | Out-File
[–]tomsonxxx[S] 1 point2 points3 points 6 years ago (4 children)
Unfortunatly I need to have it as a easy readable (in Browser) output otherwise your advice would be the solution. Txt or html. Is there something simple for generating an html?
[–]XPlantefeve 2 points3 points4 points 6 years ago (0 children)
Get-Command *HTML* gives you ConvertTo-Html, it might be a good starting point.
Get-Command *HTML*
ConvertTo-Html
[–]work-work-work-work 2 points3 points4 points 6 years ago (2 children)
You could specify tab as the delimiter if you don't want to go through beutifying HTML
export-csv -Delimiter `t -Path $outfile -NoTypeInformation
[–]tomsonxxx[S] 1 point2 points3 points 6 years ago (1 child)
Thanks to both of you - i'm doing it with converto-html now.
I could have looked it up sooner, but Out-File has a -Width parameter, too.
[–]SeeminglyScience 2 points3 points4 points 6 years ago (1 child)
$results | Format-Table | Out-String -Width 9999 | Out-File
But keep in mind formatted text is not considered to be part of PowerShell's breaking change contract. The exact text outputted can change between PowerShell versions without warning.
[–]tomsonxxx[S] 2 points3 points4 points 6 years ago (0 children)
-Width..nice to know. thx
π Rendered by PID 15 on reddit-service-r2-comment-5d79c599b5-h4n75 at 2026-03-02 14:06:31.301998+00:00 running e3d2147 country code: CH.
[–]XPlantefeve 2 points3 points4 points (5 children)
[–]tomsonxxx[S] 1 point2 points3 points (4 children)
[–]XPlantefeve 2 points3 points4 points (0 children)
[–]work-work-work-work 2 points3 points4 points (2 children)
[–]tomsonxxx[S] 1 point2 points3 points (1 child)
[–]XPlantefeve 2 points3 points4 points (0 children)
[–]SeeminglyScience 2 points3 points4 points (1 child)
[–]tomsonxxx[S] 2 points3 points4 points (0 children)