Skip to content

PowerShell module for interacting with the Matrix API

Notifications You must be signed in to change notification settings

Thumbscrew/PSMatrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PSMatrix

PowerShell module for interacting with the Matrix API

Installation

  1. Clone repo:
git clone https://github.com/Thumbscrew/PSMatrix.git
  1. Import module:
cd PSMatrix
Import-Module ./PSMatrix

Getting Started

  1. Create a PSCredential object:
$creds = Get-Credential

PowerShell credential request
Enter your credentials.
User: username
Password for user username: **************
  1. 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

Releases

No releases published