PowerShell module for interacting with the Matrix API
- Clone repo:
git clone https://github.com/Thumbscrew/PSMatrix.git
- Import module:
cd PSMatrix
Import-Module ./PSMatrix
- 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"
$rooms = Get-MatrixJoinedRooms -ServerUrl "https://matrix.example.com" -AccessToken $token
Get-MatrixJoinedMembers -ServerUrl "https://matrix.example.com" -AccessToken $token -RoomId "!ehXvUhWNASUkSLvAGP:matrix.org"
Remove-MatrixAccessToken -ServerUrl "https://matrix.example.com" -AccessToken $token