Missing output

Home Forums Scripting PowerShell Missing output

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Avatar
    SnijdeA
    Member
    #161719

    Hi,

    When I write a script with this content:

    Clear-Host
    Get-Process | Export-CliXML C:tempprocess.xml
    $ProcHistory = Import-CliXML C:tempprocess.xml
    $ProcHistory[/CODE]

    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:tempprocess.xml
    $ProcHistory = Import-CliXML C:tempprocess.xml
    $ProcHistory
    $ProcHistory | Where-Object {$_.Handles -gt 700} | Sort-Object Handles[/CODE]

    Then the last line does not produce any output, but when I change it into:

    [CODE]Clear-Host
    Get-Process | Export-CliXML C:tempprocess.xml
    $ProcHistory = Import-CliXML C:tempprocess.xml
    $ProcHistory | Where-Object {$_.Handles -gt 700} | Sort-Object Handles[/CODE]

    Then the last line does produce output.

    Does anybody know why in the second case the last line does not produce any output?[CODE]Clear-Host
    Get-Process | Export-CliXML C:tempprocess.xml
    $ProcHistory = Import-CliXML C:tempprocess.xml
    $ProcHistory[/CODE]

    Then the export file is created, it’s read and the processes are displayed.

    When I change the script to:

    Clear-Host
    Get-Process | Export-CliXML C:tempprocess.xml
    $ProcHistory = Import-CliXML C:tempprocess.xml
    $ProcHistory
    $ProcHistory | Where-Object {$_.Handles -gt 700} | Sort-Object Handles[/CODE]

    Then the last line does not produce any output, but when I change it into:

    [CODE]Clear-Host
    Get-Process | Export-CliXML C:tempprocess.xml
    $ProcHistory = Import-CliXML C:tempprocess.xml
    $ProcHistory | Where-Object {$_.Handles -gt 700} | Sort-Object Handles[/CODE]

    Then the last line does produce output.

    Does anybody know why in the second case the last line does not produce any output?[CODE]Clear-Host
    Get-Process | Export-CliXML C:tempprocess.xml
    $ProcHistory = Import-CliXML C:tempprocess.xml
    $ProcHistory
    $ProcHistory | Where-Object {$_.Handles -gt 700} | Sort-Object Handles[/CODE]

    Then the last line does not produce any output, but when I change it into:

    Clear-Host
    Get-Process | Export-CliXML C:tempprocess.xml
    $ProcHistory = Import-CliXML C:tempprocess.xml
    $ProcHistory | Where-Object {$_.Handles -gt 700} | Sort-Object Handles[/CODE]

    Then the last line does produce output.

    Does anybody know why in the second case the last line does not produce any output?[CODE]Clear-Host
    Get-Process | Export-CliXML C:tempprocess.xml
    $ProcHistory = Import-CliXML C:tempprocess.xml
    $ProcHistory | Where-Object {$_.Handles -gt 700} | Sort-Object Handles[/CODE]

    Then the last line does produce output.

    Does anybody know why in the second case the last line does not produce any output?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.