darkoperator / darkoperator/Posh-SSH

Return object from Invoke-SSHcommand

Open
#185 3 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

Hi, I would like to query a remote server to get a list of active policies and then be able to analyze them. I used these commands

$ssh = New-SSHSession -ComputerName $target_computer -Credential $cred -AcceptKey:$true
$gpos = $(Invoke-SSHCommand -SSHSession $ssh -Command ('powershell (Get-GPO -all)')).output

the variable $gpos is an array of strings, is it possible to get an object?
Thank you

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 at the Invoke-SSHCommand entry point and reproduce the New-SSHSession and Invoke-SSHCommand example from the issue. Trace how the remote output is collected and determine whether the command can return usable objects rather than an array of strings; done means the shown Get-GPO query can be analyzed as objects.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli, devops
Issue type
Feature
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.