Sunday, August 17, 2014

Bored?

The below script with go through a list of PowerShell links and open them each up one at a time within a single tab. Every 2 seconds a new article will appear -- when you find something good just hit [CTRL]+C to stop the script form continuing.



001
002
003
004
005
006
007
008
009
010
011

$blog="http://www.matthewkerfoot.com/p/powershell-links.html"
$ie = new-object -com internetexplorer.application
$iwr = Invoke-WebRequest -Uri $blog
$links = $iwr.Links | Select-Object -skip 7 -ExpandProperty href
foreach($l in $links){
                        $ie.visible=$true
                        $ie.navigate("$l")
                                while ($ie.Busy -eq $true){ 
                                                            Wait-Event -Timeout 2
                                }
}