This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$vm_name = "shred" | |
$iso_path = "C:\...\shredos-2021.08.2_23_x86-64_0.34_20221231.iso" | |
$directory = "C:\...\VirtualBox VMs\shred\vmdks" | |
# Stop the virtual machine if it's running | |
if ((VBoxManage.exe showvminfo $vm_name | Select-String 'State' | Select-String 'running') -ne $null) { | |
VBoxManage.exe controlvm $vm_name poweroff -forc | |
} | |
# Remove all existing VMDK files from the directory |
OlderNewer