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

WriteStream (Receive-Job) output cannot be redirected #172

Open
jdkang opened this issue Dec 13, 2017 · 1 comment
Open

WriteStream (Receive-Job) output cannot be redirected #172

jdkang opened this issue Dec 13, 2017 · 1 comment
Labels

Comments

@jdkang
Copy link

jdkang commented Dec 13, 2017

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Receive-Job uses WriteStream writes streams (warning, error, etc) directly tot he $host.

Redirect (e.g. *>&1) and Common Params -WarningVariable foo do not seem to function as expected.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

Redirection

Start-RSJob -ScriptBlock { write-warning 'warning'; write-error 'error' } | Wait-RSJob |
Receive-RSJob *>&1
WARNING: warning
error

Common Params

Start-RSJob -ScriptBlock { write-warning 'warning'; write-error 'error' } | Wait-RSJob |
Receive-RSJob -WarningVariable wv; $wv
WARNING: warning
error

What is the expected behavior?
Some manner to capture warning/error output streams (e.g. for logging)

Which versions of Powershell and which OS are affected by this issue? Did this work in previous versions of our scripts?
v5.1 Windows
PsRsJob 1.7.3.9

Please provide a code example showing the issue, if applicable:
See above

@ghost
Copy link

ghost commented Jan 12, 2018

Any scope for re-direction?

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

No branches or pull requests

2 participants