Reputation: 1153
I am trying to install Az module on my windows server 2016 via PowerShell but it is giving me the error shown in the screenshot below.
It gives same error when tried on Windows 10 server as well.
If I try to install Azure RM command still the same error.
I have .Net Framework 4.8 present on Windows 2016 server and .Net 4.7 on Windows 10 server. The PS version is 5.1 on both the server.
I tried referring couple solutions mentioned on multiple sites but no one seems to work.
Can anyone please let me know what am I missing or how can I resolve this error?
Upvotes: 0
Views: 2725
Reputation: 702
I used to get these errors a lot back in the day.
Try to run this:
Find-Module PowerShellGet | Install-module
if not this should work:
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
Register-PSRepository -Default -Verbose
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted
Then you should be able to install the module.
Upvotes: 0