Internet Radio Function

PowerShell Team

I found a cool blog entry at http://hung-yuwu.spaces.live.com/Blog/cns!744FB258BF8C8020!1377.entry . I have no idea what it says but I can read the script and I like it. The person has an internet radio site that they like and wrote a simple script to get run it in an IE windows with a fixed size and location and without all the IE adornments. I love this stuff!

function ufo-radio
{
$ie = new-object -com “InternetExplorer.Application”
$ie.Navigate2(“http://radio.hinet.net/radio/player/player_ie.jsp?radio_id=232”);
$ie.width = 400
$ie.height = 270
$ie.Top=500
$ie.Left=0
$ie.Resizable =$false
$ie.ToolBar =$false
$ie.MenuBar =$false
$ie.Visible = $true;
}
set-alias ufo ufo-radio

The one nit I have is that that should probably be called: Start-UFO instead of UFO-Radio. Get-UFO might also be OK and then you don’t need the alias. Remember if you type a command and we can’t resolve it, we’ll add a “get-” in front of it and try it again. So if you named this Get-UFO and typed UFO – we would look for something called UFO and if it existed – we would use that otherwise we would look up Get-UFO. Try this yourself with PROCESS, SERVICE, etc.

Enjoy!

Jeffrey Snover [MSFT]
Windows PowerShell/MMC Architect
Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

0 comments

Discussion is closed.

Feedback usabilla icon