I have an Ubuntu installation running PowerShell Core 7.4.1
What are the pre-requisites for install modules from the PowerShell Gallery.
For example when the following commands are run I get the following errors
PS /home/nats_user/ps7_scripts> Get-PSRepository
WARNING: Unable to find module repositories.
PS /home/nats_user/ps7_scripts> Find-Package
WARNING: Query Url https://api.nuget.org/v3/index.json is invalid.
Or this
PS /home/nats_user/ps7_scripts> Install-Module -Name Intersight.PowerShell -RequiredVersion 1.0.11.13515
Install-Package: No match was found for the specified search criteria and module name āIntersight.PowerShellā. Try Get-PSRepository to see all available registered module repositories.
I can find plenty of documentation on how to install Powershell Core on a Linux Distro but unable to find any on how to configure it, it all seems Windows orientated.
Thatās why I am here. Asking for help to get Powershell Core working on an Ubuntu (Linux) system. PowerShell itself appears to be working, but no good if I canāt get additional module installed and working. As said there is very limited documentation around Ubuntu.
I agree with Doug that this looks like a connectivity problem. If thereās no Internet connection available Register-PSRepository -Default will fail.
Can you browse the Internet on this machine?
Are you on a corporate network that has a firewall or proxy that might restrict Internet access?
What version of Ubuntu are you running?
Powershell is indeed working. Cmdlets that REQUIRE connectivity will not work if the connectivity is not working. Try the wget command from Tony as a first step to validate the ubuntu system has connectivity. Go from there.
Within Python when using pip to get packages you have to specify the --proxy variable. Is a similar thing required for Powershell 7? Are they extra steps required to be able to run āRegister-PSRepositoryā command because its behind a Proxy?These I think are the additional steps that I am missing.