Restructured Documentation
Automatic Documentation Deployment / Sync Docs to https://kb.bunny-lab.io (push) Successful in 8s
Automatic Documentation Deployment / Sync Docs to https://kb.bunny-lab.io (push) Successful in 8s
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
---
|
||||
tags:
|
||||
- PowerShell
|
||||
- Scripting
|
||||
---
|
||||
|
||||
## Purpose
|
||||
You may find that you cannot delete a VHDX file for a virtual machine you removed from Hyper-V and/or Hyper-V Failover Cluster, and either cannot afford to, or do not want to reboot your virtualization host(s) to unlock the file locked by `SYSTEM`.
|
||||
|
||||
Run the following commands to unlock the file and delete it:
|
||||
|
||||
```powershell
|
||||
Dismount-VHD -Path "C:\Path\To\Disk.vhdx" -ErrorAction SilentlyContinue
|
||||
Remove-Item -Path "C:\Path\To\Disk.vhdx" -Force
|
||||
```
|
||||
|
||||
## Related Documentation
|
||||
- [Related Virtualization and Storage Documentation](<../../../reference/Virtualization and Storage/index.md>) — Find the connected deployments, procedures, and references for this subject.
|
||||
Reference in New Issue
Block a user