You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In /Posh-SSH.psm1, line 5 sets up $global:SshSessions as an arraylist.
In Remove-SshSession, lines 148 and 175 call $global:SshSessions.Remove($badsession). An arraylist, .Remove() has no return value, so that suggests Remove-SshSession is not intended to have any return value.
Remove-SshSession returns a bool for whether the session was removed from a List<>. Unless the global variable can stay as an arraylist, then it doesn't. Either way, "list removal" is not related to the SSH session itself, so it seems like an unhelpful return value and is possibly unintentional.
It's documented as having nothing for "Output", but the example usage shows that it has.
The text was updated successfully, but these errors were encountered:
I never fill out the output type of any of the functions.are you creating sessions by hand? they should always be created by the new-sshsession cmdlet that uses the sshmodhelper method.
I don't know how I was creating them.
Importing the module makea the stores ArrayLists, sshmodhelper casts those into List[SshSession].
I've just suggested a PR so they are created as List[SshSession] from the beginning.
In /Posh-SSH.psm1, line 5 sets up
$global:SshSessions
as an arraylist.In
Remove-SshSession
, lines 148 and 175 call$global:SshSessions.Remove($badsession)
. An arraylist,.Remove()
has no return value, so that suggests Remove-SshSession is not intended to have any return value.The C# code in PoshSSH/SshModHelper.cs, line 30 overrides the variable and makes it typed a generic list and generic list
.Remove()
returns bool.Remove-SshSession
returns a bool for whether the session was removed from a List<>. Unless the global variable can stay as an arraylist, then it doesn't. Either way, "list removal" is not related to the SSH session itself, so it seems like an unhelpful return value and is possibly unintentional.It's documented as having nothing for "Output", but the example usage shows that it has.
The text was updated successfully, but these errors were encountered: