

Inside Visual Studio, go to Tools -> Extensions and Updates. When using Visual Studio, we want to take advantage of code templates so that our “base” solution is created for us. I’ve spent quite a bit tinkering with this and so far, definitely so good.

In future posts, we will work out how to run platform specific code and how better to deploy our application that doesn’t involve a tonne of dependencies to be installed on the machine (For example bundling mono with your application). In this first post, we will just be working out how to do a simple test application. NET Core (Infact it definitely isn’t, it uses Mono on non Windows platforms), but because one of the main reasons to switch to Core is it’s ability to be cross platform and work on non-windows OS, I thought I would have a little play with it.

Depending on where it is run, it will use WPF, MonoMac or GTK#. It’s a GUI library that uses the native toolkit of each OS/Platform through a simple C# API. Creating something that looks good on Windows, Mac and Linux is no easy feat.Īnd that’s where Eto.Forms jumps in. This is also coupled with the fact that to create a cross platform GUI library is easier said then done. This seems rather deliberate, with Microsoft instead intending to focus on web applications instead of desktop apps. NET Core has been out for quite some time now, with no “GUI” option of building applications. TextBox1.Text += text + Environment.NewLine Īnd here is the code in c:\temp\test1.ps1: 1.Astute observers will note that.

Private void P_OutputDataReceived(object sender, DataReceivedEventArgs e) P.ErrorDataReceived += P_OutputDataReceived P.OutputDataReceived += P_OutputDataReceived WindowStyle = ProcessWindowStyle.Minimized ProcessStartInfo psi = new ProcessStartInfo() Private void button1_Click(object sender, EventArgs e) Will the user need to view the powershell window? If not this should work, because nothing will be shown in the powershell window. I built a simple windows forms app to accomplish what you're looking for and I was able to steam a powershell window to my textbox by redirecting the output. The date/time is prepended to each line, text is optionally colored, and error records parsed. Here is a sample which appends to a RichTextBox named $richHistory. I have used functions to make it easier to output to a RichTextBox. There is no way to make the output magically appear in the text box.
