|
|
|
|
@ -33,7 +33,7 @@ Public Class PuTTY
|
|
|
|
|
''' https://stackoverflow.com/questions/57778301/hyper-v-powershell-run-a-bash-command-in-linux-vm-and-get-output
|
|
|
|
|
''' </remarks>
|
|
|
|
|
Public Function Run(bash As String) As String
|
|
|
|
|
Dim cli As String = $"{endpoint} -P {port} -l {user} -pw ""{password}"" -batch bash ""{bash}"""
|
|
|
|
|
Dim cli As String = $"{endpoint} -P {port} -l {user} -pw ""{password}"" -batch /bin/bash ""{bash}"""
|
|
|
|
|
Dim std_out As String = CommandLine.Call(plink, cli)
|
|
|
|
|
|
|
|
|
|
Return std_out
|
|
|
|
|
@ -41,7 +41,7 @@ Public Class PuTTY
|
|
|
|
|
|
|
|
|
|
Public Function Shell(command As String, Optional arguments As String = Nothing) As String
|
|
|
|
|
Dim cmdl As String = If(arguments.StringEmpty, command, $"{command} {arguments}")
|
|
|
|
|
Dim cli As String = $"{user}@{endpoint} -P {port} -pw ""{password}"" bash -c ""{cmdl}"""
|
|
|
|
|
Dim cli As String = $"{user}@{endpoint} -P {port} -pw ""{password}"" -batch {cmdl}"
|
|
|
|
|
Dim std_out As String = CommandLine.Call(plink, cli)
|
|
|
|
|
|
|
|
|
|
Return std_out
|
|
|
|
|
|