shared drive mount test success

master
xieguigang 7 years ago
parent 32c9b0058b
commit d1e3a4bd8e

@ -86,6 +86,12 @@ Public Module Commands
ReadOnly powershell As New PowerShell
Public Iterator Function CommandHistory() As IEnumerable(Of String)
For Each line As String In powershell.logs
Yield line
Next
End Function
''' <summary>
''' Search the Docker Hub for images
''' </summary>
@ -141,7 +147,7 @@ Public Module Commands
Dim options As New StringBuilder
If Not mount Is Nothing Then
Call options.AppendLine(mount.ToString)
Call options.AppendLine($"-v {mount}")
End If
Return powershell($"docker run {options} {container} {command}")

@ -66,6 +66,6 @@ Public Class Mount
''' </summary>
''' <returns></returns>
Public Overrides Function ToString() As String
Return $"{local}:{virtual}"
Return $"{local.GetDirectoryFullPath}:{virtual}"
End Function
End Class

@ -9,6 +9,8 @@ Imports System.Text
''' </summary>
Public Class PowerShell
Friend ReadOnly logs As New List(Of String)
''' <summary>
'''
''' </summary>
@ -40,6 +42,8 @@ Public Class PowerShell
out.AppendLine(obj.ToString())
Next
Call logs.Add(scriptText)
' return the results of the script that has
' now been converted to text
Return out.ToString()

@ -14,6 +14,11 @@ Module Module1
Call Console.WriteLine(Docker.Run("centos", "echo ""hello world"""))
Call Console.WriteLine(Docker.Run("centos", "ls -l /mnt/ntfs", New Docker.Mount With {.local = "D:\test", .virtual = "/mnt/ntfs"}))
For Each line In Docker.CommandHistory
Call Console.WriteLine(line)
Next
Pause()
End Sub

Loading…
Cancel
Save