首页 > 解决方案 > 无法安装核心 powershell 模块且未输出错误

问题描述

我正在尝试更改 Windows docker 容器中的权限,以在 dockerfile 中授予管理员访问权限,以便它可以运行一些 powershell 脚本。为了做到这一点,我使用了一些在 microsoft.powershell.localaccounts 核心模块中找到的命令,我发现这些命令可以在基本映像中工作,该基本映像安装了该模块的 powershell 版本,但遗憾的是基本映像我'm current using 没有它,出于尺寸原因我需要使用此版本。

我已经尝试通过powershell在windows docker容器中运行这条线,但是虽然它似乎运行正常,打印出来没有问题,但它仍然没有安装。

Find-Module -Name microsoft.powershell.localaccounts | Install-Module -SkipPublisherCheck

标签: dockerpowershelldockerfilewindows-container

解决方案


推荐阅读