title: PowerShell Installing NuGet, says unable to access internet, but I actually can
body: <p>I followed the steps mentioned in <a href="http://woshub.com/using-powershell-behind-a-proxy/" rel="noreferrer">Using PowerShell Behind a Proxy</a> to configure my proxy server.</p>
  
  <pre><code>netsh winhttp set proxy "[IP]:[Port]"
  $Wcl = New-Object System.Net.WebClient
  $Creds = Get-Credential
  $Wcl.Proxy.Credentials = $Creds
  </code></pre>
  
  <p>A dialog popped up to collect my credential on the third line.</p>
  
  <p>Then I tried to install NuGet:</p>
  
  <pre><code>PS C:\Users\Administrator&gt; Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
  WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/
           ?LinkID=627338&amp;clcid=0x409' to ''.
  WARNING: Unable to download the list of available providers. Check your internet
           connection.
  Install-PackageProvider : No match was found for the specified search criteria
  for the provider 'NuGet'. The package provider requires 'PackageManagement' and
  'Provider' tags. Please check if the specified package has the tags.
  At line:1 char:1
  + Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidArgument: (Microsoft.Power...PackageProvider:InstallPackageProvider) [Install-PackageProvider], Exception
      + FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackageProvider
  </code></pre>
  
  <p>The error message seems to indicate my PowerShell cannot connect to internet, but when I tried this command: </p>
  
  <pre><code>PS C:\Users\Administrator&gt; Invoke-WebRequest "https://go.microsoft.com/fwlink/?LinkID=627338&amp;clcid=0x409"
  
  StatusCode        : 200
  StatusDescription : OK
  Content           : &amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
                      &amp;lt;SoftwareIdentity xmlns="http://standards.iso.org/iso/19770/-2/2015/schema.xsd"
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:discovery="http://p...
  RawContent        : HTTP/1.1 200 OK
                      Content-MD5: 01uMBNqAHedJsS1dqKC5oA==
                      Vary: Accept-Encoding
                      X-Cache: HIT
                      x-ms-blob-type: BlockBlob
                      x-ms-lease-status: unlocked
                      x-ms-request-id: 1b7af5a7-901e-0003-5d94-f5cc950000...
  Forms             : {}
  Headers           : {[Content-MD5, 01uMBNqAHedJsS1dqKC5oA==], [Vary, Accept-Encoding], [X-Cache, HIT],
                      [x-ms-blob-type, BlockBlob]...}
  Images            : {}
  InputFields       : {}
  Links             : {}
  ParsedHtml        : System.__ComObject
  RawContentLength  : 1847
  </code></pre>
  
  <p>It seems it can connect to the Internet after all.</p>
  
  <p>What did I do wrong? How do I install NuGet?</p>
  
  <p>EDIT: 
  I tried Ocaso Protal's suggestion: </p>
  
  <pre><code>PS C:\Users\Administrator&gt; Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -proxy [ProxyServer:Port] -proxycredential $Creds
  WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&amp;clcid=0x409' to ''.
  WARNING: Unable to download the list of available providers. Check your internet connection.
  Install-PackageProvider : No match was found for the specified search criteria for the provider 'NuGet'. The package
  provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package has the tags.
  At line:1 char:1
  + Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force  ...
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidArgument: (Microsoft.Power...PackageProvider:InstallPackageProvider) [Install-Pac
     kageProvider], Exception
      + FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackagePro
     vider
  
  PS C:\Users\Administrator&gt; $Creds
  
  UserName                                   Password
  --------                                   --------
  [My UserName] System.Security.SecureString
  </code></pre>
  
  <p>It seems to have no effect.</p>