Hi,
i want to search some Datastores and their subdirectories for *.vmss - files and then i want to delete them.
the ESX-Servers which i want to search have local-storage named esx2401-local , esx2402-local and following
My actual script looks like:
dir 'vmstores:\virtualcenter@443\Production\Datacenter1\esx24*\*\*.vmss'
Is this the right way?
Thx in advance
Chakoe
Update:
Script now looks like:
dir "vmstores:\virtualcenter@443\Production\Datacenter1\esx24*\*\*.vmss" -Recurse | % { Remove-Item $_ }
The first part works fine...but the second part ( Remove..) does not work...no output
Any idea?
Thx in advance
I tested your script within my lab, not giving any output but it is working. I tested it on logs and they removed.
dir vmstores:\192.168.33.21@443\ha-datacenter\datastore1\*.log -Recurse | Remove-Item
Just a quick note. You've been a forum member since quite some time, so I assume you know what you do. Anyway, the .vmss files contain the "VM suspend state" of suspended/paused virtual machines and deleting these files is like pulling the power plug on a powered on system. Is this what you want to do?
André
Hi,
yes, this is what i want to do in this case...
Background:
We started some scheduled Tasks ( Host-Remediation via VUM, Suspend VMs )
After the remediation, the ESx came back online and successfully started the VMs
out of the suspended state... But *.vmss-Files stayed in each subdirectory...
In our case ( local storage) this means an 11 GB File for Each VM which isn´t used
or needed anymore...