Digitally sign all Powershell module files, instead of only 1

Implemented

Digitally sign all Powershell module files, instead of only 1

0 vote

avatar

The Devolutions RDM PowerShell module consists of 2 files, a .psd1 and a .psm1 file.
The .PSD1 is signed, the .PSM1 is not.

PS C:\> dir 'C:\Program Files\WindowsPowerShell\Modules\RemoteDesktopManager.PowerShellModule' -File | Get-AuthenticodeSignature

    Directory: C:\Program Files\WindowsPowerShell\Modules\RemoteDesktopManager.PowerShellModule

SignerCertificate                        Status    Path
-----------------                        ------    ----
3BBFFCB2B1A12C426238D689993B8EACC55F5462 Valid     RemoteDesktopManager.PowerShellModule.psd1
                                         NotSigned RemoteDesktopManager.PowerShellModule.psm1


When running in 'AllSigned' PowerShell Executionpolicy we get the error that 1 of the files is not signed. (the .psm1 of course)
We solve it for now by signing the .psm1 ourselves, but would be nice if you can do that as well, just like the .psd1.
Please sign both of them.
(all versions, tested up to 2020.1.20.0)

Error below.

Regards, Ben

PS C:\> Import-Module RemoteDesktopManager.PowerShellModule
Import-Module : File C:\Program Files\WindowsPowerShell\Modules\RemoteDesktopManager.PowerShellModule\RemoteDesktopMana
ger.PowerShellModule.psm1 cannot be loaded. The file C:\Program Files\WindowsPowerShell\Modules\RemoteDesktopManager.Po
werShellModule\RemoteDesktopManager.PowerShellModule.psm1 is not digitally signed. You cannot run this script on the cu
rrent system. For more information about running scripts and setting execution policy, see about_Execution_Policies at
http://go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ Import-Module RemoteDesktopManager.PowerShellModule
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [Import-Module], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand
P

All Comments (2)

avatar

Hello,
Indeed this should be signed. I will take care of this. Thank you very much

Regards

David Hervieux

avatar

Hi David, today I test-downloaded the beta version 2020.2.11.0 and all seem to be signed fine, THANKS !
you can close this thread.

PS C:\> dir "C:\Program Files\WindowsPowerShell\Modules\RemoteDesktopManager.PowerShellModule" | Get-AuthenticodeSignature

    Directory: C:\Program Files\WindowsPowerShell\Modules\RemoteDesktopManager.PowerShellModule

SignerCertificate                        Status Path
-----------------                        ------ ----
C5C8CF8C78F380CD683B907BDE3F2F7BAB344DC0 Valid  RemoteDesktopManager.PowerShellModule.psd1
C5C8CF8C78F380CD683B907BDE3F2F7BAB344DC0 Valid  RemoteDesktopManager.PowerShellModule.psm1


Regards, Ben van Zanten