Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@wictorwilen
Created August 1, 2016 06:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wictorwilen/0ccaf0c5d2419ab58c92c81665039f81 to your computer and use it in GitHub Desktop.
Save wictorwilen/0ccaf0c5d2419ab58c92c81665039f81 to your computer and use it in GitHub Desktop.
Office 365 Roadmap site script
## Import a diff file
$d = Import-Clixml .\diff2016-05-20.xml
## Write some Html stuff
$d | ?{$_.SideIndicator -eq "=>"} | % {
Write-Host "<li><b>$($_.outerText):</b> </li>"
}
## Get the Roadmap page
#$r = Invoke-WebRequest http://success.office.com/en-us/roadmap/
$r = Invoke-WebRequest http://fasttrack.office.com/roadmap
## Find all the links
$lines = $r.Links | ?{$_.'data-toggle' -eq "collapse"}| select OuterText, href
## Create a storage location
mkdir $home\O365Checker -ea 0 | Out-Null
## Check if we have a baseline file
if( -not (Test-Path $home\O365Checker\baseline.xml) )
{
## Export current data to a baseline file
$lines | Export-Clixml $home\O365Checker\baseline.xml
}
## Import the baseline file (first time, they will be the same ones)
$baseline = Import-Clixml $home\O365Checker\baseline.xml
## Compare the baseline and the downloaded one
$diff = Compare-Object -ReferenceObject $baseline -DifferenceObject $lines -Property outerText, href -PassThru
## Check for diffs
if($diff -eq $null) {
Write-host "no diff"
} else {
## Write the diff
$fn = "diff$((get-date).ToString('yyyy-MM-dd')).xml"
$diff | Export-Clixml $home\O365Checker\$fn
## Tell the world about it
[System.Reflection.Assembly]::LoadWithPartialName(“System.Windows.Forms”) |Out-Null
[Windows.Forms.MessageBox]::Show(“Found a diff in the Office Roadmap”, “WW's Awesome Office Roadmap script”, [Windows.Forms.MessageBoxButtons]::OK, [Windows.Forms.MessageBoxIcon]::Information) | Out-Null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment