This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$allGames = gc .\input.txt | |
$score = 0 | |
#Rock = A X 1 | |
#Paper = B Y 2 | |
#scissors = C Z 3 | |
#(0 if you lost, 3 if the round was a draw, and 6 if you won). | |
forEach ($game in $allGames) | |
{ | |
switch ($game) { | |
"A X" {$score += 3 ; $score += 1}#draw RR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$calList = gc input.txt | |
$calorieTotal = 0 | |
$elfNumber = 0 | |
$elves = foreach ($package in $callist) | |
{ | |
if ($package -eq ''){ | |
#record calories and zero total | |
[PSCustomObject]@{ | |
Elf = $elfNumber |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$list = gc .\day6input.txt -Delimiter "`n`r" | |
$answer = 0 | |
foreach ($group in $list) | |
{ | |
$group = (($group -replace "`n","")-replace " ","")-replace "`r","" | |
$answer = $answer + (($group.ToCharArray() | sort -unique).count) | |
} | |
$answer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#####puzzle can be found here: https://adventofcode.com/2020/day/5 | |
$list = gc .\day5Input.txt | |
$highest =0 | |
foreach ($ticket in $list) | |
{ | |
$rowCode = $ticket.Substring(0,7).ToCharArray() | |
$columnCode = $ticket.Substring(7,3).ToCharArray() | |
$rowLowerbound = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#puzzle can be found at https://adventofcode.com/2020/day/3 | |
$i = gc .\input.txt | |
$position = 1 | |
$results = $null | |
$horizontalMovement = 3 | |
foreach($line in $i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################PART 1################ | |
(((Get-Content .\input.txt -raw) -replace " ",",") -replace "-",",") -replace ":","" > input.csv | |
$header ="min","max","char","password" | |
$list = import-csv .\input.csv -header $header | |
$total = 0 | |
foreach ($line in $list) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://adventofcode.com/2020/day/1 | |
################part 1################ | |
$list = Get-Content .\list.txt | |
foreach ($item in $list) | |
{ | |
foreach ($item1 in $list) | |
{ | |
$total = [int]$item + [int]$item1 | |
if ($total -eq 2020) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.UI; | |
using System.Web.UI.WebControls; | |
using System.Management.Automation; | |
using System.Text; | |
namespace PowerShellExecution |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="PowerShellExecution.Default" %> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head id="Head1" runat="server"> | |
<title></title> | |
</head> | |
<body> | |
<form id="form1" runat="server"> | |
<div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<##> | |
param ( | |
[int]$WhichOctet, | |
[int]$Zone1_OctetValue, | |
[int]$Zone2_OctetValue, | |
$DNSZone1_server, | |
$DNSZone2_server | |
) |
NewerOlder