Hello Adri,
I just got the same problem and found a workaround that will probably work for you too:
- Go to the runtime environment you are using
- Delete the PnP.PowerShell module that is giving you the issue (3.1 I assume) and hit save
- Go to the PowerShell Gallery to the page of the latest working module version (in your case 2.12): https://www.powershellgallery.com/packages/PnP.PowerShell/2.12.0
- In install options you can choose to manually download this version
- Go to your download location and rename the .nupkg file to "PnP.PowerShell.zip"
- Go back to your runtime environment and choose "+ Add a file"
- Choose your zip, hit save and wait a few minutes for the status to change from "Importing" to "Available"
After this you can Import the module using Import-module PnP.PowerShell in your runbook and not get any error messages about a version mismatch.
Hope this is still helpful to you or others...