staring of day 12, using the cookie to pull the data on the fly from the website.

This commit is contained in:
dan 2020-12-11 23:43:33 -06:00
parent 5feb66cd75
commit 20ca3e9f09

View File

@ -0,0 +1,8 @@
$cookievalue = get-content .\Cookie.txt
$cookie = New-Object system.net.cookie
$cookie.name="session"
$cookie.domain = "adventofcode.com"
$cookie.Value=$cookievalue
$websession = new-object Microsoft.PowerShell.Commands.WebRequestSession
$websession.cookies.add($cookie)
$inputdata = Invoke-RestMethod -Uri https://adventofcode.com/2020/day/12/input -Method GET -WebSession $websession