"The SSL connection could not be established, see inner exception." Issue Installing Microsoft.Graph Module in PowerShell in PowerShell
Hi everyone,
I'm experiencing an issue when trying to install the Microsoft.Graph module using PowerShell 7. When I run the following command:
Install-Module Microsoft.Graph -Scope CurrentUser -Repository PSGallery -Force -verbose
I receive the following error:
I tried checking the inner exception and the full error message, but the command does not return anything:
Additionally, when I run Invoke-WebRequest
with the -SkipCertificateCheck
flag, I get the following result:
If I run it without the flag, I receive this error:
Based on my research, the issue could be related to an incorrect Security Protocol configuration, but in my case, it is correctly set to TLS 1.2:
Moreover, if I manually access the following URL https://www.powershellgallery.com/api/v2/package/Microsoft.Graph.Authentication/2.25.0
via a web browser, the page loads successfully, and I can download the .nupkg file without any issues.
I have tried these solutions and commands both in normal mode and by running PowerShell as an administrator.
Does anyone have any suggestions on how to resolve this?
Thanks in advance!
Andrea