1
2
3
4
5
6
7
8
9
|
#填写连接相关信息,按要求输入vcenter/esxi 服务器ip 用户名 密码
$vcenterip
=
Read-Host
"请输入vcenter/esxi服务器ip......"
$domainname
=
Read-Host
"请输入domain name,没有可以留空......"
$username
=
Read-Host
"请输入用户名......"
$userpassword
=
Read-Host
"请输入用密码......."
-AsSecureString
Connect-VIServer
-Server
$vcenterip
-User
$username
-Password
$userpassword
#按快照名称删除虚拟机快照
get-vm
|
get-snapshot
-name
"20150908"
|
remove-snapshot
|
#20150908是快照名称,如果要删除所有快照,可以用*代替
本文转自 qq8658868 51CTO博客,原文链接:http://blog.51cto.com/hujizhou/1968810,如需转载请自行联系原作者