-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add remote runspace check for PushRunspace #24239
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
Conversation
iSazonov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is API comment I'd explicitly point it should be RemoteRunspace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RemoteRunspace is not a public class so I can't really reference it in the API docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be clearer, but I don't insist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'll leave it off unless others also prefer it in there. I'm unsure how the docs would actually be rendered if a non-public type was referenced here.
6f261a9 to
f5f9988
Compare
Add explicit exception when attempting to call PushRunspace on a runspace that is not remote. Instead of failing with a hard to understand NullReferenceException an ArgumentException is raised with information about what went wrong.
Co-authored-by: Ilya <[email protected]>
Co-authored-by: Ilya <[email protected]>
f5f9988 to
29032ea
Compare
SeeminglyScience
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks Jordan!
PR Summary
Add explicit exception when attempting to call PushRunspace on a runspace that is not remote. Instead of failing with a hard to understand NullReferenceException an ArgumentException is raised with information about what went wrong.
Fixes: #5735
PR Context
Someone in the PS Discord was trying to get this working and didn't know why it was failing. The issue #5735 was auto closed by the bot but I think this should still be in place.
While the
RemoteRunspacecheck is in place on the default ConsoleHost I am not aware of any other implementations that work with a localRunspaceso thought it best to just update the doc string to clearly indicate that the runspace should be a remote one.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.- [ ] Issue filed:
(which runs in a different PS Host).