8,330 questions
Can't you just add it to the command?
$triggerJMeterTest = "bash ./startJMeterTest.sh $var1 $var2";
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want to pass a list of variables to a shell script from powershell which is triggering using Invoke-SSHStreamShellCommand
.
function remoteConnectEngine($secUsername, $VmPassword, $remoteMachine) {
$password = ConvertTo-SecureString $VmPassword -AsPlainText -Force;
$pscredential = New-Object -TypeName System.Management.Automation.PSCredential("$secUsername", $password);
$triggerJMeterTest = "bash ./startJMeterTest.sh";
$currentSessionID = New-SSHSession -ComputerName $rm -Credential $pscredential;
$SSHStream = New-SSHShellStream -Index $currentSessionID.SessionId;
Invoke-SSHStreamShellCommand -ShellStream $SSHStream -Command $triggerJMeterTest;
}
remoteConnectEngine
Want to pass few arguments to the shellscript triggerJMeterTest
Can't you just add it to the command?
$triggerJMeterTest = "bash ./startJMeterTest.sh $var1 $var2";