I still suspect that some of the files may be in use by "something".
Is the VM you are deleting powered off when you get to the Remove-VM ?
Perhaps add a While-loop where you wait till the PowerState is PoweredOff.
I still suspect that some of the files may be in use by "something".
Is the VM you are deleting powered off when you get to the Remove-VM ?
Perhaps add a While-loop where you wait till the PowerState is PoweredOff.