I am working on a utility that builds a PowerShell PS1 file. I have my VB.Net application launching that PS1 file as follows:
Clicking my button is successfully launching my PowerShell process, but at the end of the script the process terminates and I can't read the screen input. Can anyone tell me a means to prevent the process from terminating?
I hope that helps.
Regards,
Mark
Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
Code:
Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click
Dim TempPath As String
TempPath = My.Computer.FileSystem.SpecialDirectories.Temp
Dim FILE_NAME As String = TempPath & "\InstallPreReqs.ps1"
OpenPowerShell(FILE_NAME)
End Sub
Private Sub OpenPowerShell(ByVal f As String)
Dim startInfo As New ProcessStartInfo
startInfo.FileName = "PowerShell.EXE"
startInfo.Arguments = f
Process.Start(startInfo)
End Sub
Clicking my button is successfully launching my PowerShell process, but at the end of the script the process terminates and I can't read the screen input. Can anyone tell me a means to prevent the process from terminating?
I hope that helps.
Regards,
Mark
Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.