2011-01-28 3 views
0

Windowsの仮想XPモードでのPowershell v2.0のを使用して実行する場合は、次のスクリプトは動作しません:Windows Virtual XPモードでPowershellを使用する場合、どのようなCOMオブジェクト名を使用する必要がありますか?

# Connect to Virtual PC 
$vpc = new-object -comobject "VirtualPC.Application" 

# Get VM name 
$vmName = Read-host "Specify the name of the virtual machine that you want to use" 

# List available USB devices 
write-host "The following USB devices are available:" 
$vpc.USBDeviceCollection | select -ExpandProperty DeviceString 

# Get the USB device name 
$usb = Read-host "Enter the name of the USB device that you want to connect to the virtual machine" 

# Get the VM object 
$vm = $vpc.findVirtualMachine($vmName) 

# Get the USB object 
$usbDevice = $vpc.USBDeviceCollection | ? {$_.DeviceString -eq $usb} | select -first 1 

# Attach the device - this will fail if the VM is not running 
$vm.AttachUSBDevice($usbDevice) 

この命令 - 必要comobjectは何のWindows仮想XPモード では動作しません>$vpc = new-object -comobject "VirtualPC.Application" Windows Virtual XPモードで使用するには?

私はこの命令と判断した - >$vpc.USBDeviceCollection | select -ExpandProperty DeviceString はこの命令に交換する必要がある - >$vpc.IVMDeviceCollection | select -ExpandProperty DeviceString

答えて

0

あなたはXPモードでレジストリで探してみましたか?仮想マシンのレジストリに登録されているオブジェクトのみを作成できます。

+0

XPモードでレジストリをどこで調べる必要がありますか? – David

関連する問題