Add remote runspace check for PushRunspace#24239
Merged
Merged
Conversation
iSazonov
reviewed
Sep 2, 2024
Collaborator
There was a problem hiding this comment.
Since it is API comment I'd explicitly point it should be RemoteRunspace.
Collaborator
Author
There was a problem hiding this comment.
RemoteRunspace is not a public class so I can't really reference it in the API docs.
Collaborator
There was a problem hiding this comment.
I think it would be clearer, but I don't insist.
Collaborator
Author
There was a problem hiding this comment.
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.
iSazonov
reviewed
Sep 2, 2024
iSazonov
approved these changes
Sep 3, 2024
jborean93
force-pushed
the
push-runspace
branch
from
October 3, 2024 20:29
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 <darpa@yandex.ru>
Co-authored-by: Ilya <darpa@yandex.ru>
jborean93
force-pushed
the
push-runspace
branch
from
October 3, 2024 21:59
f5f9988 to
29032ea
Compare
SeeminglyScience
approved these changes
Dec 4, 2024
SeeminglyScience
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks Jordan!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).