Powershell tools for Visma Wilma and optionaly also with Primus via primusquery
Collection of tools that make working with Wilma little bit easier and more secure. This module requires powershell version 7 to run. It runs nicely side by side with older one so dont be shy and just install it
- Receive, send and reply wilma messages
- Search and list messages recipients
- Download profile pictures
- Upload attachments
- Dowload wilma printouts as pdf-files
- keeps your credentials safe, no need to write them on scripts
- import and export data
- automaticly parse csv or xml formatted queryresults to powershell objects
Setup multiple sites for different wilma-sites or to use diffrent credentials.
Install module from PowerShell gallery
Install-Module WilmaPSWorker
To setup site with only wilma fuctionality use
New-WPSWSite -site MyWilma -wilma_url https://mysite.inschool.fi -wilma_apikey xxxxxxxxxxxxxx -wilma_cred (get-Credential -message "Wilma credentials")
To setup new site with wilma and primusquery access
New-WPSWSite -site MyWilma -wilma_url https://mysite.inschool.fi -wilma_apikey xxxxxxxxxxxxxx -wilma_cred (get-Credential -message "Wilma credentials") -pq_host primus.server.fi -pq_port 1222 -pq_cred (get-credential -Message "Primus credentials") -pq_exe "c:\Primusquery\primusquery.exe"
After you have setup the site, use just connect-wpswsite inside your scripts.
Connect-WPSWSite
Get-WPSWRecipient -Search "petri asikainen" | ConvertFrom-Json
PersonnelRecords
----------------
{@{Id=107; Caption=Asikainen Petri (P.A); SchoolIDs=5,2,4,6,10,11,1; AllowPersonnel=}}
Send-WPSWmessage -MessageBody "This is test message sent with powershell" -Subject "Testing again" -r_personnel 107
{"Status":"Sent"}