darkoperator / darkoperator/Posh-SSH

Set-SCPItem - Object reference not set to an instance of an object.

Open
#398 5 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,

Trying to migrate the set-scpfile commands over to set-scp item and with the latest best 3,0 beta 2 I am getting below error.


$lfile = "C:\Users\myuser\AppData\Local\Temp\runlist.json"
$rpath = "/vmware/input"
$SCPSPlat = @{
    ComputerName      = $VMIP
    Credential        = $Credential
    Destination       = $rpath
    Path              = $lfile
    AcceptKey         = $true
    Force             = $true 
    OperationTimeout  = 30
    ConnectionTimeout = 30
    Verbose           = $true
    Debug = $true
    ErrorAction       = "Stop"
    }
$foo = Set-SCPItem @SCPSPlat
Name                           Value
----                           -----
PSVersion                      5.1.17763.1852
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.1852
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

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 with the Set-SCPItem entry point and reproduce the null-reference error using the provided PowerShell parameters, including Verbose and Debug output. Trace the failing transfer path and verify that the command completes the SCP upload without the object-reference exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.