Control Windows Virtual PC from PowerShell

I have used the command line interface (CLI) for Sun’s Virtual Box and for Hyper V but I didn’t realize that Virtual PC also can be accessed through PowerShell. This might be the key to creating network based differencing disks natively on Windows 7 which currently isn’t something that can be done in a straightforward way through the GUI and even the way that it can be done has limitations (like not being able to create a differencing disk with the parent disk on the network).

</pre>
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
PS H:\> $vpc=new-object -com VirtualPC.Application
PS H:\> $vpc
HostInfo                    : System.__ComObject
VirtualMachines             : System.__ComObject
VirtualNetworks             : System.__ComObject
UnconnectedNetworkAdapters  : System.__ComObject
SupportDrivers              : System.__ComObject
Tasks                       : System.__ComObject
MinimumMemoryPerVM          : 4
MaximumMemoryPerVM          : 3575
SuggestedMaximumMemoryPerVM : 3217
MaximumFloppyDrivesPerVM    : 1
MaximumSerialPortsPerVM     : 2
MaximumParallelPortsPerVM   : 1
MaximumNetworkAdaptersPerVM : 4
MaximumNumberOfIDEBuses     : 2
DefaultVMConfigurationPath  : C:\Users\cmagnuson\AppData\Local\Microsoft\Windows Virtual PC\Virtual Machines\
SearchPaths                 : {}
USBDeviceCollection         : System.__ComObject
Name                        : Windows Virtual PC
Version                     : 6.1.7600.16393
UpTime                      : 6
PS H:\> $vm = $vpc.FindVirtualMachine(
>>
>>
>>
PS H:\> $vm = $vpc.FindVirtualMachine("IE 6")
PS H:\> $vm
Name                  : IE 6
ConfigID              : {DB33D85B-1FAC-4A67-910A-33EE4A4F06FC}
File                  : C:\Users\cmagnuson\AppData\Local\Microsoft\Windows Virtual PC\Virtual Machines\IE 6.vmc
Accountant            : System.__ComObject
GuestOS               : System.__ComObject
Display               : System.__ComObject
Keyboard              : System.__ComObject
Mouse                 :
State                 : 2
ShutdownActionOnQuit  : 0
SavedStateFilePath    : C:\Users\cmagnuson\AppData\Local\Microsoft\Windows Virtual PC\Virtual Machines\IE 6.vsv
BIOSGUID              : {D5356F8F-4383-4B68-ACDA-03D1A06E5C46}
BIOSSerialNumber      : 8425-1374-7407-2656-1007-9980-44
BaseBoardSerialNumber : 8425-1374-7407-2656-1007-9980-44
ChassisSerialNumber   : 8425-1374-7407-2656-1007-9980-44
ChassisAssetTag       : 1746-8710-8930-6641-7796-6780-67
HardDiskConnections   : System.__ComObject
Undoable              : False
UndoAction            : 1
DVDROMDrives          : System.__ComObject
FloppyDrives          : System.__ComObject
NetworkAdapters       : System.__ComObject
SerialPorts           : System.__ComObject
ParallelPorts         : System.__ComObject
ProcessorSpeed        : 2926
HasMMX                : True
HasSSE                : True
HasSSE2               : False
Has3DNow              : False
RdpPipeName           :
Notes                 :
Memory                : 1024
AttachedDriveTypes    : {1, 0, 2, 0}
PS H:\>

Original Source: http://blogs.msdn.com/b/virtual_pc_guy/archive/2009/07/14/windows-virtual-pc-and-powershell.aspx

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: