Set-SCPItem - Object reference not set to an instance of an object.
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
Can you also share the error output
Sent from my iPhone
On May 31, 2021, at 6:50 AM, Ionut-Dan Nica @.***> wrote:
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 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
There's not much being provided:
Set-SCPItem : Object reference not set to an instance of an object.
At line:1 char:8
+ $foo = Set-SCPItem @SCPSPlat
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Renci.SshNet.ScpClient:ScpClient)
[Set-SCPItem], NullReferenceException
+ FullyQualifiedErrorId : SSH.SetScpItem
I got this from digging into error variable PS C:> $error[1] | select *
PSMessageDetails :
Exception : System.NullReferenceException: Object reference not set to
an instance of an object.
at SSH.SetScpItem.ProcessRecord()
TargetObject : Renci.SshNet.ScpClient
CategoryInfo : OperationStopped: (Renci.SshNet.ScpClient:ScpClient)
[Set-SCPItem], NullReferenceException
FullyQualifiedErrorId : SSH.SetScpItem
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {}
Currently on vacation with no laptop will check later this week
Sent from my iPhone
On May 31, 2021, at 7:39 AM, Ionut-Dan Nica @.***> wrote:
There's not much being provided:
Set-SCPItem : Object reference not set to an instance of an object. At line:1 char:8
- $foo = Set-SCPItem @SCPSPlat
~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : OperationStopped: (Renci.SshNet.ScpClient:ScpClient) [Set-SCPItem], NullReferenceException
- FullyQualifiedErrorId : SSH.SetScpItem
I got this from digging into error variable PS C:> $error[1] | select *
PSMessageDetails : Exception : System.NullReferenceException: Object reference not set to an instance of an object. at SSH.SetScpItem.ProcessRecord() TargetObject : Renci.SshNet.ScpClient CategoryInfo : OperationStopped: (Renci.SshNet.ScpClient:ScpClient) [Set-SCPItem], NullReferenceException FullyQualifiedErrorId : SSH.SetScpItem ErrorDetails : InvocationInfo : System.Management.Automation.InvocationInfo ScriptStackTrace : at <ScriptBlock>, <No file>: line 1 PipelineIterationInfo : {}
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Found the bug and that lead me to another one im trying to solve. Will update with another beta soon
Beta 3 with fix pushed to gallery