PowerShell 7 PSGallery is missing and NuGet install fails

PowerShell 7 PSGallery is missing and NuGet install fails

Hi All,

I’ve recently had this Problem in PowerShell 7 on two diffrent Computers. It seems that PSRepository is not set and even the PackageProviders List is empty.

PowerShellGet is Version 1.1.0.0

Get-PackageProvider -ListAvailable
Get-PSRepository
Get-Module PowershellGet

I can find some newer PowerShellGet Versions in PowerShell 5 Directories

Get-Module PowershellGet -ListAvailable

When trying to install PowerShellGallery in the PSRepository it fails, because there is an Error installing NuGet.

Register-PSRepository -Default

I’ve downloaded the *.nupkg File from the PoweShell Gallery

Changed the Extentsion from *.nupkg to *.zip and copied the Files in including the “en-US” Folder

To %userprofile%\Documents\PowerShell\Modules\PowerShellGet\2.2.5

After a restart of PowerShell 7 and accepting to Run the updated PowerShellGet Modules the PowerShell Repository of PSGallery is back

Get-PSRepository

Even the List of PackageProvider is filled again

Get-PackageProvider -ListAvailable

Now i am able to find Modules in the PowerShell Gallery again

#PowerShellGet
Find-Module ExchangeOnlineManagement

#Microsoft.PowerShell.PSResourceGet
Find-PSResource ExchangeOnlineManagement

Regards
Andres Bohren

PowerShell Logo