Powercli 5.1 poster is out! goodies !

You can find it here:

Get-VMFolderPath to check in which vm folder our vm resides

Recently i wrote a function to check in which vm folder particular vm resides. I thought i could share it 😉 This function can output folder names or folder morefs when -moref switch is specified. Sample output would be this:
get-vm ‘vm123’ | get-vmfolderpath
MY DC1\vm\test123\ntest\btest\xtest\

Get-VMfolderPath (get-vm vm1).folderid
MY DC1\vm\test123\ntest\btest\xtest\

When you want to instead of names , folder morefs:

Get-VMfolderPath (get-vm vm1).folderid -moref or
get-vm ‘vm123’ |Get-VMfolderPath -moref
Continue reading