From 20ca3e9f09576e887dd4f9938910b3d9cdf46585 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 11 Dec 2020 23:43:33 -0600 Subject: [PATCH] staring of day 12, using the cookie to pull the data on the fly from the website. --- Advent Of Code Day 12-part1.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Advent Of Code Day 12-part1.ps1 diff --git a/Advent Of Code Day 12-part1.ps1 b/Advent Of Code Day 12-part1.ps1 new file mode 100644 index 0000000..99d8a13 --- /dev/null +++ b/Advent Of Code Day 12-part1.ps1 @@ -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