Skip to content

Add error for Get-PSSession -ComputerName on Unix#21009

Merged
iSazonov merged 2 commits intoPowerShell:masterfrom
jborean93:pssession-computer
Dec 5, 2024
Merged

Add error for Get-PSSession -ComputerName on Unix#21009
iSazonov merged 2 commits intoPowerShell:masterfrom
jborean93:pssession-computer

Conversation

@jborean93
Copy link
Copy Markdown
Collaborator

PR Summary

Emit an exception when attempting to use Get-PSSession -ComputerName on a non-Windows platform that makes it clear it cannot be used on those platforms. Now when running this on non-Windows it will emit the following error.

PS /home/jborean/dev/PowerShell> Get-PSSession -ComputerName foo
Get-PSSession: Remote PSSession enumeration with -ComputerName is only supported on Windows and not "Arch Linux".

PR Context

I don't think this feature will ever be implemented, even if it is it would be nice to error with a proper message not the current

Get-PSSession: The term 'New-WSManSessionOption' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Fixes: #20995

PR Checklist

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log Extra Small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get-PSSession with -ComputerName does not work

3 participants