darkoperator / darkoperator/Posh-SSH

New-SSHRemotePortForward function not work

Open
#192 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
1.1k
Forks
222
PR merge metrics
No merged PRs in 30d

Description

PS D:\Posh-SSH> Get-SSHSession
PS D:\Posh-SSH> New-SSHSession -ComputerName 192.168.3.42 -Credential root -Port 22

SessionId Host Connected


0      192.168.3.42                                                     True

PS D:\Posh-SSH> New-SSHRemotePortForward -LocalAdress 192.168.4.8 -LocalPort 1337 -RemoteAddress 192.168.5.6 -RemotePort 3389 -Index 0

Write-Verbose : Cannot bind argument to parameter 'Message' because it is null.
At D:\Posh-SSH\PortForward.ps1:186 char:31

  •             Write-Verbose $session.index
    
  •                           ~~~~~~~~~~~~~~
    
  • CategoryInfo : InvalidData: (:) [Write-Verbose], ParameterBindingValidationException
  • FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.WriteVerboseCommand

PS D:\Posh-SSH>

New-SSHLocalPortForward and New-SSHDynamicPortForward work is no problem, only New-SSHRemotePortForward does not work, I hope to help solve, thank you very much

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in PortForward.ps1 around line 186 and reproduce the issue with the New-SSHRemotePortForward command shown in the report. Trace why $session.index is null, then verify that remote port forwarding completes without the Write-Verbose binding error.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.