Struggling to Install PowerShell Modules on Windows 11

0
15
Asked By TechieNerd247 On

I'm having a tough time installing any modules on my new corporate Windows 11 machine. When I try running commands like `Install-Module ExchangeOnlineManagement`, I get a 'no match was found' error. The prompt suggests running `Get-PSRepository`, but that only returns a warning saying 'Unable to find module repositories.' I've already tried using `[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12` to enforce TLS, I'm running PowerShell as an administrator, and I'm not behind a proxy. Any ideas on how to resolve this?

5 Answers

Answered By FixItNow75 On

Another thing you could do is delete the file located at `$env:LOCALAPPDATAMicrosoftWindowsPowerShellPowerShellGetPSRepositories.xml`. Then, run `Register-PSRepository -Default` again. It should recreate the file and might resolve the issue.

Answered By SysAdminAce On

Check your execution policy by running `Get-ExecutionPolicy` and make sure it’s set to something permissive like `RemoteSigned`. If it's too restrictive, it might prevent installations.

Answered By CuriousCoder19 On

Have you tried running `Register-PSRepository -Default`? After that, check again with `Get-PSRepository` to see if anything changes. Sometimes, this command can help refresh the repositories you're allowed to use.

Answered By ModuleHunter99 On

You could attempt to install modules using `Install-Module -Name -Scope CurrentUser`. If that doesn't work, exporting the module from your Exchange server and installing it manually could be your best bet.

Answered By PowerShellWizard89 On

Are you registered with PSGallery? If you can't see it when you run `Get-PSRepository`, try using the repository parameter with your install command that names PSGallery explicitly. Also, check if you can access the module directly via the web.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.