You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[alpine Linux] - some missing standard Modules in alpine linux APK package #20143
I assumed it at least is able to install and handle modules on linux already
Actual behavior
It triggers this error:The term 'Install-Module' is not recognized as a name of a cmdlet,function, script file, or executable program. Check the spelling of thename, or if a path was included, verify that the path is correct and tryagain.
Error details
No response
Environment data
$PSVersionTable
Name Value
---------
PSVersion 7.3.6
PSEdition Core
GitCommitId 7.3.6
OS Linux 6.4.0-3-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.4.11-1 (2023-08-17)
Platform Unix
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
If you run Get-Module -ListAvailable does the PowerShellGet module show up?
Nope, so impossible to install anything with how it ships on alpine
What would if you install not in docker?
I don't have any native VM with alpine linux, but should not make any differrence, since:
When I download the apk manually from here https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/powershell-7.3.6-r0.apk and unzip with '7zip' I can see that in the folder
'powershell-7.3.6-r0\usr\lib\powershell\Modules' it is already missing the modules - so
it can not be there. There must have been some error when compiling/building the alpine apk:
So this version of the alpine installation package ships without important Modules, whether in docker or not.
if the package does not bring it, it must be missing.
Thank you in advance!
P.S.: since I am already here:
is there a way to also support this package for these architectures aswell?
Martin Hotmann (@the-hotmann) I think it might be good to edit the title of this - based on your unzip this looks like a problem with the build process for one or more linux packages - the install-module error is one of many possible symptoms, but not the actual problem, and docker is not part of the issue either :-)
changed the title [-][Linux] - The term 'Install-Module' is not recognized as a name of a cmdlet[/-][+][alpine Linux] - The term 'Install-Module' is not recognized as a name of a cmdlet[/+]on Aug 20, 2023
changed the title [-][alpine Linux] - The term 'Install-Module' is not recognized as a name of a cmdlet[/-][+][alpine Linux] - some missing standard Modules in alpine linux APK package[/+]on Aug 20, 2023
According to the official install instructions the download is on the Releases page with an alpine tar.gz file. I validated that file has the correct built-in modules. Maybe someone else published it to the alpine package manager.
According to the official install instructions the download is on the Releases page with an alpine tar.gz file. I validated that file has the correct built-in modules. Maybe someone else published it to the alpine package manager.
That is litterally what I wrote in my last post here :)
Since there is no GitHub repo or any other repo I have access to, where I could open the issue, I decided to open one here and send it to the maintainer, so he can follow up.
Antoine Martin (@ayakael) answered my email and informed me about that he will look into the issue the next days.
Martin Hotmann (@the-hotmann) Thank you for opening this issue. I am the package maintainer for powershell (and dotnet) for Alpine Linux. Indeed, I can confirm the missing modules. I'm investigating how to get them included in the package, and I can't find an obvious way of building them from source. Arch Linux addressed this by copying the prebuilt modules from the upstream PowerShell package . Ideally, we should build these from source, this is not something that is allowed on Alpine Linux as we build everything from source. The psm1 script also installs the prebuilt modules from upstream.
This does have the Modules included. I don't know who built that, but it is a tar.gz (like most .apk-files). But again just for x86_x64.
So the questions would be: who built that (maybe Travis Plunk (@TravisEz13) as mentioned above?) and is there any info out there on how to properly build it?
Let's wait and see if anyone does have an idea.
In general I think it should be in the interest of Powershell to be built and supported for as many OS and Arches as possible.
This does have the Modules included. I don't know who built that, but it is a tar.gz (like most .apk-files). But again just for x86_x64. So the questions would be: who built that (maybe Travis Plunk (@TravisEz13) as mentioned above?) and is there any info out there on how to properly build it? Let's wait and see if anyone does have an idea.
In general I think it should be in the interest of Powershell to be built and supported for as many OS and Arches as possible.
That tar is likely produced with PowerShell's own build infrastructure, likely leveraging a a prebuilt binary of pwsh that runs a psm1 script in the source. Surmising from that script, those modules aren't actually built, but rather fetched and packaged as is in the tar.gz file. While this approach is acceptable on the .NET ecosystem, it is generally not acceptable on linux ecosystems.
The powershell package available on Alpine's repo is the product of my porting the psm1 script into an APKBUILD (quite similar to a standard shell script), which Alpine's build infrastructure uses to produce an apk.
Antoine Martin (@ayakael)Martin Hotmann (@the-hotmann) - All those in that list marked as needed are already open sourced here on GitHub mostly under the PowerShell Organisation in their own Repos, other than PackageManagement which is under the Oneget repo. so should all be able to be built from their sources, if for any of those you find they can't be built from the source can you please raise an issue in their repo and link back to this issse for us please.
Sorry, but this is not 'the goal' at all. The goal is to provide a proper source-build PowerShell for alpine which provides the same OOB expirience as the official pwsh. This also is important so it can be maintained properly for all alpine architectures.
Your goals may vary, but the goal of this issue/ticket/thread is not solely PS-Gallery.
Rich Lander (@richlander) there are indeed some more things that came to my attention. Some of the repos I found are not up-to-date and therefor I think a sourcebuild would not result in building the newest versions of each package.
Maybe the problem is with me not seeing the right thing?
But I double-checked and it seems that some of the repositories of the packages are not up-to-date?
Especially Microsoft.PowerShell.Archive and PackageManagement show a clear discrepancy, also in the date of the released tags, when you compare the newest releases to each other.
Echoeing Martin Hotmann (@the-hotmann), the situation hasn't changed as it relates to my observations done last august:
* Most do not have buid-from-source instructions (only oneget and psreadline has instructions)
* When they do, it involves building with a psm1 script. We have a bootstrap problem when wanting to build these before pwsh is available.
* Releases aren't properly tagged (oneget and threadjob)
* There is a warning that releases might not be available on Github in the future (PSReadLine)
I'll open issues in the relevant repos to see what those teams can do to facilitate source-building.
Sorry, but this is not 'the goal' at all. The goal is to provide a proper source-build PowerShell for alpine which provides the same OOB expirience as the official pwsh.
Is the intent for it to be packaged as a monolithic APK containing everything, or a set of smaller APKs so you can choose to have the core runtime of PowerShell and only add the modules that you want?
I am thinking about the scenario of building an Alpine/PowerShell based Docker image where you don't need all the modules.
Sorry, but this is not 'the goal' at all. The goal is to provide a proper source-build PowerShell for alpine which provides the same OOB expirience as the official pwsh.
Is the intent for it to be packaged as a monolithic APK containing everything, or a set of smaller APKs so you can choose to have the core runtime of PowerShell and only add the modules that you want?
I am thinking about the scenario of building an Alpine/PowerShell based Docker image where you don't need all the modules.
On my end, the intent is to provide a package that matches the feature of what is provided in the upstream tar. This means that if these modules are provided by Powershell/Powershell, they should be in the Alpine package.
There are multiple goals in play here, and the use of the gallery/release package as opposed to requiring a clean build from source is the most efficient use of all the computational time, power and other resources so is the most environmentally friendly way forward for us due to reduced infrastructure & other associated costs that come with the build from source requirement, that said, we do also want to ensure that build from source is something that is not only possible, but easy to work with too, so we need to make things better here going forward,
Most do not have buid-from-source instructions
Not all software/module have or need a proper build process, so may be up with this is the source & it doesn't require to be "built" to be used, however this is something that should in future be much easier for those that do require to be built to be useable and is some tech debt that we do need to clean up on.
We have a bootstrap problem when wanting to build these before pwsh is available
This is a problem that I can't see a way forward from as we currently use a PowerShell module to help with the build process as all of the tooling that we use for building pwsh either already has the pwsh executable & other ones we rely on or can easily be bootstrapped with a pre-build step using an existing built version of those tools, which I don't see benefit in moving away from, and I don't think stops from building from source,
Sorry for the lack of work on this. I do this on my off time and I've been busy with other projects. I'm hoping to work on this in May to get it in before the next Alpine Linux release. What needs to happen till then is that the libraries need to update their GitHub repo for me to be able to pull from them. I've opened the following issues to address this:
The approach I will take is create a package for each library that will be pulled automatically when installing powershell, so that I can work on low hanging fruits first and get them in incrementally.
I wanted to share a solution that worked for me while working on building an alpine 3.20arm64 and amd64 container image with PowerShell 7.4. After encountering several challenges, I was able to successfully build the container using the following command in my Dockerfile:
And then Install-Module was working like normal.
I hope this solution helps others facing similar issues. It's been a journey figuring this out, and I'm glad to contribute back to the community with this finding. Thanks for all the above comments. It was very helpful!
I wanted to share a solution that worked for me while working on building an alpine 3.20arm64 and amd64 container image with PowerShell 7.4. After encountering several challenges, I was able to successfully build the container using the following command in my Dockerfile:
And then Install-Module was working like normal. I hope this solution helps others facing similar issues. It's been a journey figuring this out, and I'm glad to contribute back to the community with this finding. Thanks for all the above comments. It was very helpful!
I was having exactly the same issue and you managed to solve it flawlessly.
I'm just so glad I came up to find your comment. You could have just kept it to yourself. Thank you so much for sharing!
Hello all. I've pushed a change that mitigated this issue. The standard modules that are pulled by powershell's build process were copied to the Modules folder, thus they are now packaged in the Alpine Linux package starting with v7.4.6-r2 on edge and v7.4.6-r1 on 3.20. Apologies for the time it took to address this issue.
Activity
ThomasNieto commentedon Aug 20, 2023
If you run
Get-Module -ListAvailabledoes thePowerShellGetmodule show up?237dmitry commentedon Aug 20, 2023
What would if you install not in docker?
the-hotmann commentedon Aug 20, 2023
Hi and thanks for your quick answer,
Nope, so impossible to install anything with how it ships on alpine
I don't have any native VM with alpine linux, but should not make any differrence, since:
When I download the apk manually from here https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/powershell-7.3.6-r0.apk and unzip with '7zip' I can see that in the folder

'powershell-7.3.6-r0\usr\lib\powershell\Modules' it is already missing the modules - so
it can not be there. There must have been some error when compiling/building the alpine apk:
So this version of the alpine installation package ships without important Modules, whether in docker or not.
if the package does not bring it, it must be missing.
Thank you in advance!
P.S.: since I am already here:
is there a way to also support this package for these architectures aswell?
jhoneill commentedon Aug 20, 2023
Martin Hotmann (@the-hotmann) I think it might be good to edit the title of this - based on your unzip this looks like a problem with the build process for one or more linux packages - the install-module error is one of many possible symptoms, but not the actual problem, and docker is not part of the issue either :-)
[-][Linux] - The term 'Install-Module' is not recognized as a name of a cmdlet[/-][+][alpine Linux] - The term 'Install-Module' is not recognized as a name of a cmdlet[/+][-][alpine Linux] - The term 'Install-Module' is not recognized as a name of a cmdlet[/-][+][alpine Linux] - some missing standard Modules in alpine linux APK package[/+]ThomasNieto commentedon Aug 20, 2023
According to the official install instructions the download is on the Releases page with an alpine tar.gz file. I validated that file has the correct built-in modules. Maybe someone else published it to the alpine package manager.
Travis Plunk (@TravisEz13) does PowerShell release pipeline publish to alpine package manager?
the-hotmann commentedon Aug 20, 2023
That is litterally what I wrote in my last post here :)
I don't think so.
According to the alpine package site https://pkgs.alpinelinux.org/package/edge/community/x86_64/powershell the maintainer is
Antoine Martin(ayakael) which I already contacted by email to inform about that discrepancy. I linked this issue in the email.Since there is no GitHub repo or any other repo I have access to, where I could open the issue, I decided to open one here and send it to the maintainer, so he can follow up.
Antoine Martin (@ayakael) answered my email and informed me about that he will look into the issue the next days.
ayakael commentedon Aug 21, 2023
Martin Hotmann (@the-hotmann) Thank you for opening this issue. I am the package maintainer for powershell (and dotnet) for Alpine Linux. Indeed, I can confirm the missing modules. I'm investigating how to get them included in the package, and I can't find an obvious way of building them from source. Arch Linux addressed this by copying the prebuilt modules from the upstream PowerShell package . Ideally, we should build these from source, this is not something that is allowed on Alpine Linux as we build everything from source. The psm1 script also installs the prebuilt modules from upstream.
Any pointers would be appreciated.
ayakael commentedon Aug 21, 2023
I did a summary investigation of what it would entail to build these modules from source:
This doesn't bode well from a maintainer perspective, I'm afraid.
the-hotmann commentedon Aug 21, 2023
True that - just checked, the source does not have these Modules.
But when I check the release page of v7.3.6: LINK
I see that there is an alpine-package: https://github.com/PowerShell/PowerShell/releases/download/v7.3.6/powershell-7.3.6-linux-alpine-x64.tar.gz
This does have the Modules included. I don't know who built that, but it is a tar.gz (like most
.apk-files). But again just forx86_x64.So the questions would be: who built that (maybe Travis Plunk (@TravisEz13) as mentioned above?) and is there any info out there on how to properly build it?
Let's wait and see if anyone does have an idea.
In general I think it should be in the interest of Powershell to be built and supported for as many OS and Arches as possible.
ayakael commentedon Aug 21, 2023
That tar is likely produced with PowerShell's own build infrastructure, likely leveraging a a prebuilt binary of pwsh that runs a psm1 script in the source. Surmising from that script, those modules aren't actually built, but rather fetched and packaged as is in the tar.gz file. While this approach is acceptable on the .NET ecosystem, it is generally not acceptable on linux ecosystems.
The powershell package available on Alpine's repo is the product of my porting the psm1 script into an APKBUILD (quite similar to a standard shell script), which Alpine's build infrastructure uses to produce an apk.
237dmitry commentedon Aug 21, 2023
I am sorry for offtop, can be used alpine tar.gz for musl void linux?
ayakael commentedon Aug 21, 2023
I encourage you to try, and see. Normally, portable packages targetting Alpine Linux actually targets
linux-musl-x64which is also Void Linux10 remaining items
kilasuit commentedon Nov 30, 2023
Antoine Martin (@ayakael) Martin Hotmann (@the-hotmann) - All those in that list marked as needed are already open sourced here on GitHub mostly under the PowerShell Organisation in their own Repos, other than PackageManagement which is under the Oneget repo. so should all be able to be built from their sources, if for any of those you find they can't be built from the source can you please raise an issue in their repo and link back to this issse for us please.
the-hotmann commentedon Dec 3, 2023
Sorry, but this is not 'the goal' at all. The goal is to provide a proper source-build PowerShell for alpine which provides the same OOB expirience as the official pwsh. This also is important so it can be maintained properly for all alpine architectures.
Your goals may vary, but the goal of this issue/ticket/thread is not solely PS-Gallery.
Rich Lander (@richlander) thank you very much for pointing that out.
To make it a little more easy for Antoine Martin (@ayakael), here a list with the missing modules and the direct link to the repo
Microsoft.PowerShell.ArchivePackageManagementPowerShellGet(v3)PowerShellGetv2(needed?)PSReadLineThreadJobRich Lander (@richlander) there are indeed some more things that came to my attention. Some of the repos I found are not up-to-date and therefor I think a sourcebuild would not result in building the newest versions of each package.
Let me provide a list with my findings:
Microsoft.PowerShell.Archive1.1.0.0)1.2.5)PackageManagement1.4)1.4.8.1)PowerShellGet(v3)-)3.0.23-beta23)PowerShellGetv2(needed?)2.2.5.1)2.2.5)PSReadLine2.3.4)2.3.4)ThreadJob-)2.0.3)Maybe the problem is with me not seeing the right thing?
But I double-checked and it seems that some of the repositories of the packages are not up-to-date?
Especially
Microsoft.PowerShell.ArchiveandPackageManagementshow a clear discrepancy, also in the date of the released tags, when you compare the newest releases to each other.Thanks in advance :)
ayakael commentedon Dec 3, 2023
Ryan Yates (@kilasuit)
Echoeing Martin Hotmann (@the-hotmann), the situation hasn't changed as it relates to my observations done last august:
I'll open issues in the relevant repos to see what those teams can do to facilitate source-building.
rhubarb-geek-nz commentedon Dec 3, 2023
Is the intent for it to be packaged as a monolithic APK containing everything, or a set of smaller APKs so you can choose to have the core runtime of PowerShell and only add the modules that you want?
I am thinking about the scenario of building an Alpine/PowerShell based Docker image where you don't need all the modules.
ayakael commentedon Dec 4, 2023
On my end, the intent is to provide a package that matches the feature of what is provided in the upstream tar. This means that if these modules are provided by
Powershell/Powershell, they should be in the Alpine package.kilasuit commentedon Dec 6, 2023
There are multiple goals in play here, and the use of the gallery/release package as opposed to requiring a clean build from source is the most efficient use of all the computational time, power and other resources so is the most environmentally friendly way forward for us due to reduced infrastructure & other associated costs that come with the build from source requirement, that said, we do also want to ensure that build from source is something that is not only possible, but easy to work with too, so we need to make things better here going forward,
Not all software/module have or need a proper build process, so may be up with this is the source & it doesn't require to be "built" to be used, however this is something that should in future be much easier for those that do require to be built to be useable and is some tech debt that we do need to clean up on.
This is a problem that I can't see a way forward from as we currently use a PowerShell module to help with the build process as all of the tooling that we use for building pwsh either already has the pwsh executable & other ones we rely on or can easily be bootstrapped with a pre-build step using an existing built version of those tools, which I don't see benefit in moving away from, and I don't think stops from building from source,
the-hotmann commentedon Mar 11, 2024
Am I reading right, that there is some work beeing done on this?
#21316
Just curious. Or is this just another open issue for the same problem?
ayakael commentedon Apr 13, 2024
Sorry for the lack of work on this. I do this on my off time and I've been busy with other projects. I'm hoping to work on this in May to get it in before the next Alpine Linux release. What needs to happen till then is that the libraries need to update their GitHub repo for me to be able to pull from them. I've opened the following issues to address this:
ayakael commentedon Apr 13, 2024
The approach I will take is create a package for each library that will be pulled automatically when installing powershell, so that I can work on low hanging fruits first and get them in incrementally.
hpdsvg commentedon Jun 26, 2024
I wanted to share a solution that worked for me while working on building an
alpine 3.20arm64 and amd64container image withPowerShell 7.4. After encountering several challenges, I was able to successfully build the container using the following command in my Dockerfile:And then
Install-Modulewas working like normal.I hope this solution helps others facing similar issues. It's been a journey figuring this out, and I'm glad to contribute back to the community with this finding. Thanks for all the above comments. It was very helpful!
CrhistianH commentedon Aug 14, 2024
I was having exactly the same issue and you managed to solve it flawlessly.
I'm just so glad I came up to find your comment. You could have just kept it to yourself. Thank you so much for sharing!
community/powershell: add missing libraries
community/powershell: add missing libraries
ayakael commentedon Oct 25, 2024
Hello all. I've pushed a change that mitigated this issue. The standard modules that are pulled by powershell's build process were copied to the Modules folder, thus they are now packaged in the Alpine Linux package starting with v7.4.6-r2 on edge and v7.4.6-r1 on 3.20. Apologies for the time it took to address this issue.
ayakael commentedon Jan 21, 2025
This should be closed.