Advertisement
Guest User

Untitled

a guest
May 31st, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Set URL - Import of CSV data not working as hoped
  2. $url = "http://www.tenable.com/plugins/index.php?view=single&id=" + ${ Import-csv c:\users\user\input.csv -Header id }
  3.  
  4. $cve = Invoke-WebRequest -URI "$url"
  5.  
  6. # Extract data. When $url set manually to valid link, it pulls a CVE number out but not the highest number one. Also do not know how to output this to a new column on the input csv (or alternatively a copy of it)
  7. $cve.AllElements | Where-Object {$_.innerhtml -like "*CVE-*"} | Sort-Object { $_.InnerHtml.Length } | Select-Object InnerText -First 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement