I've been running into some issues recently whereby I haven't been able to download or update modules in PowerShell. I have been seeing various messages about internet connectivity and seeing as my work machine uses a corporate web proxy server I just assumed this was the issue...
I was getting messages such as
I was pretty much convinced it was proxy related but Invoke-WebRequest was returning data so it didn't add up... After some google searching I stumbled across this article which pointed me in another direction - TLS settings
I hadn't considered this as all the symptoms pointed to a connectivity issue rather than a settings problem, but sure enough after running this command
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
PowerShell fired into life and modules started downloading and updating.
Note: this command only affects the current session and does not persist
I hope this is useful for someone else, as it certainly got me out of a jam!