使用PowerShell/PowerCli命令删除VMDK文件?
我有点卡住了,因为我想从powershell或powerCli命令中删除一些VMDK文件。
我知道如何从vSphere vCenter GUI中做到这一点,但我没有找到如何使用命令来做到这一点。
您是否认为有一种方法可以使用类似的事情来做到这一点:
Remove-Item path/to/my/VMDK
如果有人已经做到了,您能告诉我如何吗?
I'm a little bit stuck because I would like to delete some VMDK file from vSphere with a PowerShell or PowerCLI command.
I know how to do that from the vSphere vCenter GUI but I didn't find how to do that with a command.
Do you think that there is a way to do that with something like:
Remove-Item path/to/my/VMDK
If someone has already made this, can you show me how?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
vmstores
PSDRIVE选项,该选项将允许您在经过身份验证的VSPHERE会话并肩使用标准的PowerShell功能。轮询可用数据座的示例:
附加信息:使用PowerCli浏览数据存储
You could use the
vmstores
PSDrive option that will allow you to use standard PowerShell functionalities alongside an authenticated vSphere session.Example of polling your available datastores:
Additional info: Browse datastores using PowerCLI
You can also remove the vmdk file with the powercli
You can also remove the vmdk file with the powercli Remove-Harddisk cmdlet (with -DeletePermanently you physically remove the vmdk from the datastore).