Announcement

Collapse
No announcement yet.

Missing output

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Missing output

    Hi,

    When I write a script with this content:

    Code:
    Clear-Host
    Get-Process | Export-CliXML C:\temp\process.xml
    $ProcHistory = Import-CliXML C:\temp\process.xml
    $ProcHistory
    Then the export file is created, it's read and the processes are displayed.

    When I change the script to:

    Code:
    Clear-Host
    Get-Process | Export-CliXML C:\temp\process.xml
    $ProcHistory = Import-CliXML C:\temp\process.xml
    $ProcHistory
    $ProcHistory | Where-Object {$_.Handles -gt 700} | Sort-Object Handles
    Then the last line does not produce any output, but when I change it into:

    Code:
    Clear-Host
    Get-Process | Export-CliXML C:\temp\process.xml
    $ProcHistory = Import-CliXML C:\temp\process.xml
    $ProcHistory | Where-Object {$_.Handles -gt 700} | Sort-Object Handles
    Then the last line does produce output.

    Does anybody know why in the second case the last line does not produce any output?
    Last edited by Rems; 14th June 2013, 10:20.
    Regards,
    SnijdeA.

  • #2
    Re: Missing output

    The last line of the second case does produce output om my computer: Windows 7 pro Sp1, Windows powershell version 2.0

    /Rems

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment


    • #3
      Re: Missing output

      Hmm, did you run all lines on the commandline or in a .PS1?
      Regards,
      SnijdeA.

      Comment


      • #4
        Re: Missing output

        I was not looking properly, the lines from the last command are displayed, it's merged with the output of the first command.
        Duh
        Thank you.
        Regards,
        SnijdeA.

        Comment

        Working...
        X