Freigeben über


Windows Powershell and Windows Mobile SDK?

Had the pleasure of demonstrating the Windows Mobile part of DinnerNow to a Windows Mobile PM. During the demo, I loaded up Visual Studio 2008, and started the emulator ready for the mobile app. It turns out you don't need to launch VS to start the emulator, in fact you can do it using the Microsoft.SmartDevice.Connectivity namespace.

Not being able to help myself, I thought - aha, I can script this now with Powershell.

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SmartDevice.Connectivity")

$dm = new-object Microsoft.SmartDevice.Connectivity.DatastoreManager 1033

$plat = $dm.GetPlatforms()

$plat

($plat[5]).getDevices()

$device = ($plat[5]).getDevices()[1]

$device.Connect()

You'll need the Windows Mobile SDK 6 installing, but those few lines of code should get you started.

THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS

Comments