Reset all settings and start from clean slate?

Copper Contributor

Somehow I have managed to get myself into trouble by registering repositories.

Now when trying to install some simple modules i get the following error:

PS C:\Windows\system32> Install-Module -Name VMware.PowerCLI 
PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'VMware.PowerCLI'. Try Get-PSRepository to see all available registered module
repositories.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
+ ... $null = PackageManagement\Install-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

 

And when running Get-PSRepository I get:

PS C:\Windows\system32> Get-PSRepository
WARNING: Unable to find module repositories.

PS C:\Windows\system32>

 

I am running all this from within a vmware horizon VDI if that will give you a clue.

 

Is there a way to reset it all and "0" all settings to default and start from scratch?

 



2 Replies

@MKSMN 

 

have you tried the below powershell command to re-register PSGallery?

Register-PSRepository -Default

 you could also try updating PowerShell NuGet as well

Install-PackageProvider -Name NuGet -Force

 

@SteveMacNZ I did try it but would not work.

 

But i did find the issue late yesterday afternoon. It was a non standard cert that came down from my cisco umbrella protection that stopped PowerShell from even reaching the repository.

 

I had to export the cert and manually import it. After that and forcing it to use TLS 1.2 it worked great!