-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add error for Get-PSSession -ComputerName on Unix #21009
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -123,6 +123,9 @@ | |||||
| <data name="OutOfMemory" xml:space="preserve"> | ||||||
| <value>Out of process memory.</value> | ||||||
| </data> | ||||||
| <data name="UnsupportedOSForRemoteEnumeration" xml:space="preserve"> | ||||||
| <value>Remote PSSession enumeration with -ComputerName is only supported on Windows and not "{0}".</value> | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes no sense to point OS version. Please remove:
Suggested change
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find it provides a few extra debug details and doesn't hurt to include. It's also somewhat helpful to identify where the cmdlet was run when it comes to remoting ones as people may be confused if the OS platform is local or remote based. Including the local OS information in the error helps to avoid that ambiguity. |
||||||
| </data> | ||||||
| <data name="PipelineIdsDoNotMatch" xml:space="preserve"> | ||||||
| <value>Pipeline ID "{0}" does not match the InstanceId of the pipeline that is currently running, "{1}".</value> | ||||||
| </data> | ||||||
|
|
||||||
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.
Our common pattern is to check whether a parameter presents.
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.
Is there a particular reason for this. The code uses the
ComputerNameproperty value and thus it makes more sense to do the check on the actual property rather than a pwsh-ism here. It's also cleaner and shorter than accessing a dictionary to check if a key exists vs just checking the property value.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.
Yeah there are situations where it's better but I think it's fine here.