I am trying to run the following command in my Windows 10 PC , and PowerShell version 7.1.2
> Install-Module PowerShellGet, PackageMAnagement -Force -WarningAction SilentlyContinue
But I am getting the below error as shown in the screenshot :
-- No match was found for the specified search criteria and module name 'PackageManagement'.
Note : I am trying to run this command on my Office laptop and it is giving me this error. The same thing if I run on my personal PC , this is working fine.
I am really stuck on this for past 4 days. Please help
Edit :
If I request modules separately , that works .
Meaning , the below works fine ..
Install-Module PowerShellGet -Force -WarningAction SilentlyContinue Install-Module PackageManagement -Force -WarningAction SilentlyContinue
If you have an authenticating proxy you'll need to account for that - Powershell does not look at the system proxy settings by default.
Try adding this before you request the module:
If, as the error message suggests, you type
Get-PSRepository
then it should return PSGallery without error if you have a connection