为什么 Get-ContainerNetwork 在我的 Windows 10 机器上没有被识别为 cmdlet 的名称?

为什么 Get-ContainerNetwork 在我的 Windows 10 机器上没有被识别为 cmdlet 的名称?

我是 docker 新手,正在尝试让我的 sql 服务器映像在可预测的 IP 地址下运行。

这个 powershell 命令仅适用于 Windows Server 吗?

附言>Get-ContainerNetwork

当我尝试运行它时,我只收到经典的 PowerShell 错误:

Get-ContainerNetwork : The term 'Get-ContainerNetwork' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Get-ContainerNetwork
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-ContainerNetwork:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

答案1

似乎您正在尝试运行已弃用的 Docker PowerShell:

此模块已弃用 - 请注意,由于使用率低,此模块不再被积极维护。建议使用 Docker cli (docker.exe) 或直接尝试 Docker.DotNet。

https://github.com/Microsoft/Docker-PowerShell

相关内容