Skip to content

Instantly share code, notes, and snippets.

@dfinke
Last active August 29, 2015 14:09
Show Gist options
  • Select an option

  • Save dfinke/90bcb28e7cc4e0d231a8 to your computer and use it in GitHub Desktop.

Select an option

Save dfinke/90bcb28e7cc4e0d231a8 to your computer and use it in GitHub Desktop.
$template = @'
{[DateTime]Date*:Tue Nov 11, 2014} {Home:Penguins}{Away:Rangers} {[DateTime]Time:7:00 PM} FINAL PIT (0) - NYR (5) Recap
{Date*:Sat Mar 14, 2015} {Home:Bruins}{Away:Penguins} 1:00 PM ROOT, NHLN-US, TVA Tickets BUY/SELL
Thu Mar 26, 2015 PenguinsHurricanes 7:00 PM ROOT
Sat Nov 22, 2014 PenguinsIslanders 7:00 PM ROOT, CITY
Sat Nov 1, 2014 SabresPenguins 7:00 PM FINAL BUF (0) - PIT (5) Recap
Fri Jan 16, 2015 PenguinsIslanders 7:00 PM ROOT, TVA2
'@
(Invoke-WebRequest http://penguins.nhl.com/club/schedule.htm).AllElements |
Where {$_.class -match "rweven|rwodd"} |
ForEach { $_.innertext -replace "`r`n", " " } |
ConvertFrom-String -TemplateContent $template |
select @{n='Date';E={ (Get-Date($_.Date.ToString('MM/dd/yyyy') + ' ' + $_.Time.ToString('HH:mm'))).ToString("F") }},Home,Away |
Out-GridView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment