PowerShell/PowerShellGet

Instruction to install PowerShellGet without Install-Module

leonyu opened this issue · 4 comments

Summary of the new feature / enhancement

Alpine Linux now has a powershell package but it does not come with Install-Module, so there is no way to install PowerShellGet using existing instructions.

Could we document instructions on how to install PowerShellGet without a prior installation?

Proposed technical implementation details (optional)

E.g.

  • Identify library path of PowerShell installation
  • Drop binary/source file in library path

What you are suggesting would ultimately mean that every package maintainer who makes modules for powershell would have to provide bespoke instructions for alpine linux. It would be much more efficient if the maintainer for powershell under alpine would just provide those instructions, or implement install-module themselves.

It seems this is also mentioned in Powershell's GitHub issues, so it's probably best to keep track of the issue there.

Though, to answer where you could install the modules, you could put them in ~/.local/share/powershell/Modules according to some sources online.

Let me know how that goes for you anyways. I'll spin up an alpine VM in a few and have a look into the problem.

leonyu commented

Instructions for installing Package Managers for a program language runtime is extremely common:

Package Manager should figure figure out which path it takes:

  • If it expects itself to be bundled with the language runtime, it should be available in all major distribution channels language runtime is available.
  • If it expects itself to not be bundled with the language runtime, it should have curl-esque instructions on how to install itself on a bare language runtime.

The instructions are in readme.md already.
Your issue is due to a bug with the version of powershell distributed on alpine, which is documented in the link in my previous comment.

The manual instructions are:

Get PowerShellGet Source

Steps

git clone https://github.com/PowerShell/PowerShellGet
  • Navigate to the source directory
cd path/to/PowerShellGet
  • Import the module
Import-Module src/PowerShellGet -Force

If import-module is also missing on your distro, this needs to be brought up with the maintainer of powershell for your distro, not here.
Those commands are supposed to be usable by default, as stated in the issue I linked earlier.

leonyu commented

The problem is due to lack of Import-Module.

If import-module is also missing on your distro, this needs to be brought up with the maintainer of powershell for your distro, not here.

Love your open source passion. However, I am going to draw the line here -- I am simply a user here to report a compatibility issue between 2 major pieces of open source software. It is not user's job to facilitate communications between software projects (e.g. distributor should bundle this, distributor could avoid that, distributor should run this test suite).

In similar vein, if Photoshop has compatibility issues with Windows, do you expect a hobbyist designer to travel between Redmond and San Jose facilitate communication between Microsoft and Adobe?