Highlighted
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

0 Kudos
3 Replies
Highlighted
User Moderator
User Moderator

0 Kudos
Highlighted
Hot Shot
Hot Shot

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
0 Kudos
Highlighted
Hot Shot
Hot Shot

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

0 Kudos