Simple PowerShell Chat make basic GUI

Hi there

Using the code from Simple PowerShell Chat

How could i make a basic gui. Rather then using grid view for chat. I'd like to make a scrolling window for chats with small single or double text box under to entry new messages.

I'd looked at using PoshGUI to create a basic gui. However i don't understand the code enough. I believe the line $process = Start-Process -FilePath powershell -ArgumentList "-noprofile -windowstyle hidden -command Get-COntent -Path '$Path' $Option -Wait | Out-GridView -Title 'Chat: [$ChatChannelName]'" -PassThru opens a new window for gridview and this renders my poshgui form useless as it then doesn't even load.

Otherwise its there some way i can set Gridview to auto scroll and make lock powershell window and gridview together ?

Many thanks

No Data
  • This is really not a PowerShell (help me fix my code) specific question. It's how to I create an app. The approach of creating a GUI, is the same regardless of the language you'd use.

    1 - Draw out graphically what you what your app to look like and flow.

    2 - Outline in Psuedo code what the app should do.

    3 - Find sample apps / UI actions that are close to what you are after

    PoshGUI is an online GUI designer, and decent at what it is for, but it does not replace learning how to write GUI's. You don't explicitly need it to build GUI's but it does make getting the baseline effort easier as does any GUI designer, like MS Visual Studio or Sapien's PowerShell Studio.

    You have to spend the time learning how to write GUI's using Windows Forms and or Windows presentation foundation. Whether you'd use PowerShell as the code behind the form to do things or any other language, is a different matter.

    The code line you show has nothing to do with what you are after nor anything to do with starting your form. All that is starting powershell.exe and is doing getting content and using the built-in Out-Gridview cmdlet, to show a PowerShell default form, which has nothing to do with the form you'd build in PoshGui or another form designer.

    Jump on Youtube, and search for Windows Forms GUI design or Windows Presentation Foundation GUI. Watch and practice what you find.

    Once you do that, then using PoshGUI, and doing forms with PowerShell will make more sense.

    PowerShell ISE 'Windows Forms GUI '

    VSCode ''PowerShell Windows Forms GUI '

No Data