Skip to content

Consider install PowerShell as a tool #7078

Open

Description

@richlander

I wanted to do some testing with PowerShell in docker. The natural choice is to use the .NET SDK container image. But I ccan't because PowerShell is installed in a bespoke way.

root@88f149c70769:/# dotnet tool list -g
Package Id      Version      Commands
-------------------------------------
root@88f149c70769:/# dotnet tool install -g powershell
Tools directory '/root/.dotnet/tools' is not currently on the PATH environment variable.
If you are using bash, you can add it to your profile by running the following command:

cat << \EOF >> ~/.bash_profile
# Add .NET Core SDK tools
export PATH="$PATH:/root/.dotnet/tools"
EOF

You can add it to the current session by running the following command:

export PATH="$PATH:/root/.dotnet/tools"

You can invoke the tool using the following command: pwsh
Tool 'powershell' (version '7.5.4') was successfully installed.
root@88f149c70769:/# export PATH="$PATH:/root/.dotnet/tools"
root@88f149c70769:/# which pwsh
/usr/bin/pwsh

I wanted to use the GA version, but that's not convenient. If PowerShell was installed as a tool, I could.

Activity

  1. richlander commented on Mar 11, 2026

    @richlander
    MemberAuthor
  2. lbussell commented on Mar 11, 2026

    @lbussell
    Member

    One consideration here is that I don't see any pre-release PowerShell versions available on NuGet.org: https://www.nuget.org/packages/PowerShell#versions-body-tab

  3. richlander commented on Mar 11, 2026

    @richlander
    MemberAuthor

    That may also be telling.

  4. self-assigned this
    on Mar 16, 2026
  5. added
    area-dockerfilesConcerns the official .NET Dockerfiles or Dockerfile templates
    and removed on Mar 16, 2026
  6. added theissue type on Mar 16, 2026
  7. moved this from Backlog to Current Release in .NET Dockeron Mar 16, 2026
  8. lbussell commented on Mar 16, 2026

    @lbussell
    Member

    [Triage] I'll investigate this and see if it's feasible/compatible with the current way we ship PowerShell in our images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-dockerfilesConcerns the official .NET Dockerfiles or Dockerfile templates

Projects

  • Status
    Current Release

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions