darkoperator / darkoperator/Posh-SSH

empty hosts.json throws ugly error

Open
#602 0 comments 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

I was just horsing around. I zeroed out $HOME\.poshss\hosts.json and got this ugly error.

Line |
  17 |  $Session = New-SSHSession -ComputerName $target -AcceptKey -Verbose
     |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Expecting element 'root' from namespace ''.. Encountered 'None'  with name '', namespace ''.

An empty dict {} in the hosts.json doesn't error.

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 by reproducing the issue with an empty $HOME.poshss\hosts.json and the New-SSHSession command shown in the report. Trace how hosts.json is read and determine the expected handling for an empty file; done means the empty-file case no longer produces the reported ugly parser error.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.