Skip to content

Latest commit

 

History

History
57 lines (39 loc) · 1.22 KB

README.md

File metadata and controls

57 lines (39 loc) · 1.22 KB

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