title: Invoke-WebRequest : The remote name could not be resolved: 'http'
body: <p>I have been working with Powershell all day, playing with proxy settings and related. A POST request that once worked earlier in the day, is now stating a very bizarre error:</p>
  <p>The request:</p>
  <pre><code>$tenantId = '8331e1..........'
  
  $client_id = 'a3b869ef................
  $client_secret = '0w;m$................'
  
  
  #************ GET AAD TOKEN ************
  
  $url = &quot;https://login.microsoftonline.com/&quot; + $tenantId + &quot;/oauth2/token&quot;
  
  $body = @{
      grant_type = 'client_credentials'
      client_id = $client_id
      client_secret = $client_secret
      resource = 'https://dev.azuresynapse.net'
  }
  
  $GetAADResult = Invoke-WebRequest -Method 'Post' -Uri $url -Body $body
  
  $GetAAD_Content_JSON = $GetAADResult.Content | ConvertFrom-Json
  
  $access_token = $GetAAD_Content_JSON.access_token
  
  # print access_token
  $access_token
  </code></pre>
  <p>This used to provide a simple token as a response, but now it is returning the error:</p>
  <pre><code>Invoke-WebRequest : The remote name could not be resolved: 'http'
  At line:24 char:17
  + ... GetAADResult = Invoke-WebRequest -Method 'Post' -Uri $url -Body $body
  +                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : NotSpecified: (:) [Invoke-WebRequest], WebException
      + FullyQualifiedErrorId : System.Net.WebException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
   
  ConvertFrom-Json : Cannot bind argument to parameter 'InputObject' because it is null.
  At line:26 char:48
  + $GetAAD_Content_JSON = $GetAADResult.Content | ConvertFrom-Json
  +                                                ~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidData: (:) [ConvertFrom-Json], ParameterBindingValidationException
      + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ConvertFromJsonCommand
  </code></pre>
  <p>I do not know what needs to change to get this functionating again, it appears PowerShell is looking for a proxy setting in every request...? Anny ideas?</p>