-
Notifications
You must be signed in to change notification settings - Fork 706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PowerShell on Photon does not include PowerShellGet or PackageManagement #815
Comments
Any news on this ? |
Hello? Powershell on Photon is 100% BROKEN......does anyone at Vmware care? |
The powershell gallery repository connectivity issue is with PowerShellGet relying on nuget.exe. Nuget is a winx86-only executable. Install and use nuget packages using Mono with some limitations may path a way. The installation of Mono on Photon isn't straightforward. This is what I've found so far: wget https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-preview.3/powershell-7.0.0-preview.3-linux-x64.tar.gz get-psrepository shows now the PSGallery registered. |
That's absolutely not true @dcasota I have pwsh successfully installed and updated to 6.22 INCLUDING full packagemanagement and psget working per the proper PhotonOS install/build - there is simply nobody at VMware apparently updating this OS at any reasonable interval for many of these critical packages. Shown below. All module install/updating/searching etc. works without issue:
EDIT: I will hopefully get around to posting the proper pwsh install/upgrade script (and a few other things including the proper way to upgrade tmux on PhotonOS using a proper local repo). I'll post here when I do. EDIT 2: Other then loaded modules, here is a list of modules pre-installed by pwsh 6.x when properly installed: |
UPDATE: I have gone ahead and released my PWSH install/update script here that replicates the PROPER default PhotonOS repo outdated Powershell install: https://github.com/CollinChaffin/Install-PowerShell-on-PhotonOS If you read the README it will give you some background detailing exactly why it is NOT the same as the several INCORRECT few-line download+unzip that folks are using that leaves them with a totally botched PWSH instance, and constantly wondering why they are having issues. |
On a Msft Windows OS the stack WMF + Packagemanagement + Powershellget + Powershell took quite some learning curve. Update-module threw some weired info about assemblies, sometimes powershellget was not installed, nuget provider issues, running Powershell 2.0 and above was always something less than absolutely. Import-module alternative installation helpers choco and nuget were used at that time a lot. I think PowerCLI on Photon OS is an interesting use case. To give a try to another way as in the past I'm tinkering around with the mono project. So I came along this thread. A full blown mono project installation simply to use Powershell release is overkill. Didn't take too much time yet on that. Just was happy it worked. Personally I haven't tried the alternative to get baken releases-namespace-robust docker containers. The quick'n'dirty thread entry may has left more questions. I have these as well! Here are some findings https://github.com/dcasota/photonosonazure. I use Photon OS on Azure. Collin, I'll post an update on running your script on Photon OS 3.0 GA on Azure (September 2019). No other Photon OS release tested so far. |
The Install-PowerShell-on-PhotonOS script does not solve this "WARNING: Unable to find module repositories.". The output is: The other way round - using register-psrepository - throws the error already mentioned in other threads:
The powershell symbolink link worked. The VSCode pic, yes, fine. As said, a full blown install costs 4gb used and not the <1gb used. |
PowerShell Gallery in Photon OS 2.0 PHOTON_BUILD_NUMBER=0922243 with the workaround Mono full installation works as well as the tests in Photon OS 3.0 GA. No need using Docker Container for PowerCLI. #930 it would be nice to use a tdnf'ied small footprint of mono+nuget.exe. |
@dcasota not sure how you got that working? |
It does not. The line is strikethrough now. |
Just spottet there is a tdnf package powershell.x86_64 6.1.1-1.ph3, and |
Really? Then please explain why I should be using Photon in the first place? This whole story around PowerShell on Photon is becoming ridiculous. |
Simply get the powershellgallery functionality back with the latest PowerCLI release, this works for me
There are a few other solutions to fixed get the bundle PhotonOS&PowerCLI baken - yes Mono is more study work.
You could say the bundle PowerCLI&pwsh 6.0.5 that's good enough. It's not. According to the Powershell releases end-of-life dates 6.0.x is no longer supported since 02/13/2019, 6.1 is no longer supported since 09/28/2019. my2cents |
Not too sure what you are trying to say here @dcasota ? Since I don't use PowerShell only for PowerCLI, an unsupported solution is not acceptable for me. While it would have been nice to incorporate Photon as a platform in my CI/CD pipeline, the current situation drives me (and probably others) towards Ubuntu and the likes. I get more and more the impression that Photon, and the packages made available for it, are a rather unimportant side-project. If the manpower is not available to create and update packages in a timely fashion, perhaps the process should be open and better documented. |
With respect to the original issue Powershell on Photon, an updated Implicit PSGallery connectivity never did / does not work on every Powershell-on-OS combination. Hence, using the latest PowerCLICore dockerfile, as @BlueArcherX mentioned it, it "just adds an unnecessary layer." as the docker container size 'overhead' origins from the use of another distro. It is more a question on how to get it baken. And not to be forgotten, with a trusted PSGallery less tested PSGallery modules become installable too. Not every PSGallery published module works on a linux distro. The powershell source as example has built-in cmdlets shared, for Windows-only, and for Linux-only. A supported Powershell-on-OS combination for Photon OS - and without the use of a docker container - could be @BlueArcherX I've tried to assemble the findings so far. Concerning repos, Repository Management may path another future, see here . |
I think this is the answer. They do what they need in order to make it a reasonable platform for VMware products, but not so much as a usable platform for the community. A shame since there is a lot of potential here. Also, I just noticed there hasn't even been a release since March. |
@lucdekens please see https://vmware.github.io/photon/assets/files/html/3.0/photon_installation/build-package-kernel-using-script.html on how to build a package (in this case SPECS/powershell.spec) |
Thanks, although I'm not a developer, I'll give it a shot ;-) |
- fix issues: - #891 - #889 - #850 - #815 - #752 Change-Id: I28c8440f67be3816473e34b22fa6067b49deba60 Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/8582 Tested-by: gerrit-photon <photon-checkins@vmware.com> Reviewed-by: Tapas Kundu <tkundu@vmware.com> Reviewed-by: Shreyas Ranjan Behera <shreyasb@vmware.com> Reviewed-by: Anish Swaminathan <anishs@vmware.com>
6.2.3 update fixes this. includes PSReadLine, PowerShellGet and PackageManagement |
THANK YOU @ppadmavilasom |
Cannot use PowerShell Gallery to install any modules (including PowerCLI 10.x) in Photon OS 2.0, because the PowerShell 6.0.1 installed from the VMware repo (tdnf install -y powershell) does not seem to include the required PackageManagement or PowerShellGet modules. (get-module -ListAvailable -Name <PackageManagement/PowerShellGet>)
This seems like a pretty steep barrier to just to run PowerCLI in Photon, and the only references seem to suggest using the Docker Container for PowerCLI which just adds an unnecessary layer.
The text was updated successfully, but these errors were encountered: