Skip to content

how to use Powershell in runtime:6.0 #3930

Answered by mthalman
shengzhizhou asked this question in Q&A
Discussion options

You must be logged in to vote

You can grab it out of the sdk image like this:

Linux

FROM mcr.microsoft.com/dotnet/runtime:6.0

COPY --from=mcr.microsoft.com/dotnet/sdk:6.0 /usr/share/powershell /usr/share/powershell
RUN ln -s /usr/share/powershell/pwsh /usr/bin/pwsh

Windows

FROM mcr.microsoft.com/dotnet/runtime:6.0

COPY --from=mcr.microsoft.com/dotnet/sdk:6.0 [ "/Program Files/powershell", "/Program Files/powershell" ]
COPY --from=mcr.microsoft.com/dotnet/sdk:6.0 [ "/Program Files/dotnet/shared/Microsoft.WindowsDesktop.App", "/Program Files/dotnet/shared/Microsoft.WindowsDesktop.App" ]

# In order to set system PATH, ContainerAdministrator must be used
USER ContainerAdministrator
RUN setx /M PATH "%PATH%;C:\Program F…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@mthalman
Comment options

@rcdailey
Comment options

@mthalman
Comment options

Answer selected by shengzhizhou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants