使用PowerShell自动化Virtual PC 2007吗? [英] Automate Virtual PC 2007 with PowerShell?

查看:109
本文介绍了使用PowerShell自动化Virtual PC 2007吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这基本上是此副本问题,但是接受的答案是否",我想一直公开这个问题,直到获得实际答案为止,而不是接受否"并放弃.

This is basically a duplicate of this question, but the accepted answer was "no" and I would like to keep this question open until getting an actual answer instead of accepting "NO" and giving up.

Stephen Rose 通过Twitter DM告诉我使用PowerShell来启动和停止Virtual PC VM,并可以执行运行安装,自动更新和病毒扫描之类的操作,但是他尚未响应我对任何描述该操作方法的资源链接的要求.

Stephen Rose told me via Twitter DM to use PowerShell to start and stop Virtual PC VM's and do things like run installations, automatic updates and virus scans, but he hasn't yet responded to my request for any links to resources that describe how to do so.

我已经开始学习PowerShell,但是我不知道如何获取或使用Virtual PC中VM列表中的任何信息.

I've started learning PowerShell, but I can't figure out how to get or work with any information on the list of VM's within Virtual PC.

Windows Virtual PC(Windows 7 XP模式)与Virtual PC 2007不同.我将Windows 7作为主机OS,但是我仍在使用Virtual PC 2007,因为我需要来保持在没有新的Windows Virtual PC的Vista或XP主机上运行来宾计算机的能力.我短暂地安装了Windows Virtual PC进行检出,它必须在我的虚拟映像上进行大量转换. @ x0n($vpc = new-object -com virtualpc.application)的建议在我的系统上产生以下错误:

Windows Virtual PC (Windows 7 XP Mode) is not the same as Virtual PC 2007. I am running Windows 7 as my host OS, but I'm still using Virtual PC 2007 because I need to maintain the ability to run the guest machines on Vista or XP hosts that won't have the new Windows Virtual PC. I installed Windows Virtual PC briefly to check it out and it had to do a bunch of conversions on my virtual images. The suggestion by @x0n ($vpc = new-object -com virtualpc.application) produces the following error on my system:

New-Object : Cannot load COM type virtualpc.application.
At line:1 char:18
+ $vpc = new-object <<<<  -com virtualpc.application
    + CategoryInfo          : InvalidType: (:) [New-Object], PSArgumentException
    + FullyQualifiedErrorId : CannotLoadComObjectType,Microsoft.PowerShell.Commands.NewObjectCommand

我使用了

Edit 2: I used Jeff's code from this answer to list all the COM objects on my system and couldn't find any that looked like they were Virtual PC. So now I'm thinking that the "it's not possible" answer may be correct, but I'm still going to leave this question open in case anyone has any further suggestions for getting PowerShell to work with Virtual PC 2007. In the mean time, I'm strongly considering making the jump to the new Windows Virtual PC in Windows 7 and just not worrying about keeping all my virtual machines compatible with earlier versions of Windows.

推荐答案

要在VM中测试我自己的某些软件,我使用AutoIt( http://www.autoitscript.com/autoit3/)来启动VM,然后在VM中再次使用它来启动和控制我的应用程序.使用VM内的共享文件夹进行通信(编写AutoIt脚本以执行,并像日志一样输出应用程序).

To test some of my own software within a VM I use AutoIt (http://www.autoitscript.com/autoit3/) to start the VM, and within the VM I use it again to start and control my application. Communication is done using a shared folder within the VM (writing the AutoIt script to execute, output of the application like a log).

它不是Powershell,但是也许无论如何这都会有所帮助. :)

It's not Powershell, but maybe this helps anyway. :)

此致

塞巴斯蒂安

这篇关于使用PowerShell自动化Virtual PC 2007吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆