
PnP.PowerShell是一个基于.NET 8的PowerShell模块,提供近800个cmdlet,用于Microsoft 365环境(如SharePoint Online、Microsoft Teams、Microsoft Project、安全与合规中心、Entra ID等)的管理与自动化。通过Docker容器化部署,可便捷地在隔离环境中运行PnP.PowerShell,实现Microsoft 365管理任务的自动化执行。
latest:最新稳定版镜像(与stable标签等价)bashdocker pull m365pnp/powershell # 或显式指定标签 docker pull m365pnp/powershell:latest docker pull m365pnp/powershell:stable
nightly:最新夜间构建版镜像(包含最新开发特性,稳定性未经验证)bashdocker pull m365pnp/powershell:nightly
运行一个安装了最新稳定版PnP.PowerShell模块的隔离容器,直接进入交互模式:
bashdocker run --rm -it m365pnp/powershell
说明:
--rm表示容器退出后自动删除,-it启用交互终端。
将本地目录挂载到容器中,以便访问本地文件(如脚本、配置)。
Linux容器
bash# 将当前目录(${PWD})挂载到容器的/home目录,并设置工作目录为/home docker run --rm -it -v ${PWD}:/home -w /home m365pnp/powershell
Windows容器
PowerShell# 将当前目录(${PWD})挂载到容器的c:/app目录,并设置工作目录为c:/app docker run --rm -it -v ${PWD}:c:/app -w c:/app m365pnp/powershell
直接在容器中执行本地存储的PnP.PowerShell脚本,无需进入交互模式。
Linux容器
bash# 将当前目录挂载到容器的/scripts目录,运行脚本script-to-run.ps1 docker run --rm -v ${PWD}:/scripts -w /scripts m365pnp/powershell script-to-run.ps1
Windows容器
PowerShell# 将当前目录挂载到容器的c:/scripts目录,运行脚本script-to-run.ps1 docker run --rm -v ${PWD}:c:/scripts -w c:/scripts m365pnp/powershell script-to-run.ps1
镜像标签遵循以下格式:
<version>[-nightly/-stable]-<architecture>
<version>:模块版本号(如3.1.127),省略时表示最新版。-nightly/-stable:可选,指定构建类型(nightly为夜间构建,stable为稳定版),省略时默认稳定版。<architecture>:可选,指定硬件架构,省略时自动匹配当前环境架构。| 架构标签 | 基础环境说明 | Dockerfile链接 |
|---|---|---|
| linux-amd64 | Alpine Linux 64位 | https://github.com/pnp/powershell/blob/dev/docker/linux-amd64.dockerfile |
| windows-amd64 | Windows NanoServer LTSC 2025 64位 | https://github.com/pnp/powershell/blob/dev/docker/windows-amd64.dockerfile |
| linux-arm32 | .NET SDK 9 32位(适用于Raspberry Pi 2 v1.1及更早运行32位Linux的设备) | https://github.com/pnp/powershell/blob/dev/docker/linux-arm32.dockerfile |
| linux-arm64 | Linux Debian Bullseye Slim 64位(适用于Raspberry Pi 2 v1.2及更新运行64位Linux的ARM设备) | https://github.com/pnp/powershell/blob/dev/docker/linux-arm64.dockerfile |
| 标签名称 | 说明 |
|---|---|
| nightly | 自动匹配架构的最新夜间构建版 |
| stable/latest | 自动匹配架构的最新稳定版(两者等价) |
| 3.1.127-nightly | 自动匹配架构的3.1.127版本夜间构建版 |
| 3.1.127-nightly-windows-amd64 | 强制使用Windows amd64架构的3.1.127版本夜间构建版 |
| 3.1.0-stable | 自动匹配架构的3.1.0版本稳定版 |
| 3.1.0-stable-linux-amd64 | 强制使用Linux amd64架构的3.1.0版本稳定版 |
模块版本号可通过 PowerShell Gallery 查询。
如对PnP.PowerShell模块功能或镜像构建有反馈需求,可通过 https://github.com/pnp/powershell/issues/new/choose 提交issue。
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。


探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务