Windows Vista Forums

Is there a (very small) length limit to write-host?
  1. #1


    K Kong Guest

    Is there a (very small) length limit to write-host?

    I have:

    #... some code ...
    write-host $string.Length
    write-host $string



    And it produces:

    36418
    Write-Host : The Win32 internal error "Not enough storage is available to
    process this command" 0x8 occurred when writing console output buffer at
    current cursor position. Please contact Microsoft Support Services.
    At C:\Get.ps1:52 char:11
    + write-host <<<< $string

      My System SpecsSystem Spec

  2. #2


    Gerd Schneider Guest

    RE: Is there a (very small) length limit to write-host?

    I would expect that write-host doesn't have a hardcoded limit, but that the
    possible output size is somehow related to the console buffer settings
    "Console - Layout - Screen Buffer Size - Width x Height". But I don't know
    for sure nor did I do any tests, that's just speculation.

    Gerd

    "K Kong" wrote:

    > I have:
    >
    > #... some code ...
    > write-host $string.Length
    > write-host $string
    >
    > And it produces:
    >
    > 36418
    > Write-Host : The Win32 internal error "Not enough storage is available to
    > process this command" 0x8 occurred when writing console output buffer at
    > current cursor position. Please contact Microsoft Support Services.
    > At C:\Get.ps1:52 char:11
    > + write-host <<<< $string


      My System SpecsSystem Spec

  3. #3


    Don Jones [MVP] Guest

    Re: Is there a (very small) length limit to write-host?

    That sounds like a Windows console error being given to PowerShell, rather
    than a PowerShell error. I've written fairly huge strings to the console
    without issue.

    --
    Don Jones
    Windows PowerShell MVP
    Founder: www.ScriptingAnswers.com
    Co-Author: "Windows PowerShell: TFM"

    "K Kong" <KKong@discussions.microsoft.com> wrote in message
    news:2E34A42B-A0DD-4E98-8F49-29A1FC5E6565@microsoft.com...
    >I have:
    >
    > #... some code ...
    > write-host $string.Length
    > write-host $string
    >
    > And it produces:
    >
    > 36418
    > Write-Host : The Win32 internal error "Not enough storage is available to
    > process this command" 0x8 occurred when writing console output buffer at
    > current cursor position. Please contact Microsoft Support Services.
    > At C:\Get.ps1:52 char:11
    > + write-host <<<< $string



      My System SpecsSystem Spec

  4. #4


    Thad Kovalchik Guest

    write-host" Win32 internal error not enough storage...

    Was there any resolution for this? The best I have been able to to find is to issue a smaller string Write-Host to intially get the console to except the longer output. On my system the magic length was 15557. I am asuuming this the number of bytes per the console setting used by Power Shell.




    Don Jones [MVP] wrote:

    That sounds like a Windows console error being given to PowerShell, rather
    10-May-07

    That sounds like a Windows console error being given to PowerShell, rather
    than a PowerShell error. I've written fairly huge strings to the console
    without issue.

    --
    Don Jones
    Windows PowerShell MVP
    Founder: www.ScriptingAnswers.com
    Co-Author: "Windows PowerShell: TFM"

    "K Kong" <KKong@newsgroup> wrote in message
    news:2E34A42B-A0DD-4E98-8F49-29A1FC5E6565@newsgroup

    Previous Posts In This Thread:

    On Thursday, May 10, 2007 1:32 AM
    KKon wrote:

    Is there a (very small) length limit to write-host?
    I have:

    write-host $string.Length
    write-host $string

    And it produces:

    36418
    Write-Host : The Win32 internal error "Not enough storage is available to
    process this command" 0x8 occurred when writing console output buffer at
    current cursor position. Please contact Microsoft Support Services.
    At C:\Get.ps1:52 char:11
    + write-host <<<< $string

    On Thursday, May 10, 2007 4:06 AM
    GerdSchneide wrote:

    I would expect that write-host doesn't have a hardcoded limit, but that the
    I would expect that write-host doesn't have a hardcoded limit, but that the
    possible output size is somehow related to the console buffer settings
    "Console - Layout - Screen Buffer Size - Width x Height". But I don't know
    for sure nor did I do any tests, that's just speculation.

    Gerd

    "K Kong" wrote:

    On Thursday, May 10, 2007 1:19 PM
    Don Jones [MVP] wrote:

    That sounds like a Windows console error being given to PowerShell, rather
    That sounds like a Windows console error being given to PowerShell, rather
    than a PowerShell error. I've written fairly huge strings to the console
    without issue.

    --
    Don Jones
    Windows PowerShell MVP
    Founder: www.ScriptingAnswers.com
    Co-Author: "Windows PowerShell: TFM"

    "K Kong" <KKong@newsgroup> wrote in message
    news:2E34A42B-A0DD-4E98-8F49-29A1FC5E6565@newsgroup


    Submitted via EggHeadCafe - Software Developer Portal of Choice
    WPF GridView Sample To Insert, Update, and Delete Records
    http://www.eggheadcafe.com/tutorials...ple-to-in.aspx

      My System SpecsSystem Spec

Is there a (very small) length limit to write-host? problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Display differences Write-Host and Write-Warning TreyS PowerShell 1 01 Jan 2010
write-host? no thanks Joe PowerShell 2 10 Dec 2008
When to use write-host? how to display variable value? PowerShell 1 20 Aug 2008
1..9|%{write-host $_:443} PowerShell 11 21 Jul 2007
redirect write-host DouglasWoods PowerShell 12 26 Apr 2007