Can't search the gallery for modules

:smiley:

OK I just updated to 2.9.0 and the issue is still there.

To recap, my “on startup” script has this (which made it work prior to 2.8):

# Remove classic PowerShell module path
[Environment]::SetEnvironmentVariable("PSModulePath", 'D:\local\UserProfile\Documents\PowerShell\Modules;D:\Program Files\PowerShell\Modules;D:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\;D:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\Storage\;D:\Program Files\Microsoft Message Analyzer\PowerShell;D:\home\site\wwwroot\Modules;D:\home\site\wwwroot\..\Modules;D:\home\Data\PowerShellUniversal\Repository\Modules; ', 'Process')

… but when searching for modules I get no results and this in the log:

System.Management.Automation.CommandNotFoundException: The 'Find-Module' command was found in the module 'PowerShellGet', but the module could not be loaded. For more information, run 'Import-Module PowerShellGet'.
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
   at Universal.Server.Services.ModuleDiscoveryService.FindModule(String searchText) in D:\a\universal\universal\src\Universal.Server\Services\ModuleDiscoveryService.cs:line 36