如果你想在公司电脑上使用PowerShell,导入一些module或者查找一些module,可能会遇到 下面的报错:

unable to resolve package source ‘https //www.powershellgallery.com/api/v2/’

问题就是公司有代理,打开PowerShell,运行下面的命令,完美解决。

$webclient=New-Object System.Net.WebClient
$webclient.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials

感谢这位印度小哥的文章:https://enterinit.com/powershell-unable-to-resolve-package-source/amp/