使用PowerShell/PowerCli命令删除VMDK文件?

发布于 2025-02-03 19:23:57 字数 225 浏览 2 评论 0原文

我有点卡住了,因为我想从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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

奢欲 2025-02-10 19:23:57

您可以使用vmstores PSDRIVE选项,该选项将允许您在经过身份验证的VSPHERE会话并肩使用标准的PowerShell功能。

轮询可用数据座的示例:

dir -Recurse -Path vmstores:\

附加信息:使用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:

dir -Recurse -Path vmstores:\

Additional info: Browse datastores using PowerCLI

墨落成白 2025-02-10 19:23:57

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文