title: PowerShell Invoke-WebRequest download links in RawContent
body: <p>I am trying to download the links from a webpage, but for some reason, the links are not listed with. Links. The only way I can see the links is with. RawContent which shows something like this:</p>
  
  <pre><code>$WebResponse = Invoke-webRequest $URI
  
  $WebResponse.RawContent
  
  &lt;html&gt;&lt;body&gt;&lt;a href="/SettingsEditor/exportFile?type=ACCOUNTING&amp;filename=70011083620180310.CSV"&gt;70011083620180310.CSV&lt;/a&gt;&lt;br /&gt;&lt;a href="/SettingsEditor/exportFile?type=ACCOUNTING&amp;filename=70011083620180311.CSV"&gt;70011083620180311.CSV&lt;/a&gt;&lt;br /&gt;&lt;a href="/SettingsEditor/exportFile?type=ACCOUNTING&amp;filename=70011083620180312.CSV"&gt;70011083620180312.CSV&lt;/a&gt;&lt;br /&gt;&lt;a href="/SettingsEditor/exportFile?type=ACCOUNTING&amp;filename=70011083620180313.CSV"&gt;70011083620180313.CSV&lt;/a&gt;&lt;br /&gt;&lt;a href="/SettingsEditor/exportFile?type=ACCOUNTING&amp;filename=70011083620180314.CSV"&gt;70011083620180314.CSV&lt;/a&gt;&lt;br /&gt;&lt;a href="/SettingsEditor/exportFile?type=ACCOUNTING&amp;filename=70011083620180315.CSV"&gt;70011083620180315.CSV&lt;/a&gt;&lt;br /&gt;&lt;a href="/SettingsEditor/exportFile?type=ACCOUNTING&amp;filename=70011083620180316.CSV"&gt;70011083620180316.CSV&lt;/a&gt;&lt;br /&gt;&lt;a href="/SettingsEditor/exportFile?type=ACCOUNTING&amp;filename=70011083620180317.CSV"&gt;70011083620180317.CSV&lt;/a&gt;&lt;br /&gt;&lt;a href="/SettingsEditor/exportFile?type=ACCOUNTING&amp;filename=70011083620180318.ACL"&gt;70011083620180318.ACL&lt;/a&gt;&lt;br /&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>I am trying to figure out how to parse this to get the files downloaded. I used to use wget but that is no longer an option so I turned to PowerShell. I have tried piping it to list the hrefs but it doesn't seem to recognize them in the raw content for some reason. Can anyone help point me in the right direction?</p>
  
  <p>Added info for the response:</p>
  
  <pre><code>PS D:\users\me\Downloads&gt; $webRequest | Get-Member
  
  
     TypeName: Microsoft.PowerShell.Commands.WebResponseObject
  
  Name              MemberType Definition
  ----              ---------- ----------
  Equals            Method     bool Equals(System.Object obj)
  GetHashCode       Method     int GetHashCode()
  GetType           Method     type GetType()
  ToString          Method     string ToString()
  BaseResponse      Property   System.Net.WebResponse BaseResponse {get;set;}
  Content           Property   byte[] Content {get;set;}
  Headers           Property   System.Collections.Generic.Dictionary[string,string] Headers {get;}
  RawContent        Property   string RawContent {get;set;}
  RawContentLength  Property   long RawContentLength {get;}
  RawContentStream  Property   System.IO.MemoryStream RawContentStream {get;}
  StatusCode        Property   int StatusCode {get;}
  StatusDescription Property   string StatusDescription {get;}
  </code></pre>