Archives for the Month of February, 2010

PowerShell Hotkey to Pause Pandora

I’ve got a neat application that I use to map keystrokes to background PowerShell functions / script blocks. I recently started using Pandora more often, and the killer problem is when somebody drops by the office to ask a quick question. You dig around all of your open Explorer windows until you find the one for Pandora, then find the Pause button.

Here’s a function that does all of that for you, and maps it to Control+Alt+P:

001
002
003
004
005
006
007
008
009
010
011
012
013
function PausePandora
{
    $ie = New-Object -Com Shell.Application
    $pandora = $ie.Windows() | ? { $_.LocationName -like "*Pandora Radio*" }
    if($pandora)
    {
        $pandora.Navigate2("http://www.pandora.com/#/paused")
    }
    $ie = $null
}

## Pause Pandora
$keyMapping['Control,Alt,P'] = @{ Action =  { PausePandora } }

Looking for Reviewers for PowerShell Cookbook v2

We're getting close to "content complete" of the Windows PowerShell Cookbook, 2nd edition. The next step is technical review, where we look for both high-level and low-level feedback on the content and structure.

Also, this is a book focused on administrators. While PowerShell uber-hackers are always appreciated, inexperience with PowerShell is extremely valuable, as well.

If you're interested in being a Technical Reviewer of the book, participate in its Open Beta!

(Update 03/19/2010 – the Cookbook is now in an Open Beta!)