darkoperator / Posh-SSH

PowerShell Module for automating tasks on remote systems using SSH
BSD 3-Clause "New" or "Revised" License
969 stars 225 forks source link

Default SessionId #120

Open mvoidex opened 7 years ago

mvoidex commented 7 years ago

Thanks for this module.

Wouldn't it be useful to have 0 as default SessionId for most of cmdlets?

darkoperator commented 7 years ago

It is something I have thought about based on used by users, The module is not meant for use in a interactive shell but for automation of SSH tasks but it seems many people use it interactively.

On Nov 21, 2016, at 10:38 AM, Alexandr Ruchkin notifications@github.com wrote:

Thanks for this module.

Wouldn't it be useful to have 0 as default SessionId for most of cmdlets?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/darkoperator/Posh-SSH/issues/120, or mute the thread https://github.com/notifications/unsubscribe-auth/AAf0Hmi-L9pnm7qhdLXkTdMxA5pNAC9mks5rAazMgaJpZM4K4Rdc.

darkoperator commented 7 years ago

I would need to do some major refactoring after playing with one of the cmdlets, so the option would not mandatory, it would need to check if we have one or more sessions, select the first one from the list since 0 may be not there and provide a proper error if there are more than one, if there are none, a verbose print saying which one was select. All of this for compiled cmdlets in C# and PowerShell. it would be a nice PR ;)