VMware Cloud Community
phillipfromoz
Contributor
Contributor
Jump to solution

Powershell VMWare - check folder exists

Hi,

I'm starting with Powershell VMWare module.

In Vsphere client I can see the folder structure:

View->Inventory->"VMs and templates"

Within that folder I have the subfolder <server>\Production\MED

How can I verify that the folder exists using Powershell VMWare cmdlets:

<server>\Production\MED

And also the VMs in that foler

Thanks.

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You could use my Get-FolderByPath function in Folder By Path

If no object is returned, the folder does not exist.

Note that the path starts with the Datacenter.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
1 Reply
LucD
Leadership
Leadership
Jump to solution

You could use my Get-FolderByPath function in Folder By Path

If no object is returned, the folder does not exist.

Note that the path starts with the Datacenter.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos