Skip to content

Start PowerShell Docker container with 3rd-party modules preloaded #219

@SergeySypalo

Description

@SergeySypalo

Hi guys,
I'm trying to figure out how to start a PowerShell container with 3rd-party preloaded modules.
The Dockerfile is pretty simple:

# Use an existing docker image as a base 
FROM mcr.microsoft.com/powershell:preview

# Copy Cisco UCS Power Tools
COPY  ./ucspowertoolcore/Cisco.UCS.Core ./usr/local/share/powershell/Modules/Cisco.UCS.Core
COPY  ./ucspowertoolcore/Cisco.UCSManager ./usr/local/share/powershell/Modules/Cisco.UCSManager

But when I build the container and start it using: docker run -it ucs pwsh
And inside a container run Get-Module I didn't see loaded modules.
So why it's not picking up modules from the standard location or how I can update $Env:PSModulePath variable to include custom path or maybe you have better idea to get this done?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions