I've been trying to get a powershell script to traverse the folder view of VC and output a list of VMs that includes the folder it is in. The problem I have is getting complete folder location of the VM like \parent\child1\child2 rather than just the specific folder the VM is in. I'm assuming the way to go is a loop through folders and then getting the VM collection for each but cant quite get the hierarchy to appear in the ouput.
So, if the folder structure in VC was
finance
invoicing
VM1
VM2
purchasing
VM3
then the output would look something like
VM1 \finance\invoicing
VM2 \finance\invoicing
VM3 \finance\purchasing
A point in the right direction would be appreciated