header1   header
header
header : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
IMPORTANT: PowerShellCommunity.org is moving! - Wednesday, August 15, 2012

PowerShellCommunity.org is moving!  This community software, and the hardware that it sits on, are no longer serving the purposes of this community.  As a result, we have decided to move this community to a new home at PowerShell.org.  PowerShell.org is already up and running with the new community software and in its new location, so please post any new questions that you have on the forums over there instead of posting them on this site.  We've already started getting some great questions from members of the community over there so please, come on over and join us!

While we are going through this transition, this site will remain up for the short term.  New posts may no longer be created on these forums, however replies to existing posts are allowed so that users who posted questions don't have to re-post the same question on the new site.

[UPDATE 28/02/2013] New user registration has been disabled and forums have now been switched to read-only, including for existing posts since all threads that were started should now be completed. If you have a question about content on this site or about PowerShell in general, head over to PowerShell.org and ask it there where there are people actively using the site and answering questions.

If you have any questions, please let us know on the PowerShell.org site.

Thank you,

Kirk "Poshoholic" Munro

 
PowerShell Hosting Bug imo
Last Post 27 Jun 2009 09:00 AM by CodeSlinger. 0 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
CodeSlingerUser is Offline
New Member
New Member
Posts:9
Avatar

--
27 Jun 2009 09:00 AM
    PowerShell is wonderful but it is unofrtunate there not only seems to be no concept of outputting to a sequential medium like a stream or a file but most strings sent to WriteLine are padded with blanks to match the BufferSize!!! I feel this is a serious bug that causes performance problems, resource issues and even crashes!

    My application implements PSHost and PSHostRawUserInterface and I have struggled with various techniques to try to eliminate line wrapping efficiently but this seems not possible. I am capturing output to put into a stream and basically do not have the concept of a "screen" and do not feel one should be necessary when hosting PowerShell in your own application.

    Here is what I have found:

    1. Seems only Buffersize matters as I do not even get called for WindowSize, MaxWindowSize or MaxPhysicalWindowSize. This is probably wrong in general but is true in my application and the CmdLets and PS scripts that I have run so far.

    2. BufferSize is called for each line of output and sometimes twice. Seems quite inefficient. Does it really need to be THAT dynamic??? I don't know of too many users that change their screensize in between cmdlets.

    3. I can set BufferSize width and control the wrapping but most output [esp. that seems to come from external sources like get-process and dir] is padded with blanks!!! This is terrible and is a bug imo and in the worst case scenario, if you set the width to int32.maxvalue it will throw out of memory and even set to 1024 or something "reasonable" to eliminate most line wrapping, this is terribly inefficient and wasteful of resources! It is a bug because only some output does this not all of it!!! So why should any of it?

    4. Height does not seem to matter whether I set it to 0 or 1 or whatever.

    5. If I set BufferSize to int32.maxvalue I run out of memory on many commands but not the ones that properly output a line without trailing blanks such as write-output and the other write-xxx commands.

    Microsoft, I absolutely love PowerShell but please allow the concept of outputting to a stream by perhaps adding a simple option saying I have no concept of a screen but still support write-host etc. or let me set BufferSize width to 0 or -1 to indicate I do NOT want line wrapping at all, and have no concept of a line length.

    Also, if I do set a BufferSize width, please do not pad the string with blanks to meet that width. Some commands already work like this and unfortunately many do not!

    Think outputting to a stream or file...not a screen!

    Sorry for the rant, hopefully I'm off base and am doing something wrong here.

    Thanks, Dave
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Many thanks to our original sponsors: Quest Software • SAPIEN Technologies • Compellent • Microsoft footer
    footer   footer