mirror of
https://github.com/Thumbscrew/PSMatrix.git
synced 2025-07-01 02:25:24 +00:00
b0355b0beb0e51889d883f4a3c4e7a77832dbc6f
PSMatrix
PowerShell module for interacting with the Matrix API
Installation
- Clone repo:
git clone https://github.com/Thumbscrew/PSMatrix.git
- Import module:
Import-Module ./PSMatrix
Getting Started
- Create a
PSCredential
object:
$creds = Get-Credential
PowerShell credential request
Enter your credentials.
User: username
Password for user username: **************
- Get an access token from your Matrix homeserver (this will be required for subsequent authenticated requests):
# DeviceDisplayName is optional and will default to "PSMatrix"
$token = New-MatrixAccessToken -ServerUrl "https://example.matrix.com" -Credentials $creds -DeviceDisplayName "PSMatrix"
Examples
Get a list Matrix rooms you've joined
$rooms = Get-MatrixJoinedRooms -ServerUrl "https://matrix.example.com" -AccessToken $token
Get all members of a joined room
Get-MatrixJoinedMembers -ServerUrl "https://matrix.example.com" -AccessToken $token -RoomId "!ehXvUhWNASUkSLvAGP:matrix.org"
Log out of your session
Remove-MatrixAccessToken -ServerUrl "https://matrix.example.com" -AccessToken $token
Description
Languages
PowerShell
100%