Closed
Description
Steps to reproduce
Using windows container
docker run -it --rm mcr.microsoft.com/powershell:lts-nanoserver-1809
or
docker run -it --rm mcr.microsoft.com/powershell:lts-nanoserver-1903
Install-Module -Name Pester -Force
or any module
Install-Module -Name NetworkingDsc -Force
Expected behavior
I expect this command to work (it works on ubuntu, alpine, windowsservercore).
I expect modules to be loaded.
Actual behavior
With Pester
PS C:\> Install-Module -Name Pester -Force
WARNING: Win32Helpers: Cannot add type. Compilation errors occurred.
WARNING: Could not find a part of the path 'C:\Users\ContainerAdministrator\AppData\Local\Microsoft\Windows\PowerShell\PowerShellGet\PSRepositories.xml'
.
Install-Package: C:\program files\powershell\Modules\PowerShellGet\PSModule.psm1:9685
Line |
9685 | … talledPackages = PackageManagement\Install-Package @PSBoundParameters
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The module 'Pester' cannot be installed or updated because the authenticode signature of the file 'Pester.psd1' is not valid.
With NetworkingDsc
PS C:\> Install-Module -Name NetworkingDsc -Force
WARNING: Win32Helpers: Cannot add type. Compilation errors occurred.
WARNING: Could not find a part of the path 'C:\Users\ContainerAdministrator\AppData\Local\Microsoft\Windows\PowerShell\PowerShellGet\PSRepositories.xml'
.
Install-Package: C:\program files\powershell\Modules\PowerShellGet\PSModule.psm1:9685
Line |
9685 | … talledPackages = PackageManagement\Install-Package @PSBoundParameters
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The module 'NetworkingDsc' cannot be installed or updated because the authenticode signature of the file 'NetworkingDsc.psd1' is not
| valid.
Environment data
docker info
Client:
Debug Mode: false
Plugins:
buildx: Build with BuildKit (Docker Inc., v0.3.1-tp-docker)
mutagen: Synchronize files with Docker Desktop (Docker Inc., testing)
app: Docker Application (Docker Inc., v0.8.0)
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 55
Server Version: 19.03.8
Storage Driver: lcow (linux) windowsfilter (windows)
LCOW:
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: ics internal l2bridge l2tunnel nat null overlay private transparent
Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 19041 (19041.1.amd64fre.vb_release.191206-1406)
Operating System: Windows 10 Pro Version 2004 (OS Build 19041.208)
OSType: windows
Architecture: x86_64
CPUs: 8
Total Memory: 15.63GiB
Name: Desktop
ID:
Docker Root Dir: C:\ProgramData\Docker
Debug Mode: true
File Descriptors: -1
Goroutines: 62
System Time: 2020-04-30T15:36:52.0489507+02:00
EventsListeners: 1
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
PS C:\> $PSVersionTable
Name Value
---- -----
PSVersion 7.0.0
PSEdition Core
GitCommitId 7.0.0
OS Microsoft Windows 10.0.18362
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
##Workaround
I can get the module installed with additionnal command
Install-Module -Name Pester -Force -SkipPublisherCheck
Import-Module ("C:\" + (Get-ChildItem -Name Pester.psm1 -Recurse -Path "C:\"))