mirror of
https://github.com/Thumbscrew/PSMatrix.git
synced 2025-04-12 02:03:39 +00:00
1.2 KiB
1.2 KiB
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