I was trying to update my dbatools install to test something and go this error.
I fixed it with a little help.
The Fix
The short answer from Chrissy LeMaire is to run this:
install-module dbatools -Force –SkipPublisherCheck
That worked.
Why?
Chrissy explained this, but essentially it’s a certificate approval thing. Certificates work by verifying each other in a chain. One cert checks another, which checks another, etc.
In this case, Microsoft changed some things and while the dbatools goes through some of these things, the update-module is doing extra checks. Supposedly MS will fix this.
In any case, if you need an update, you need to bypass things for now.