Cannot process argument transformation on parameter 'ShellStream'. Cannot convert the "Renci.SshNet.ShellStream" value of type "Renci.SshNet.ShellStream" to type "Renci.SshNet.ShellStream".
See original GitHub issueWhile triggering Invoke-SSHStreamShellCommand
, I am getting Cannot convert the “Renci.SshNet.ShellStream” value of type “Renci.SshNet.ShellStream” to type “Renci.SshNet.ShellStream”. Error on azure devops pipeline.
Script block
function remoteConnectEngine($secUsername, $VmPassword, $remoteMachine) {
$password = ConvertTo-SecureString $VmPassword -AsPlainText -Force;
$pscredential = New-Object -TypeName System.Management.Automation.PSCredential("$secUsername", $password);
removeExistingSession;
Write-Host "##[section] Get the current EPOCH time !!!"
Start-Sleep -Seconds 5;
$triggerJMeterTest = "bash ./startJMeterTest.sh";
foreach ($rm in $remoteMachine) {
$currentSessionID = New-SSHSession -ComputerName $rm -Credential $pscredential -Forcs;
$SSHStream = New-SSHShellStream -Index $currentSessionID.SessionId;
Invoke-SSHStreamShellCommand -ShellStream $SSHStream -Command $triggerJMeterTest;
}
Start-Sleep -Seconds 5;
removeExistingSession
}
function removeExistingSession {
$remove = Get-SSHSession
if ($null -eq $remove -or $remove -eq 0) {
Write-Host "##[section] No active past session present !!!"
}
else {
foreach ($existingSessionID in $remove.SessionId){
$removeTheSession = Remove-SSHSession -SessionId $existingSessionID
if($removeTheSession) {
continue;
}
else {
Write-Host "##[error] There is a problem with terminating the active session with ID" $removeTheSession
}
}
Write-Host "##[section] All active session terminated successfully!!!"
}
}
function startJMeterServer {
$loadAgentMachine = '<remote_machine_Name>'
$LoadAgentUserName = "<User_Name>";
$LoadAgentVMPassword = "<Password>";
remoteConnectEngine $LoadAgentUserName $LoadAgentVMPassword $vm_Machine
}
Error Details:
Invoke-SSHStreamShellCommand : Cannot process argument transformation on parameter 'ShellStream'. Cannot convert the
"Renci.SshNet.ShellStream" value of type "Renci.SshNet.ShellStream" to type "Renci.SshNet.ShellStream".
At E:\agent\_work\40\s\PerformanceEvaluation\testJMeter.ps1:81 char:73
+ ... ommand = Invoke-SSHStreamShellCommand -ShellStream $SSHStream -Comman ...
+ ~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Invoke-SSHStreamShellCommand], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Invoke-SSHStreamShellCommand
How to resolve this issue.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Windows PowerShell forum
new-netroute : Invalid parameter InterfaceAlias vEthernet (cbr0) ... Cannot convert the "Renci.SshNet.ShellStream" value of type "Renci.SshNet.ShellStream" ...
Read more >Posh-SSH.psm1 2.1
SSH Shell Stream. [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, ValueFromPipeline=$true, Position=0)] [Renci.SshNet.ShellStream]
Read more >Posh-SSH headaches : r/PowerShell
EDIT SOLVED: using the Renci.SshNet source I was able to skip over the posh-ssh piece and call the library directly achieving the goal....
Read more >Cannot process argument transformation on parameter ...
Any time I've tried to pipe the values from my .csv file into the next command, it responds with "Cannot process argument transformation...
Read more >packages - SSH.NET.2016.1.0 - lib - sl4 - Renci.SshNet.xml
Fills an array of bytes with a cryptographically strong random sequence of values. 17. </summary>.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had the same problem with Posh-SSH version 3.0.1. For me the solution was to manually delete Renci.SshNet folder from C:\Windows\Microsoft.NET\assembly\GAC_64
@bbrown2008, I think this PS command could helped in your case:
[System.AppDomain]::CurrentDomain.GetAssemblies() | ? { $_.Location -like '*GAC*Renci.SshNet*' }
It shows locations of all Renci.SshNet dlls from all GAC locations after you import Posh-SSH module.