Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit focus mode

Use PowerShell in Docker

  • 2025-03-26
Feedback

In this article

The .NET team publishes Docker images with PowerShell preinstalled. This article shows you how toget started using PowerShell in the Docker container.

Find available images

These images require Docker 17.05 or newer. Also, you must be able to run Docker withoutsudo orlocal administrative rights. For install instructions, see Docker's officialdocumentation.

The .NET team publishes several Docker images designed for different development scenarios. Only theimage for the .NET SDK contains PowerShell. For more information, seeOfficial .NET Docker images.

Use PowerShell in a container

The following command downloads the image containing the latest available stable versions of the.NET SDK and PowerShell.

docker pull mcr.microsoft.com/dotnet/sdk:9.0

Use the following command to start an interactive PowerShell session in the container.

docker run -it mcr.microsoft.com/dotnet/sdk:9.0 pwsh

To download and run the latest Long Term Support (LTS) version of PowerShell, change the image nametomcr.microsoft.com/dotnet/sdk:8.0. When you use these image tags, Docker downloads theappropriate image for your host operating system. If you want an image for a specific operatingsystem, you can specify the operating system in the image tag. See theMicrosoft Artifact Registry for a list of available tags.

Support lifecycle

The.NET support policy defines how these images are supported. These images are provided fordevelopment and testing purposes only. If you need a production-ready image, you should build yourown images. For more information about these Docker images, visit thedotnet-docker repositoryon GitHub.

The images previously published by the PowerShell team will be marked as deprecated in the MicrosoftContainer Registry (MCR).

Telemetry

By default, PowerShell collects limited telemetry without personal data to help aid development offuture versions of PowerShell. To opt-out of sending telemetry, create an environment variablecalledPOWERSHELL_TELEMETRY_OPTOUT set to a value of1 before starting PowerShell from theinstalled location. The telemetry we collect falls under theMicrosoft Privacy Statement.

Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, seeour contributor guide.

Feedback

Was this page helpful?

YesNo

In this article

Was this page helpful?

YesNo