Chat application console layout

Hey,

I’m sorry, I speak a little English.

I would like create a chat application with MySQL server, but now I would like know only the layout. How can I do with PowerShell?

Example:

Bob: hello
Joe: hi
Bob: How are you?
>

Top lines: messages (refresh every second this text)
Bottom 1 line: user message input

Thanks.

Hire someone who knows ?

You are giving very litlle information, for building something that looks very complex. I don’t think you are going to be able to get an answer on this one.

Toi Sas,
Welcome to the forum. :wave:t3:

You question is quite vague and you do not show any code at all.

Please keep in mind … this forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.

What have you tried so far? We expect you to make an own attempt to get your task done or to solve your problem. If you have done so already please document here what exactly you have done and show your code. Then we probably might be able to help you step further.

This is what I mean for example:

chat

The messages.txt for example:

Bob: hello
Joe: hi
Bob: How are you?

My chat.ps1 for example:

function NewMessage($msg) {
# Invoke-WebRequest POST etc.
}

$messages = Invoke-WebRequest -URI https://***.com/messages.txt
echo $messages.Content;

$YourMessage = Read-Host -Prompt '>'
NewMessage $YourMessage

I would like refresh the $messages every second. This is the top content lines and I would like 1 input at the bottom, 1 single line.

I am very beginner and I don’t know if this can be done with PowerShell and how to.

Thanks.

That’s a very very very challanging task for a beginner. And I wonder why you choose PowerShell for this task?! :wink: I’d think PowerShell is not the right tool for this task.

You would need a loop for that. But you should keep in mind that PowerShell is single threaded by default. You would need to switch between polling for new messages and listening to input from the local console.

I do not get this. :man_shrugging:t3:

This question is way to broad to be answered in a forum like this.

I’d like to encourage you to pick a smaller challenge for the start than a complex application like a chat.
Regardless of that you may split your task into smaller parts and try to solve these smaller tasks once at a time.
Then … if you get stuck again you may come back here and ask a specific question about the code you wrote and does not what you want or does not work as you might expect.