Skip to content

Instantly share code, notes, and snippets.

@mollyporph
Created June 6, 2015 20:03
Show Gist options
  • Save mollyporph/9c7629a555075e97263b to your computer and use it in GitHub Desktop.
Save mollyporph/9c7629a555075e97263b to your computer and use it in GitHub Desktop.
$creds = Get-Credential
$dhurl = "https://crew.dreamhack.se/team/"
$teams = "Activity",
"Admin",
"Construction",
"Cosplay",
"Coverage",
"Crew Services",
"DHGAME",
"DreamArena Security",
"DreamHack HQ",
"DreamHack TV",
"DreamHackathon",
"Electricity Support",
"Entrance",
"Game",
"Hardware Logistics",
"Info",
"Kitchen",
"Logistics",
"Mainstage",
"Medic",
"Merchstore",
"Network",
"Nights Watch",
"Press Area",
"Relax and Massage",
"Security",
"Stores",
"St!c3!a4d",
"Support"
$ResList = new-object "System.Collections.Generic.Dictionary[string,System.Collections.Generic.List[string]]"
$teams | % {
$memberList = new-object "System.Collections.Generic.List[string]"
$qurl = $dhurl + $PSItem + ".htm";
$res = iwr $qurl -Credential $creds -UseBasicParsing;
$res.links.href | unique | %{$member = [Regex]::Matches($PSItem,"(?<=users\/)(\w+)(?=\.)").Value;if($member){$memberList.Add($member);}};
$membersList = $membersList |? {$_};
$ResList.Add($PSItem,$memberList);
}
#Testar lite
$ResList.'Hardware Logistics'
$ResList.'DreamHack TV'
$ResList.'St!c3!a4d';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment