VMware Modern Apps Community
vmcomkevin
Contributor
Contributor

PowerShell core on Photon OS

I installed Powershell core on a photon 2.0 by >tdnf install powershell    However, I could not use the Install-Module to install stuff from the Powershell gallery. Looks PowershellGet and PackageManagement modules are not installed. Any info about why those are not available?

PS /root> $psversiontable

Name                           Value

----                           -----

PSVersion                      6.0.1

PSEdition                      Core

Reply
0 Kudos
3 Replies
gowatana
Leadership
Leadership

Reply
0 Kudos
DCasota
Expert
Expert

Powershell Core on Photon OS does not built-in register PSGallery. Hence cmdlets install-module, find-module, etc. are not working.

Edited:

Put some work on this. You may use one of the attached files.

As alternative, simply pull and run:

  • docker pull vmware/powerclicore:ubuntu16.04
  • docker run -it vmware/powerclicore:ubuntu16.04
Reply
0 Kudos
DCasota
Expert
Expert

tdnf install powershell installs powershell LTS version 7.0. Simply use install-module to install modules supported on Linux.

Sorry, Photon 2.0 does not include Pwsh7. Try this .photonos-scripts/Pwsh7.0.3OnPhotonOS.sh at master · dcasota/photonos-scripts · GitHub

Reply
0 Kudos