https://github.com/hexonthebeach/posh-mod-websocket
PowerShell module for using a WebSocket service
https://github.com/hexonthebeach/posh-mod-websocket
powershell websockets
Last synced: 15 days ago
JSON representation
PowerShell module for using a WebSocket service
- Host: GitHub
- URL: https://github.com/hexonthebeach/posh-mod-websocket
- Owner: hexonthebeach
- Created: 2018-05-22T20:16:20.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-07T22:02:25.000Z (about 8 years ago)
- Last Synced: 2025-02-26T01:27:37.368Z (over 1 year ago)
- Topics: powershell, websockets
- Language: PowerShell
- Size: 3.91 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# POSH-MOD-WEBSOCKET
PowerShell module for using a WebSocket service
## Description
Make interaction with a Websocket service easy by abstracting away all the hassle, hiding that behind nice functions.
## Installation
Clone the project to a directory that can be read by your script.
``Import-Module "path\to\module.psm1"``
## How
The module contains the bare essentials for setting up a websocket connection, you will need to apply any kind of logic around the functions yourself.
These Functions are available when you imported the module :
``Connect-Websocket`` -Endpoint
``Test-Websocket``
``Disconnect-Websocket``
``Send-Message`` -Message
``Receive-Message``
In the examples folder I added a script connecting to a public websocket service.
Here is how it basicly fits together :
```
Connect-Websocket -Endpoint "wss://any.websocket.service"
Send-Message -Message '{"subscription_or":"authentication_message"}'
while( Test-Websocket ){
Receive-Message
}
Disconnect-Websocket
```
### Thanks
wragg.io