Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output of command is returned when calling $? #66

Open
JUGI4U opened this issue Aug 29, 2019 · 0 comments
Open

Output of command is returned when calling $? #66

JUGI4U opened this issue Aug 29, 2019 · 0 comments

Comments

@JUGI4U
Copy link

JUGI4U commented Aug 29, 2019

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


436      22     7708      23476       1,83  12944   1 ABC                                                                          
488      28    30316      34532       3,06  11408   1 XYZ...                                                             

Execute command: $?
True

Execute command: Get-Process | Format-List *

Execute command: $?
Name : ABC
Id : 12944...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant