Windows Server 8 Tips (二) Hyper-V 3:用PowerShell导出和导入虚拟机

简介:

Windows Server 8 Tips  --Hyper-V 3:用PowerShell导出和导入虚拟机

在Windows Server 8 Beta中,我们可以使用PowerShell来批量的导出和导入虚拟机,这可以使得我们减轻管理虚拟机的工作量。

首先,我们可以在启用了Hyper-V的Windows Server 8 beta中使用管理员权限打开PowerShell,然后运行Get-VM来检测当前的虚拟机状态,比如我们的虚拟机分别命名为RDS01,RDS02,RDS03……,那么我们若需要批量导出这几台虚拟机,我们就可以运行以下命令来实现虚拟机的批量导出(假设导出到D分区下的VM文件夹):

Get-VM RDS* | Export –VM  -Path “D:\VM”

 

接着我们可以把已经导出的几个虚拟机批量的删除:

Get-VM RDS* | Remove-VM

接下来就可以在新的Hyper-V主机中导入这些虚拟机了(假设路径依然是在D分区的VM文件夹):

Get-Childitem "D:\VM" -Recurse *.xml | Import-VM

 

image


本文转自xury 51CTO博客,原文链接:http://blog.51cto.com/xury007/835601,如需转载请自行联系原作者

相关文章
|
3天前
|
网络安全 虚拟化 Windows
windows 11安装openSSH server 遇到的"kex_exchange_identification: read: Connection reset"问题
windows 11安装openSSH server 遇到的"kex_exchange_identification: read: Connection reset"问题
|
13天前
|
PHP Windows
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
|
23天前
|
开发框架 .NET API
Windows Server 2022 安装IIS 报错 访问临时文件夹 C:\WINDOWS\TEMP\3C 读取/写入权限 错误: 0x80070005
Windows Server 2022 安装IIS 报错 访问临时文件夹 C:\WINDOWS\TEMP\3C 读取/写入权限 错误: 0x80070005
57 0
|
25天前
|
Linux Docker Windows
Windows——Docker拉取Windows Server镜像
Windows——Docker拉取Windows Server镜像
89 0
|
2月前
|
弹性计算 持续交付 Docker
阿里云云效产品使用合集之如何部署到阿里云服务器上的 Windows Server 上的 IIS
云效作为一款全面覆盖研发全生命周期管理的云端效能平台,致力于帮助企业实现高效协同、敏捷研发和持续交付。本合集收集整理了用户在使用云效过程中遇到的常见问题,问题涉及项目创建与管理、需求规划与迭代、代码托管与版本控制、自动化测试、持续集成与发布等方面。
|
10月前
|
Shell Linux 开发工具
windows中cmd和PowerShell批处理命令
之前在 Git 批量删除本地分支,有用到 Linux 或 MacOS 下的批处理命令,这个命令中的 grep、xargs 本身是 Shell script,在 windows 中的 cmd 和 PowerShell 中是不能用的
76 0
|
JavaScript Windows
[Vue]解决 Windows PowerShell 不识别 vue 命令的问题
[Vue]解决 Windows PowerShell 不识别 vue 命令的问题
|
Windows
使用PowerShell获取Windows当前锁屏壁纸
使用PowerShell获取Windows当前锁屏壁纸 如果原始图片丢了,用这段代码就可以提取当前锁屏壁纸了!
156 0
|
应用服务中间件 nginx Windows
Windows PowerShell 中启动 Nginx 报错解决方案
Windows PowerShell 中启动 Nginx 报错解决方案
Windows PowerShell 中启动 Nginx 报错解决方案
|
XML 监控 数据格式
利用powershell进行windows日志分析
0x00 前言   Windows 中提供了 2 个分析事件日志的 PowerShell cmdlet:一个是Get-WinEvent,超级强大,但使用起来比较麻烦;另一个是Get-EventLog,使得起来相当简单,可以实时筛选,接下来,我们利用PowerShell 来自动筛选 Windows 事件日志。
2496 0
下一篇
DDNS