Recently, I installed
Powershell 7 and was using it for a while. After settings my code security to AllSigned, I got the following error.
File C:\program files\powershell\7\Modules\PSReadLine\PSReadLine.format.ps1xml is published by CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US and is not trusted on your system. Only run scripts from trusted publishers.
This is a little bit annoying because the module is signed so it should work. Powershell shows the following error message.
Trust the Publisher
To trust the publisher, the certificate must be added to users or machines certificate store in “Trusted Publishers”. But hot to get the certificate?
The certificate can be found in
C:\program files\powershell\7\Modules\PSReadLine\PSReadLine.cat. With opening the file, select
View Signature and click
View Certificate. This dialogue provides the option
Install Certificate to the “Trusted Publishers”.
After adding the certificate, Powershell loads the module without any questions.