Weekend Reading: June 13 Edition — Xbox brings the big guns to E3, Bing maps favelas, soccer tournament mania

It’s been a long four years for soccer fans everywhere, but the wait is over. The world’s premiere fútbol tournament is finally here! To celebrate, we’ve got a Weekend Reading guaranteed to make you shout “GOOOAAAAAL!”

Also, on the list of big events this week, the Electronic Entertainment Expo, or E3, where Xbox made a splash with the announcement of a spectacular lineup of games, including the following, planned for a fall or holiday season launch: “Halo: The Master Chief Collection,” “Sunset Overdrive,” “Fable Legends,” “Dance Central Spotlight” and “Forza Horizon 2.”

Feel like you need a crystal ball to compete in your soccer tournament office pool? Bing Predicts has you covered. That’s right. Your favorite search engine just got even smarter. And Bing has intel on more than fútbol. Since its launch this spring, Bing Predicts has accurately called the outcome of every week of “American Idol,” while also proving nearly perfect in predicting the results of “The Voice” and “Dancing with the Stars.”

This week, we also met the brains behind Cortana, your new personal assistant for Windows Phone 8.1., a.k.a. your gatekeeper, your mobile brain. Two years in the making and modelled on real-life personal assistants, Cortana was created by a team of scientists, software engineers and writers led by Marcus Ash.

clip_image001

As visitors from around the world descend on Brazil for the world’s premier soccer tournament, they will be able to find previously unmapped tourist attractions in Rio’s densely populated, informal settlements called favelas, thanks to Bing’s Na Área. The project, which used Nokia Lumia phones to capture the corresponding images, is a collaboration with residents as well as public and private partners.

clip_image002

Can’t make it to Rio? Xbox, Internet Explorer, Windows Phone, Skype and Bing have the next best thing: a bevy of ways to help enhance these weeks of soccer mania everyone’s been waiting for. Check out the Destination Brazil portal on Xbox One, a one-stop shop for all things fútbol. The Bing Sports app in the Windows Phone Store and Windows Store has been updated to include the tournament’s top stories, scores, standings, leading players and teams. And Internet Explorer is working with ESPN FC to bring the ESPN FC World Cup Essentials sports hub to the Web.

clip_image003

And because we can’t get enough of “the beautiful game,” check out the Onefootball Brasil app for Windows Phone, which provides up-to-date play-by-play match commentary, the latest news of the tournament, and match schedules, results and statistics, all through personalized push notifications. Also in apps this week, lots of practical stuff: Use the Hhonors app to book a room; manage your car’s maintenance with the Jiffy Lube app; catch up on the day’s headlines with The Seattle Times News. Or, if you just want to terrorize some swine, Angry Birds has gone Epic, with more worlds, more battles, more awesome, now available on Windows Phone.

clip_image005

In this week’s installment of Snaps, Microsoft Stories’ digital photo album, local kids play soccer in a favela of Rio de Janeiro, Brazil, where many of the world’s best professional soccer players will compete in the weeks ahead. Photo taken by National Geographic photographer Stephen Alvarez using a Nokia Lumia 1520.

clip_image007

This week on the Microsoft Facebook page, we introduced you to a group of graduating high school seniors planning their road ahead.

Here’s wishing your team multiple shots on goal this weekend. We’ll see you back here for more action, fútbol and otherwise, next week.

Posted by Aimee Riordan
Microsoft News Center Staff

Programmatically Detecting when a VM Changes State

Every now and then I get asked how to detect whenever a virtual machine changes state.  Usually, people who ask about this have written some code that periodically queries Hyper-V to see what state different virtual machines are in (stopped, running, etc.).  What they find is that this is not efficient – and it sometimes misses a virtual machine that has quickly changed state (e.g. stopped and started again).

Luckily, there is a way to be notified of virtual machine state changes without polling for information.

To do this – you want to use WMI instance modification events:

# WMI Query that specifies what events we will watch for

$Query = "Select * from __InstanceModificationEvent within 3 where TargetInstance ISA 'MSVM_ComputerSystem' `

          and TargetInstance.EnabledState  PreviousInstance.EnabledState"

 

# Script block that will run whenever the event fires

[ScriptBlock]$Action = {

   $VMName = $Event.SourceEventArgs.NewEvent.TargetInstance.ElementName

 

   switch ($Event.SourceEventArgs.NewEvent.TargetInstance.EnabledState)

      {

        2 {$vmState = "running"}

        3 {$vmState = "turned off"}

        9 {$vmState = "paused"}

        6 {$vmState = "in a saved state"}

        10 {$vmState = "starting"}

        4 {$vmState = "stopping"}

        default {$vmState = "in an unknown state..."}

       }

 

   if ($Event.SourceEventArgs.NewEvent.TargetInstance.EnabledState -eq 1)

      {$vmState = $Event.SourceEventArgs.NewEvent.TargetInstance.OtherEnabledState}

 

   write-host "The virtual machine '$($vmName)' is now $($vmState)."}

 

# Register for the events

Register-WMIEvent -Query $Query -Action $Action -Namespace rootvirtualizationv2

 

# To clean up - run "Get-EventSubscriber | Unregister-Event"

This code will print out a message whenever a virtual machine changes state.

Cheers,
Ben