Consider install PowerShell as a tool
- Dominant language
- Dockerfile
- Stars
- 4.9k
- Forks
- 2k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 26
Description
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.
```bash
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.
Contributor guide
Assessment
This issue has not been assessed yet.