This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
The .NET team publishes Docker images with PowerShell preinstalled. This article shows you how toget started using PowerShell in the Docker container.
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.
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.
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).
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.
Was this page helpful?
Was this page helpful?