Please check this sequence of commands:
*Get-Process
$?
Get-Process | Format-List
$?**
The first Get-Process and $? work as expected.
But the second call of Get-Process returns an empty response.
However its result (or at least part of it) is returned when calling $? afterwards.
It seems that Format-List * seems to make trouble.
When I start the command with PS_ISE, it works as expected.
BTW: The same applies when replacing $? with $error.
Sample output:
Execute command: Get-Process
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
Please check this sequence of commands: *Get-Process $? Get-Process | Format-List $?**
The first Get-Process and $? work as expected. But the second call of Get-Process returns an empty response. However its result (or at least part of it) is returned when calling $? afterwards.
It seems that Format-List * seems to make trouble. When I start the command with PS_ISE, it works as expected.
BTW: The same applies when replacing $? with $error.
Sample output: